Add support for per-user bash completion files

This commit is contained in:
Fernando Schauenburg 2019-11-13 14:42:07 +01:00
parent 4e9c8e8470
commit f65c4858ab

View file

@ -361,13 +361,11 @@ stty -ixon # disable ctrl-s and ctrl-q
_update_colors "${BACKGROUND:-dark}"
# Enable available completion helpers
if [ -d "$LOCAL_PREFIX/etc/bash_completion.d" ]; then
for completion in "$LOCAL_PREFIX/etc/bash_completion.d"/*; do
# shellcheck disable=SC1090
source "$completion"
done
unset completion
fi
while read -r d; do [ -d "$d" ] && for f in "$d"/*; do . "$f"; done; done <<EOL
$LOCAL_PREFIX/etc/bash_completion.d
$XDG_CONFIG_HOME/bash/completion.d
EOL
unset d f
# Source a local bashrc if available
if [ -f "$XDG_CONFIG_HOME/bash/profile.local" ]; then