zsh: move completion setopts from setopt.zsh into completion.zsh

This commit is contained in:
Thomas Preisner 2017-07-13 20:07:05 +02:00
parent 09816d9035
commit d900f34617
2 changed files with 16 additions and 14 deletions

View file

@ -1,6 +1,21 @@
autoload -U compinit && compinit # ===== init completion
autoload -Uz compinit && compinit -d ~/.zsh/cache/zcompdump
zmodload -i zsh/complist zmodload -i zsh/complist
# ===== setopts
# allow completion from within a word or phrase
setopt complete_in_word
# always complete and display matches immediately after pressing <Tab>
setopt no_list_ambiguous
# when completing from the middle of a word, move the cursor to the end.
setopt always_to_end
# always show completion menu on successive tab press.
# (needs unsetopt menu_complete to work)
setopt auto_menu
# do not autoselect the first completion entry
unsetopt menu_complete
# ===== completion options
# Enable completion caching, use rehash to clear # Enable completion caching, use rehash to clear
zstyle ':completion::complete:*' use-cache on zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST

View file

@ -27,19 +27,6 @@ setopt pushd_minus
# treat #, ~ and ^ as part of patterns for filename generation # treat #, ~ and ^ as part of patterns for filename generation
setopt extended_glob setopt extended_glob
# ===== completion
# When completing from the middle of a word, move the cursor to the end of the word
setopt always_to_end
# show completion menu on successive tab press. needs unsetop menu_complete to work
setopt auto_menu
# any parameter that is set to the absolute name of a directory immediately becomes a name for that directory
setopt auto_name_dirs
# Allow completion from within a word/phrase
setopt complete_in_word
# do not autoselect the first completion entry
unsetopt menu_complete
# ===== correction # ===== correction
# suggest a similar command name if the current one doesn't exist # suggest a similar command name if the current one doesn't exist
#setopt correct #setopt correct