diff --git a/config/zsh/interactive/completion b/config/zsh/interactive/completion new file mode 100644 index 0000000..7dbc8c5 --- /dev/null +++ b/config/zsh/interactive/completion @@ -0,0 +1,38 @@ +#! zsh + +# Just show me the completions, *quietly*. +unsetopt list_beep + +# If there are no completions, try to correct minor typos in the input. +zstyle :completion:* completer _complete _correct + +# Load the nice LS_COLORS into the completion menu too. Pretty! +zstyle :completion:*:default list-colors ${(s.:.)LS_COLORS} +zstyle :completion:*:options list-colors '=^(-- *)=34' + +# List the first page, then let me menu through everything. +zmodload zsh/complist # so that listscroll is defined +zstyle :completion:* menu select +zstyle :completion:* list-prompt ' ' +zstyle :completion:* select-prompt ' %F{blue}-- %m --%f' +bindkey -M listscroll '^I' 'send-break; self-insert' + +# Permit expensive completions to cache info and therefore be usable. +zstyle :completion::complete:* use-cache on +zstyle :completion::complete:* cache-path $XDG_CACHE_HOME/zsh/compcache + +# Group completions under cute headings. +zstyle :completion:* format ' %F{yellow}-- %d --%f' +zstyle :completion:*:corrections format ' %F{green}-- %d (errors: %e) --%f' +zstyle :completion:*:warnings format ' %F{red}-- no matches found --%f' +zstyle :completion:* group-name '' + +# When listing completions, highlight the first ambiguous character. +zstyle :completion:* show-ambiguity 01\;31 + +# When listing directories, treat foo//bar as foo/bar, not foo/*/bar. +zstyle :completion:* squeeze-slashes true + +# When completing the names of man pages, group them by section. +zstyle :completion:*:manuals separate-sections true +zstyle :completion:*:manuals.* insert-sections true diff --git a/config/zsh/zplugin b/config/zsh/zplugin index 4884150..24f7c12 100644 --- a/config/zsh/zplugin +++ b/config/zsh/zplugin @@ -25,7 +25,6 @@ if [[ ! $LS_COLORS_DIR/LS_COLORS.plugin.zsh -nt $LS_COLORS_DIR/LS_COLORS ]]; the zplugin compile trapd00r/LS_COLORS source $LS_COLORS_DIR/LS_COLORS.plugin.zsh fi -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} zplugin $load zsh-users/zsh-completions zplugin $load zsh-users/zsh-syntax-highlighting