From cb9ce1bbd82c13597c8c66d00a099554bac117e4 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 17 Mar 2011 13:54:24 +0100 Subject: Update from grml's zsh setup --- .zsh/zshrc/20_compsys | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to '.zsh/zshrc/20_compsys') diff --git a/.zsh/zshrc/20_compsys b/.zsh/zshrc/20_compsys index cd3ae49..eec44d6 100644 --- a/.zsh/zshrc/20_compsys +++ b/.zsh/zshrc/20_compsys @@ -2,6 +2,8 @@ # # configure the completions system # +# Parts taken from grml's zsh setup. +# # Copyright © 2011 Tobias Klauser # Copyright © 1994–2008 martin f. krafft # Released under the terms of the Artistic Licence 2.0 @@ -50,15 +52,26 @@ zstyle ':completion:*' cache-path $ZVARDIR/compcache zstyle ':completion:*' completer _complete _ignored _match _correct _approximate # allow cursor-key navigation through completion set -zstyle ':completion:*:*:*:*' menu select +zstyle ':completion:*:*:*:*' menu select # use colours in completion lists and menus -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} + +# activate menu +zstyle ':completion:*:history-words' menu yes + +# ignore duplicate entries +zstyle ':completion:*:history-words' remove-all-dups yes +zstyle ':completion:*:history-words' stop yes + +# match uppercase from lowercase +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # ignore working and backup copies, and compiled objects zstyle ':completion:*:(all-|)files' ignored-patterns \ '*.bk' '*.bak' '*.old' '*~' '.*.sw?' '*.o' '*.pyc' +# allow one error for every three characters typed in approximate completer zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) not-numeric )' zstyle -e ':completion:*:correct:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2)) numeric )' #zstyle ':completion:*:correct:::' max-errors 1 not-numeric @@ -89,9 +102,21 @@ zstyle -e ':completion:*:*:vim#:*:*' ignored-patterns \ 'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] && reply=(*.(aux|dvi|log|ps|pdf|bbl|toc|lot|lof|latexmain)) || reply=()' +zstyle ':completion:*:messages' format '%d' +zstyle ':completion:*:options' auto-description '%d' + +# describe options in full +zstyle ':completion:*:options' description 'yes' + # 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"' +# offer indexes before parameters in subscripts +zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters + +# provide verbose completion information +zstyle ':completion:*' verbose true + # commands that take commands as arguments compdef _precommand gdb compdef _precommand nohup @@ -111,8 +136,4 @@ zstyle ':completion:*:man:*' menu yes select # provide .. as a completion zstyle ':completion:*' special-dirs .. -# #527301 -zstyle :completion::complete:xmms2:\*:values list-grouped false -zstyle :completion::complete:xmms2:\*:values sort false - # vim:ft=zsh -- cgit v1.2.3-54-g00ecf