Rust tools for brebuilt repos/releases to speed things up

Some tmux/vim tweaks

Added TLDR via pip3
This commit is contained in:
Sagi Dayan 2022-01-03 11:46:10 +02:00
parent 985049199d
commit 7feed56ec2
Signed by: sagi
GPG key ID: FAB96BFC63B46458
9 changed files with 148 additions and 115 deletions

View file

@ -18,7 +18,7 @@ Run Workstation playbook on fedora:
Run cli-tools playbook on centos: Run cli-tools playbook on centos:
stage: x86 Systems stage: x86 Systems
image: centos:8 image: centos:latest
script: script:
- dnf install -y epel-release dnf-plugins-core - dnf install -y epel-release dnf-plugins-core
- dnf install -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm - dnf install -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm

View file

@ -22,6 +22,14 @@ setw -g mouse on
bind-key | split-window -h -c "#{pane_current_path}" bind-key | split-window -h -c "#{pane_current_path}"
bind-key \\ split-window -h -c "#{pane_current_path}" bind-key \\ split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}" bind-key - split-window -v -c "#{pane_current_path}"
# close window with <prefix-q>
bind-key q kill-window
# refresh window with <prefix-e>
bind-key e respawn-window -k
# <prefix>-j/k for up down (useful to move between history commands)
bind-key k send-keys Up
bind-key j send-keys Down
# Easy config reload # Easy config reload
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded." bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
@ -34,7 +42,6 @@ set -g @plugin "arcticicestudio/nord-tmux"
# set -g @plugin 'egel/tmux-gruvbox' # set -g @plugin 'egel/tmux-gruvbox'
# set -g @tmux-gruvbox 'dark' # or 'light' # set -g @tmux-gruvbox 'dark' # or 'light'
# Tmux yank (For clipboard integration) # Tmux yank (For clipboard integration)
set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-yank'
# Mouse select to clipboard # Mouse select to clipboard
@ -55,3 +62,7 @@ set -g default-terminal "xterm-256color"
# Home/End support # Home/End support
bind -n End send-key C-e bind -n End send-key C-e
bind -n Home send-key C-a bind -n Home send-key C-a
# Set active pane border background
set-option -g pane-active-border-style bg=#8abeb7

View file

@ -51,10 +51,12 @@ autocmd VimEnter *
" Toggle NerdTree with Ctrl+n " Toggle NerdTree with Ctrl+n
map <C-n> :NERDTreeToggle<CR> map <C-n> :NERDTreeToggle<CR>
" Open fzf Files search " Open fzf Files search Ctrl+p
map <C-p> :Files<CR> map <C-p> :Files<CR>
" Open file search " Open file search Ctrl+f
map <C-f> :BLines<CR> map <C-f> :BLines<CR>
" Open Global search Ctrl+s
map <C-s> :Ag<CR>
" Indent Guides auto start " Indent Guides auto start
let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_enable_on_vim_startup = 1
@ -66,10 +68,10 @@ map <C-t> :tabnew<CR>
noremap <Tab><Tab> :tabn<CR> noremap <Tab><Tab> :tabn<CR>
" Insert mode navigation Alt+hjkl " Insert mode navigation Alt+hjkl
imap <C-s-h> <Left> imap <M-h> <Left>
imap <C-s-l> <Right> imap <M-l> <Right>
imap <C-s-j> <Down> imap <M-j> <Down>
imap <C-s-k> <Up> imap <M-k> <Up>
" Set line heighlight on by default " Set line heighlight on by default
set cursorline set cursorline
@ -336,6 +338,7 @@ set statusline+=\ %P "percent through file
" Note: must appear after the last line that is altering colorscheme " Note: must appear after the last line that is altering colorscheme
hi clear SpellBad hi clear SpellBad
hi SpellBad cterm=underline hi SpellBad cterm=underline
set spell
"============================================================================== "==============================================================================
" Delete settings " Delete settings

View file

@ -9,6 +9,7 @@
- wget - wget
- git - git
- ranger - ranger
- jq
state: present state: present
- name: Some more packages (RedHat based) - name: Some more packages (RedHat based)
@ -70,13 +71,6 @@
dest: ~/.shellconfig/common.sh dest: ~/.shellconfig/common.sh
force: yes force: yes
- name: verify Bat (better Cat) theme
changed_when: false
ansible.builtin.lineinfile:
path: "~/.shellconfig/common.sh"
regexp: "^export BAT_THEME="
line: 'export BAT_THEME="${{theme}}"'
- name: Copy shell aliases - name: Copy shell aliases
copy: copy:
src: dotfiles/shellconfig/aliases.sh src: dotfiles/shellconfig/aliases.sh
@ -95,30 +89,7 @@
dest: ~/.shellconfig/environment.sh dest: ~/.shellconfig/environment.sh
force: no force: no
- name: Verifying gitui config folder
file:
path: ~/.config/gitui
state: directory
- name: Copy gitui keybindings config file - name: Install modern UNIX tools
copy:
src: dotfiles/gitui/key_config.ron
dest: ~/.config/gitui/key_config.ron
force: yes
- name: Copy gitui theme config file
copy:
src: dotfiles/gitui/theme.ron
dest: ~/.config/gitui/theme.ron
force: yes
- name: Install rust and common tooling
vars:
rustup_user: "{{ running_user }}"
rustup_cargo_crates: [bat,lsd,bottom]
ansible.builtin.include_role:
name: hurricanehrndz.rustup
- name: Gitui user
include_role: include_role:
name: gitui_user name: modern_unix_tools

View file

