diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-28 20:51:23 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-28 20:51:23 +1300 |
commit | 891e547055c48523ab89e2297eb23636c1aed931 (patch) | |
tree | 127f9efc3050a6eb651514c3aabd477aa26f5f3d | |
parent | Correct a typeset call (diff) | |
download | dotfiles-891e547055c48523ab89e2297eb23636c1aed931.tar.gz dotfiles-891e547055c48523ab89e2297eb23636c1aed931.zip |
Start using Bash host completion
But use ~/.hosts if it's there
-rw-r--r-- | bash/bashrc | 4 | ||||
-rw-r--r-- | bash/bashrc.d/completion.bash | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc index ca13c4bf..16669adf 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -57,8 +57,8 @@ shopt -s histappend shopt -s histreedit # Repeat the expanded line on successful history expansion shopt -s histverify -# Don't use Bash's builtin host completion -shopt -u hostcomplete +# Use Bash's builtin host completion +shopt -s hostcomplete # Don't change newlines to semicolons in history shopt -s lithist # Don't warn me about new mail all the time diff --git a/bash/bashrc.d/completion.bash b/bash/bashrc.d/completion.bash index 0d8dbb13..c77f8844 100644 --- a/bash/bashrc.d/completion.bash +++ b/bash/bashrc.d/completion.bash @@ -6,6 +6,10 @@ # character: <http://tiswww.case.edu/php/chet/bash/FAQ> (E13) [[ -n $COMP_WORDBREAKS ]] && COMP_WORDBREAKS=${COMP_WORDBREAKS//:} +# If ~/.hosts exists, use that as the host completion file rather than +# /etc/hosts, so I can populate the list myself +[[ -f $HOME/.hosts ]] && HOSTFILE=$HOME/.hosts + # Aliases complete -A alias unalias |