From 891e547055c48523ab89e2297eb23636c1aed931 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 28 Jan 2017 20:51:23 +1300 Subject: Start using Bash host completion But use ~/.hosts if it's there --- bash/bashrc | 4 ++-- bash/bashrc.d/completion.bash | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'bash') 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: (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 -- cgit v1.2.3