Skip to content

Instantly share code, notes, and snippets.

@mmarchini
Created February 6, 2015 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmarchini/a268ca39d8b77fc2aef6 to your computer and use it in GitHub Desktop.
Save mmarchini/a268ca39d8b77fc2aef6 to your computer and use it in GitHub Desktop.
User-defined bash_completion
# ~/.bash_completion
USER_BASH_COMPLETION_COMPAT_DIR="$HOME/.bash_completion.d/"
readonly USER_BASH_COMPLETION_COMPAT_DIR
# source compat completion directory definitions
if [[ -d $USER_BASH_COMPLETION_COMPAT_DIR && -r $USER_BASH_COMPLETION_COMPAT_DIR && \
-x $USER_BASH_COMPLETION_COMPAT_DIR ]]; then
for i in $(LC_ALL=C command ls "$USER_BASH_COMPLETION_COMPAT_DIR"); do
i=$USER_BASH_COMPLETION_COMPAT_DIR/$i
[[ ${i##*/} != @($_backup_glob|Makefile*|$_blacklist_glob) \
&& -f $i && -r $i ]] && . "$i"
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment