summaryrefslogtreecommitdiff
path: root/lib/completion.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/completion.zsh')
-rw-r--r--lib/completion.zsh20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh
index 43927a277..2c5695487 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -32,9 +32,9 @@ 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
@@ -58,18 +58,20 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
# ... unless we really want to.
zstyle '*' single-ignored show
-if [[ $COMPLETION_WAITING_DOTS = true ]]; then
+if [[ ${COMPLETION_WAITING_DOTS:-false} != false ]]; 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
-
+ # use $COMPLETION_WAITING_DOTS either as toggle or as the sequence to show
+ [[ $COMPLETION_WAITING_DOTS = true ]] && COMPLETION_WAITING_DOTS="%F{red}…%f"
+ # turn off line wrapping and print prompt-expanded "dot" sequence
+ printf '\e[?7l%s\e[?7h' "${(%)COMPLETION_WAITING_DOTS}"
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