## vim:ft=zsh zstyle :compinstall filename ~/.zshrc zstyle ':completion:*' cache-path ~/var/cache/zsh zstyle ':completion:*' use-cache true # Use ls-colors for file completion check_com -c dircolors && zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} # Mark the current selection when tabbing through possible completions zstyle ':completion:*' menu select=1 # Complete uppercase names with lowercase and spaces with _ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z} m:_=\\\ ' '' # Be verbose char=${ps_yellow}ยท${ps_reset} zstyle ':completion:*' verbose true zstyle ':completion:*:descriptions' format \ "$char %d $char" zstyle ':completion:*:messages' format \ "$char %d $char" zstyle ':completion:*:corrections' format \ "$char %d $char" zstyle ':completion:*:warnings' format \ "${ps_red}no match:${ps_reset} %d" zstyle ':completion:*' group-name '' unset char # Force menu completion since the input is just a stupid number zstyle ':completion:*:*:kill:*' menu yes zstyle ':completion:*:*:(todo|td*):*:items' menu yes # mplayer does not complete flac by default zstyle ':completion:*:*:mplayer:*' file-patterns \ '*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|wma|wmv)(-.)' \ '*(-/):directories' '*:all-files' zstyle ':completion:*:*:vi(m|):*' ignored-patterns \ 'a.out|*.o' # fancy kill completion # source: http://madism.org/~madcoder/dotfiles/zsh/40_completion zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)[ 0-9:]#([^ ]#)*=01;30=01;31=01;38' # separate manuals by sections zstyle ':completion:*:manuals' separate-sections true zstyle ':completion:*:manuals.*' insert-sections true # $hosts is set from the hosts package zstyle -e ':completion:*' hosts 'reply=(${(k)hosts})' if [[ -r $compdump ]] { compinit -C -d $compdump } else { echo -n "Creating completion cache..." compinit -d $compdump echo } compdef _hosts sshmount compdef _functions reload