diff --git a/bash/completion b/bash/completion new file mode 100644 index 0000000..0b92919 --- /dev/null +++ b/bash/completion @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +COMPLETION_DIR=/usr/local/etc/bash_completion.d/ + +if [ -d "$COMPLETION_DIR" ]; then + for i in $(ls "$COMPLETION_DIR"); do + file="$COMPLETION_DIR/$i" + if [ -r $file ]; then + source $file + fi + unset file + done + unset i +fi + +[[ -f /usr/local/etc/bash_completion ]] && source /usr/local/etc/bash_completion + +unset COMPLETION_DIR diff --git a/bashrc b/bashrc index 38e21f0..9a829d2 100644 --- a/bashrc +++ b/bashrc @@ -16,12 +16,12 @@ source-file ~/.bash/path source-file ~/.bash/environment source-file ~/.bash/prompt source-file ~/.bash/ensure-ssh-agent +source-file ~/.bash/completion source-file ~/opt/bash/env source-file ~/go/bin unset -f source-file -[[ -f /usr/local/etc/bash_completion ]] && source /usr/local/etc/bash_completion [[ -f $HOME/.nvm/nvm.sh ]] && source $HOME/.nvm/nvm.sh [[ -r $NVM_DIR/bash_completion ]] && source $NVM_DIR/bash_completion