feat(bash): use bash-completion package
This package will pick up completions installed by other packages and will source any local completions from: ~/.local/share/bash-completion/completions
This commit is contained in:
parent
ce16bca279
commit
23c7a7a616
2 changed files with 20 additions and 16 deletions
|
@ -433,17 +433,10 @@ colortest() {
|
||||||
stty -ixon # disable ctrl-s and ctrl-q
|
stty -ixon # disable ctrl-s and ctrl-q
|
||||||
_update_colors "${BACKGROUND:-dark}"
|
_update_colors "${BACKGROUND:-dark}"
|
||||||
|
|
||||||
# Enable available completion helpers
|
# shellcheck disable=SC1090
|
||||||
# shellcheck disable=SC1090 # no need to shellcheck bash completion files
|
while read -r f; do [ -f "$f" ] && source "$f"; done <<EOF
|
||||||
while read -r d; do [ -d "$d" ] && for f in "$d"/*; do [ -f "$f" ] && . "$f"; done; done <<EOL
|
/usr/share/bash-completion/bash_completion
|
||||||
$LOCAL_PREFIX/etc/bash_completion.d
|
"$LOCAL_CONFIG/bash/profile"
|
||||||
$XDG_CONFIG_HOME/bash/completion.d
|
EOF
|
||||||
EOL
|
unset f
|
||||||
unset d f
|
|
||||||
|
|
||||||
# Source a local bash configuration if available
|
|
||||||
if [ -f "$LOCAL_CONFIG/bash/profile" ]; then
|
|
||||||
# shellcheck disable=SC1090
|
|
||||||
source "$LOCAL_CONFIG/bash/profile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,22 @@
|
||||||
- name: Install latest bash (Debian)
|
- name: Install latest bash (Debian)
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
become: yes
|
become: yes
|
||||||
apt: name=bash state=latest update_cache=yes
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: latest
|
||||||
|
update_cache: yes
|
||||||
|
loop:
|
||||||
|
- bash
|
||||||
|
- bash-completion
|
||||||
|
|
||||||
- name: Install latest bash (macOS)
|
- name: Install latest bash (macOS)
|
||||||
when: ansible_os_family == "Darwin"
|
when: ansible_os_family == "Darwin"
|
||||||
homebrew: name=bash state=latest
|
homebrew:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: latest
|
||||||
|
loop:
|
||||||
|
- bash
|
||||||
|
- bash-completion
|
||||||
|
|
||||||
- name: Remove pre-installed bash configurations which could cause conflicts
|
- name: Remove pre-installed bash configurations which could cause conflicts
|
||||||
file:
|
file:
|
||||||
|
@ -22,7 +33,7 @@
|
||||||
loop:
|
loop:
|
||||||
- "~/.cache/bash"
|
- "~/.cache/bash"
|
||||||
- "~/.config/bash"
|
- "~/.config/bash"
|
||||||
- "~/.config/bash/completion.d"
|
- "~/.local/share/bash-completion/completions"
|
||||||
|
|
||||||
- name: Deploy bash profile
|
- name: Deploy bash profile
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Add table
Reference in a new issue