diff --git a/zsh/completion.zsh b/zsh/completion.zsh index 98c4819..f7ad916 100644 --- a/zsh/completion.zsh +++ b/zsh/completion.zsh @@ -1,6 +1,21 @@ -autoload -U compinit && compinit +# ===== init completion +autoload -Uz compinit && compinit -d ~/.zsh/cache/zcompdump 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 +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 zstyle ':completion::complete:*' use-cache on zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST diff --git a/zsh/setopt.zsh b/zsh/setopt.zsh index d7b7626..d15ac95 100644 --- a/zsh/setopt.zsh +++ b/zsh/setopt.zsh @@ -27,19 +27,6 @@ setopt pushd_minus # treat #, ~ and ^ as part of patterns for filename generation 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 # suggest a similar command name if the current one doesn't exist #setopt correct