summaryrefslogtreecommitdiff
path: root/lib/completion.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/completion.zsh')
-rw-r--r--lib/completion.zsh22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh
index c7db2eb7b..ebaab0856 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -32,17 +32,17 @@ zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
if [[ "$OSTYPE" = solaris* ]]; then
- zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
+ zstyle ':completion:*:*:*:*:processes' command "ps -u $USERNAME -o pid,user,comm"
else
- zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
+ zstyle ':completion:*:*:*:*:processes' command "ps -u $USERNAME -o pid,user,comm -w -w"
fi
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
# Use caching so that commands like apt and dpkg complete are useable
-zstyle ':completion::complete:*' use-cache 1
-zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
+zstyle ':completion:*' use-cache yes
+zstyle ':completion:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
@@ -60,14 +60,16 @@ zstyle '*' single-ignored show
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
- # toggle line-wrapping off and back on again
- [[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
- print -Pn "%{%F{red}......%f%}"
- [[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
-
+ print -Pn "%F{red}…%f"
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
- bindkey "^I" expand-or-complete-with-dots
+ # Set the function as the default tab completion widget
+ bindkey -M emacs "^I" expand-or-complete-with-dots
+ bindkey -M viins "^I" expand-or-complete-with-dots
+ bindkey -M vicmd "^I" expand-or-complete-with-dots
fi
+
+# automatically load bash completion functions
+autoload -U +X bashcompinit && bashcompinit