| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- # make autocompletion faster by caching
- autoload -Uz compinit
- compinit -d "$HOME/.zsh/cache/zcompdump"
- zstyle ':completion:*' use-cache on
- zstyle ':completion:*' cache-path $HOME/.zsh/cache
- # use menu
- zstyle ':completion:*' menu select
- # enable approximate autocompletion
- 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)) numeric)'
- # Smart matching of dashed values, e.g. f-b matching foo-bar
- zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*'
- # Group results by category
- zstyle ':completion:*' group-name ''
- # Keep directories and files separated
- zstyle ':completion:*' list-dirs-first true
- # Don't try parent path completion if the directories exist
- zstyle ':completion:*' accept-exact-dirs true
- zstyle ':completion:*' squeeze-slashes true
- # Always use menu selection for `cd -`
- zstyle ':completion:*:*:cd:*:directory-stack' force-list always
- zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
- # ignore completion functions for commands you don't have
- zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec)|TRAP*)'
- # Prettier completion for processes
- zstyle ':completion:*:*:*:*:processes' force-list always
- zstyle ':completion:*:*:*:*:processes' menu yes select
- zstyle ':completion:*:*:*:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
- zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,args -w -w"
- zstyle ':filter-select:highlight' matched fg=red
- zstyle ':filter-select' max-lines 10
- zstyle ':filter-select' rotate-list yes
- zstyle ':filter-select' case-insensitive yes # enable case-insensitive search
- # Use ls-colors for path completions
- function _set-list-colors() {
- zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
- unfunction _set-list-colors
- }
- sched 0 _set-list-colors # deferred since LC_COLORS might not be available yet
|