From 4b36c35285106ae911e3a898f5edd7b31b6cd6e0 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Fri, 8 Dec 2017 18:33:28 +0100 Subject: [PATCH] Add better bash completion support Now it is easy to add new completion scripts: just drop them in the bash_completion.d directory. Signed-off-by: Jacob Kiers --- .gitignore | 1 + bash_completion.d/.gitkeep | 0 includes/bash_completion.bash | 8 ++++++++ 3 files changed, 9 insertions(+) create mode 100644 bash_completion.d/.gitkeep diff --git a/.gitignore b/.gitignore index 578793a..cea904e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.cache sublime/User/Package Control.last-run sublime/User/Package Control.system-ca-bundle +bash_completion.d diff --git a/bash_completion.d/.gitkeep b/bash_completion.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/includes/bash_completion.bash b/includes/bash_completion.bash index 2dfe374..d79dc2f 100644 --- a/includes/bash_completion.bash +++ b/includes/bash_completion.bash @@ -16,3 +16,11 @@ complete -F _tmux t # Add Gush completion. [ -f $HOME/.gush/.gush-autocomplete.bash ] && source $HOME/.gush/.gush-autocomplete.bash + +if [ -d $HOME/dotfiles/bash_completion.d ]; +then + for file in `find $HOME/dotfiles/bash_completion.d/ -type f -name '*.sh'` + do + source $file + done +fi