diff options
Diffstat (limited to 'bashrc/common/bashcomp.sh')
-rw-r--r-- | bashrc/common/bashcomp.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bashrc/common/bashcomp.sh b/bashrc/common/bashcomp.sh new file mode 100644 index 0000000..48d83fa --- /dev/null +++ b/bashrc/common/bashcomp.sh @@ -0,0 +1,20 @@ +# bash completion + +bmajor=${BASH_VERSION%%.*} +bminor=${BASH_VERSION#*.} +bminor=${bminor//[^0-9]*} + +if [[ ${bmajor} -eq 2 && ${bminor} -gt 4 ]] || [[ ${bmajor} -gt 2 ]]; then + [[ -f /etc/bash_completion ]] && source /etc/bash_completion + + if [[ -d ~/.bash_completion.d ]]; then + for i in ~/.bash_completion.d/*; do + [[ -f ${i} ]] && source ${i} + done + fi +fi + +unset bmajor bminor + +export COMP_WORDBREAKS=${COMP_WORDBREAKS/:/} +export FIGNORE=".o:~" |