# Add zsh-completions to $fpath. fpath=("${0:h}/usr/share/zsh/site-functions" $fpath) setopt COMPLETE_IN_WORD # Complete from both ends of a word. setopt ALWAYS_TO_END # Move cursor to the end of a completed word. setopt PATH_DIRS # Perform path search even on command names with slashes. setopt AUTO_MENU # Show completion menu on a successive tab press. setopt AUTO_LIST # Automatically list choices on ambiguous completion. setopt EXTENDED_GLOB # Needed for file modification glob modifiers with compinit setopt NO_NOMATCH # [default] unmatched patterns are left unchanged setopt GLOB_COMPLETE # Complete without expanding glob setopt NOAUTOREMOVESLASH # Do not remove postfix slash of command line unsetopt MENU_COMPLETE # Do not autoselect the first completion entry. unsetopt FLOW_CONTROL # Disable start/stop characters in shell editor. autoload -Uz compinit _comp_files=($XDG_CACHE_HOME/.zcompdump(Nm-20)) if (( $#_comp_files )); then compinit -i -C else compinit -i fi unset _comp_files zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]}' '+m:{[:upper:]}={[:lower:]}' '+m:{_-}={-_}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} zstyle -e ':completion:*' special-dirs '[[ $PREFIX = (../)#(..) ]] && reply=(..)' zstyle ':completion:*:complete:(cd|pushd):*' tag-order 'local-directories named-directories' zstyle ':completion:*' group-name '' zstyle ':completion:*:descriptions' format '%F{yellow}%d %f' zstyle ':completion:*' menu select zstyle ':completion::complete:*' use-cache on zstyle ':completion::complete:*' cache-path "$XDG_CACHE_HOME/zcompcache" zstyle ':completion:*:matches' group 'yes' zstyle ':completion:*:options' description 'yes' zstyle ':completion:*:options' auto-description '%d' zstyle ':completion:*:default' list-prompt '%S%M matches%s' zstyle ':completion:*' verbose yes zstyle ':completion:*' completer _complete _match _approximate zstyle ':completion:*:match:*' original only zstyle ':completion:*:approximate:*' max-errors 1 numeric zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)' zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))' zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters zstyle ':completion:*:*:cd:*:directory-stack' menu yes select zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand' zstyle ':completion:*:history-words' stop yes zstyle ':completion:*:history-words' remove-all-dups yes zstyle ':completion:*:history-words' list false zstyle ':completion:*:history-words' menu yes zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-} zstyle ':completion:*:(rm|kill|diff):*' ignore-line other zstyle ':completion:*:rm:*' file-patterns '*:all-files' zstyle ':completion:*:*:*:*:processes' command 'ps -u $LOGNAME -o pid,user,command -w' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01' zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:*:kill:*' force-list always zstyle ':completion:*:*:kill:*' insert-ids single zstyle ':completion:*:man:*' menu yes select zstyle ':completion:*:manuals' separate-sections true zstyle ':completion:*:manuals.(^1*)' insert-sections true zstyle ':completion:*:parameters' list-colors '=*=34' zstyle ':completion:*:commands' list-colors '=*=32' zstyle ':completion:*:builtins' list-colors '=*=1;38;5;142' zstyle ':completion:*:aliases' list-colors '=*=2;38;5;120' zstyle ':completion:*:options' list-colors '=^(-- *)=34' zstyle ':completion:*:default' list-colors '=(#b)*(-- *)=36=33' '=*=36' zstyle ':completion:*' rehash true zstyle ':completion:*' list-separator " " zstyle ':completion:*' list-dirs-first true