@ -0,0 +1,46 @@
---
- name: Validate manual versioning folder
ansible.builtin.file:
state: directory
path: ~/.ansible_gh_release_versions
- name: Setting local release file path
set_fact:
local_version_file: "~/.ansible_gh_release_versions/{{ name }}"
- name: Fetch latest release tarball url
shell:
cmd: curl -s https://api.github.com/repos/{{ repo }}/releases/latest | jq -r '.assets[] | select(.browser_download_url|test("{{ filter }}")) | .browser_download_url'
warn: false
register: tar_url
changed_when: false
- name: Get latest version tag from github
shell: echo {{ tar_url.stdout }} | grep -oP "(?<=download\/).*(?=\/)"
changed_when: false
register: version
- name: Get latest version from local entry
set_fact:
local_version: "{{ lookup('file', local_version_file, errors='ignore') }}"
version: "{{ version.stdout }}"
tar_url: "{{ tar_url.stdout }}"
tar_download_location: "/tmp/{{ name }}.tar.gz"
failed_when: false
- name: Unarchive the release
ansible.builtin.unarchive:
src: "{{ tar_url }}"
dest: /tmp/
remote_src: yes
when: version != local_version
- name: Moving bin to /usr/local/bin
become: true
shell: |
cp /tmp{{ bin_path }} /usr/local/bin/{{ name }}
when: version != local_version
- name: Updating local version entry
shell: echo {{ version }} > {{ local_version_file }}
when: version != local_version

View file

@ -1,28 +0,0 @@
- name: Install gitui dependencies (RHEL)
become: true
package:
name: &gitui_deps_rhel
- perl
state: present
when: ansible_facts['os_family'] == "RedHat"
- name: Installing gitui
vars:
rustup_user: "{{ running_user }}"
rustup_cargo_crates: [gitui]
ansible.builtin.include_role:
name: hurricanehrndz.rustup
- name: Setting up ncspot alias (spot)
ansible.builtin.lineinfile:
line: alias spot=ncspot
state: present
path: ~/.shellconfig/aliases.sh
insertafter: EOF
- name: Remove gitui dependencies (RHEL)
become: true
package:
name: *gitui_deps_rhel
state: absent
when: ansible_facts['os_family'] == "RedHat"

View file

@ -0,0 +1,64 @@
---
- name: Installing bat (cat like)
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: bat
repo: sharkdp/bat
bin_path: "/bat*/bat"
filter: x86_64-unknown-linux-gnu
- name: verify Bat (better Cat) theme
changed_when: false
ansible.builtin.lineinfile:
path: "~/.shellconfig/common.sh"
regexp: "^export BAT_THEME="
line: 'export BAT_THEME="${{theme}}"'
- name: Instaling TLDR (pip3)
shell: pip3 install tldr
- name: Installing bottom (btm) (Top like)
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: btm
repo: ClementTsang/bottom
bin_path: "/btm"
filter: bottom_x86_64-unknown-linux-gnu.tar.gz
- name: Installing gitui
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: gitui
repo: extrawurst/gitui
bin_path: "/gitui"
filter: gitui-linux-musl
- name: Verifying gitui config
file:
path: ~/.config/gitui
state: directory
- name: Copy gitui keybindings
copy:
src: dotfiles/gitui/key_config.ron
dest: ~/.config/gitui/key_config.ron
force: yes
- name: Copy gitui theme config
copy:
src: dotfiles/gitui/theme.ron
dest: ~/.config/gitui/theme.ron
force: yes
- name: Installing LSD (ls like)
ansible.builtin.include_role:
name: gh_release_bin
vars:
name: lsd
repo: Peltoche/lsd
bin_path: "/lsd-*/lsd"
filter: x86_64-unknown-linux-gnu.tar.gz

View file

@ -1,36 +1,12 @@
- name: Install ncspot dependencies (RHEL) ---
become: true - name: Installing ncspot (Spotify)
package:
name: &ncspot_deps_rhel
- pulseaudio-libs-devel
- libxcb-devel
- openssl-devel
- ncurses-devel
- dbus-devel
state: present
when: ansible_facts['os_family'] == "RedHat"
- name: Install ncspot dependencies (Debian)
become: true
package:
name: &ncspot_deps_debian
- libncursesw5-dev
- libdbus-1-dev
- libpulse-dev
- libssl-dev
- libxcb1-dev
- libxcb-render0-dev
- libxcb-shape0-dev
- libxcb-xfixes0-dev
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Installing nscpot
vars:
rustup_user: "{{ running_user }}"
rustup_cargo_crates: [ncspot]
ansible.builtin.include_role: ansible.builtin.include_role:
name: hurricanehrndz.rustup name: gh_release_bin
vars:
name: ncspot
repo: hrkfdn/ncspot
bin_path: "/ncspot"
filter: linux-x86_64.tar.gz
- name: Setting up ncspot alias (spot) - name: Setting up ncspot alias (spot)
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@ -39,16 +15,3 @@
path: ~/.shellconfig/aliases.sh path: ~/.shellconfig/aliases.sh
insertafter: EOF insertafter: EOF
- name: Remove ncspot dependencies (RHEL)
become: true
package:
name: *ncspot_deps_rhel
state: absent
when: ansible_facts['os_family'] == "RedHat"
- name: Remove ncspot dependencies (Debian)
become: true
package:
name: *ncspot_deps_debian
state: absent
when: ansible_facts['os_family'] == "Debian"

View file

@ -3,13 +3,16 @@
package: package:
name: name:
- vim-X11 - vim-X11
- the_silver_searcher
state: latest state: latest
when: ansible_facts['os_family'] == "RedHat" when: ansible_facts['os_family'] == "RedHat"
- name: Install vim (Debian based) - name: Install vim (Debian based)
become: true become: true
package: package:
name: vim-gtk name:
- vim-gtk
- silversearcher-ag
state: present state: present
when: ansible_facts['os_family'] == "Debian" when: ansible_facts['os_family'] == "Debian"