All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 # Configures the completions system
5 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
8 # Source repository: http://git.madduck.net/v/etc/zsh.git
11 # automatically list choices on an ambiguous completion
14 # use menu after the second completion request
17 # recognise exact matches even if they're ambiguous
20 # move cursor to end of word being completed
23 # correct all arguments, not just the command
26 # be magic about adding/removing final characters on tab completion
27 setopt auto_param_keys auto_param_slash auto_remove_slash
29 # initialise the completion system
31 compinit -d $VAR/zsh/compdump
34 zstyle ':completion:*' use-cache on
35 zstyle ':completion:*' cache-path $ZVAR/compcache
37 #zstyle ':completion:*' completer _list _expand _complete _ignored _match _correct _approximate _prefix
38 zstyle ':completion:*' completer _complete _ignored _match _approximate
40 # use colours in completion lists and menus
41 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
43 # ignore working and backup copies
44 zstyle ':completion:*:(all-|)files' ignored-patterns \
45 '*.bk' '*.bak' '*.old' '*~' '.*.sw?'
47 # populate hosts completion with SSH's known_hosts
49 _myhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
50 zstyle ':completion:*' hosts $_myhosts;
52 zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) numeric )'
54 #zstyle ':completion:*' list-suffixes true
55 #zstyle ':completion:*' match-original both
56 #zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
57 #zstyle ':completion:*:match:*' original only
58 #zstyle ':completion:*' original true
59 #zstyle ':completion:*' squeeze-slashes true
61 # functions which start with _ are internal and ignored
62 zstyle ':completion:*:functions' ignored-patterns '_*'
64 # do not offer files already specified on the line
65 zstyle ':completion:*:rm:*' ignore-line yes
67 #zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
68 #zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
70 # ignore current directory when completing in ../
71 #zstyle ':completion:*:cd:*' ignore-parents parent pwd
72 zstyle ':completion:*' ignore-parents parent pwd
74 # http://xana.scru.org/2005/08/20#ignorelatexjunk
75 zstyle -e ':completion:*:*:vim#:*:*' ignored-patterns \
76 'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] &&
77 reply=(*.(aux|dvi|log|ps|pdf|bbl|toc|lot|lof|latexmain)) || reply=()'
79 # http://madism.org/~madcoder/dotfiles/zsh/40_completion
80 zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"'
81 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)[ 0-9:]#([^ ]#)*=01;30=01;31=01;38'
83 zstyle :compinstall filename '$ETC/zsh/compsys'
85 # commands that take commands as arguments
86 compdef _precommand gdb
87 compdef _precommand nohup
88 compdef _precommand strace
90 zstyle ':completion:*' verbose yes
91 zstyle ':completion:*:descriptions' format '%B%d%b'
92 zstyle ':completion:*:messages' format '%d'
93 zstyle ':completion:*:warnings' format 'no matches for: %d'
94 zstyle ':completion:*' group-name ''