aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/completion.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/completion.bash')
-rw-r--r--bash/bashrc.d/completion.bash15
1 files changed, 10 insertions, 5 deletions
diff --git a/bash/bashrc.d/completion.bash b/bash/bashrc.d/completion.bash
index 0d8dbb13..51de24b8 100644
--- a/bash/bashrc.d/completion.bash
+++ b/bash/bashrc.d/completion.bash
@@ -1,11 +1,15 @@
-# Various easy completions for Bash builtins; more specific stuff goes in
-# ~/.bash_completion.d
+# Simple completions for Bash builtins and POSIX utilities; more specific or
+# complex stuff goes in ~/.bash_completion.d, for possible dynamic loading
# If COMP_WORDBREAKS has a value, strip all colons from it; this allows
-# completing filenames correctly, since an unquoted colon is not a syntactic
-# character: <http://tiswww.case.edu/php/chet/bash/FAQ> (E13)
+# completing filenames correctly, since a colon is not a shell metacharacter:
+# <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
@@ -18,7 +22,8 @@ complete -A disabled enable
complete -A setopt set
# Commands
-complete -A command alias command complete compopt coproc exec if hash time type until while
+complete -A command alias command complete compopt coproc exec if hash time \
+ type until while
# Directories
complete -A directory cd pushd mkdir rmdir