add an option for completion auto-rehash

This commit is contained in:
ncanceill 2015-04-30 14:06:48 +02:00 committed by Marcos Alano
parent 2bf4b6e544
commit 3329122ba9
2 changed files with 10 additions and 2 deletions

View File

@ -32,8 +32,11 @@ else
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
fi fi
# auto-complete external commands # rehash on every external command completion request
if [ "x$REHASH_COMPLETION" = "xtrue" ]; then
zstyle ':completion:*' rehash true zstyle ':completion:*' rehash true
unset REHASH_COMPLETION
fi
# disable named-directories autocompletion # disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories

View File

@ -28,6 +28,11 @@ ZSH_THEME="robbyrussell"
# Uncomment the following line to display red dots whilst waiting for completion. # Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true" # COMPLETION_WAITING_DOTS="true"
# Uncomment the following line to force a rehash on every external completion
# request, so newly installed commands are automatically completed without
# reloading the shell. Be aware that this may impact completion performance.
# REHASH_COMPLETION="true"
# Uncomment the following line if you want to disable marking untracked files # Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories # under VCS as dirty. This makes repository status check for large repositories
# much, much faster. # much, much faster.