diff --git a/files/dotfiles/zshrc b/files/dotfiles/zshrc index 97d46c8..10db868 100644 --- a/files/dotfiles/zshrc +++ b/files/dotfiles/zshrc @@ -108,8 +108,10 @@ source ~/.shellconfig/aliases.sh source ~/.shellconfig/environment.sh # Functions source ~/.shellconfig/functions.sh - - +# Auto complete functions +if [ -d ~/.shellconfig/autocomplete ]; then + [ "$(ls -A ~/.shellconfig/autocomplete/)" ] && source <(cat ~/.shellconfig/autocomplete/*) +fi # Start tmux if not in a session diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 728bcfe..e89f142 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -10,6 +10,7 @@ - git - ranger - jq + - man-db state: present - name: Some more packages (RedHat based) @@ -64,6 +65,11 @@ path: ~/.shellconfig state: directory +- name: Verifying shell autocomplete config folder + file: + path: ~/.shellconfig/autocomplete + state: directory + - name: Sync Common shell settings... changed_when: false copy: diff --git a/roles/gh_release_bin/tasks/main.yml b/roles/gh_release_bin/tasks/main.yml index 9690a7e..1718f1c 100644 --- a/roles/gh_release_bin/tasks/main.yml +++ b/roles/gh_release_bin/tasks/main.yml @@ -38,9 +38,27 @@ - name: Moving bin to /usr/local/bin become: true shell: | - cp /tmp{{ bin_path }} /usr/local/bin/{{ name }} + cp /tmp{{ bin_path }} /usr/local/bin/ when: version != local_version +- name: Adding man page if needed + become: true + shell: | + cp /tmp{{ man_path }} /usr/share/man/man1/ + register: added_man + when: man_path is defined and (version != local_version) + +- name: Update mandb if needed + become: true + shell: mandb + when: added_man is defined + +- name: Adding autocomplete if needed + shell: | + cp /tmp/{{ autocomplete_path }} ~/.shellconfig/autocomplete/ + when: autocomplete_path is defined and (version != local_version) + - name: Updating local version entry shell: echo {{ version }} > {{ local_version_file }} when: version != local_version + diff --git a/roles/modern_unix_tools/tasks/main.yml b/roles/modern_unix_tools/tasks/main.yml index 2c222b6..afb17f2 100644 --- a/roles/modern_unix_tools/tasks/main.yml +++ b/roles/modern_unix_tools/tasks/main.yml @@ -5,7 +5,9 @@ vars: name: bat repo: sharkdp/bat - bin_path: "/bat*/bat" + bin_path: "/bat-*/bat" + man_path: "/bat-*/bat.1" + autocomplete_path: "/bat-*/autocomplete/bat.bash" filter: x86_64-unknown-linux-gnu - name: verify Bat (better Cat) theme @@ -25,6 +27,7 @@ name: btm repo: ClementTsang/bottom bin_path: "/btm" + autocomplete_path: "/completion/btm.bash" filter: bottom_x86_64-unknown-linux-gnu.tar.gz - name: Installing gitui @@ -60,6 +63,8 @@ name: lsd repo: Peltoche/lsd bin_path: "/lsd-*/lsd" + man_path: "/lsd-*/lsd.1" + autocomplete_path: "/lsd-*/autocomplete/lsd.bash-completion" filter: x86_64-unknown-linux-gnu.tar.gz - name: Installing ripgrep (grep like) @@ -69,5 +74,7 @@ name: rg repo: BurntSushi/ripgrep bin_path: "/ripgrep-*/rg" + man_path: "/ripgrep-*/doc/rg.1" + autocomplete_path: "/ripgrep-*/complete/rg.bash" filter: x86_64-unknown-linux-musl.tar.gz