5 autoload
-U zsh
/complist
7 ## General completion technique
8 ## complete as much u can ..
9 zstyle
':completion:*' completer _complete _list _oldlist _expand _ignored _match _correct _approximate _prefix
10 zstyle
':completion:*' completions
1
11 zstyle
':completion:*' glob
1
13 # activate color-completion
14 zstyle
':completion:*:default' list-colors
${(s.:.)LS_COLORS}
15 zstyle
':completion:*' matcher-list
'' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*'
16 zstyle
':completion:*' menu
select=10
17 zstyle
':completion:*' prompt
'%e errors found'
18 zstyle
':completion:*' select-prompt
%SScrolling active
: current selection
at %p
%s
19 zstyle
':completion:*' substitute
1
21 ## allow one error for every three characters typed in approximate completer
22 zstyle
-e ':completion:*:approximate:*' max-errors \
23 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'
25 ## formatting and messages
26 zstyle
':completion:*' verbose
yes
27 #zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}%d%{\e[0m%}'
28 zstyle
':completion:*:descriptions' format $
'%{\e[0;31m%}%UCompleting %d%{\e[0m%}:%u'
29 zstyle
':completion:*:messages' format $
'%{\e[0;31m%}%d%{\e[0m%}'
30 zstyle
':completion:*:warnings' format $
'%{\e[0;31m%}No matches for: %d%{\e[0m%}'
31 zstyle
':completion:*' group-name
''
33 # ignore duplicate entries
34 zstyle
':completion:*:history-words' remove-all-dups
yes
35 zstyle
':completion:*:history-words' stop
yes
37 # start menu completion only if it could find no unambiguous initial string
38 zstyle
':completion:*:correct:*' insert-unambiguous true
39 zstyle
':completion:*:corrections' format $
'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}'
40 zstyle
':completion:*:correct:*' original true
42 # Group completions according to tags.
43 zstyle
':completion:*' group-name
''
44 zstyle
':completion:*' group-order
''
46 zstyle
':completion:*' accept-exact
'*(N)'
48 ## determine in which order the names (files) should be
49 ## listed and completed when using menu completion.
50 ## `size' to sort them by the size of the file
51 ## `links' to sort them by the number of links to the file
52 ## `modification' or `time' or `date' to sort them by the last modification time
53 ## `access' to sort them by the last access time
54 ## `inode' or `change' to sort them by the last inode change time
55 ## `reverse' to sort in decreasing order
56 ## If the style is set to any other value, or is unset, files will be
57 ## sorted alphabetically by name.
58 zstyle
':completion:*' file-sort name
60 zstyle
':completion:*' file-list list
=20 insert
=10
62 ## offer indexes before parameters in subscripts
63 zstyle
':completion:*:*:-subscript-:*' tag-order indexes parameters
65 ## insert all expansions for expand completer
66 zstyle
':completion:*:expand:*' tag-order all-expansions
68 ## ignore completion functions (until the _ignored completer)
69 zstyle
':completion:*:functions' ignored-patterns
'_*'
70 zstyle
':completion:*' ignored-patterns
'doc-base'
72 ## don't complete backup files as executables
73 zstyle
':completion:*:complete:-command-::commands' ignored-patterns
'*\~'
75 ## filename suffixes to ignore during completion (except after rm command)
76 zstyle
':completion:*:*:(^rm):*:*files' ignored-patterns \
77 '*?.(o|c~|old|pro|zwc|sik|bak)' '*~'
79 ## completions for some progs. not in default completion system
80 zstyle
':completion:*:*:diffstat:*' file-patterns \
82 zstyle
':completion:*:*:lintian:*' file-patterns \
83 '*.(dsc|deb|udeb|changes)'
85 ## on processes completion complete all user processes
86 zstyle
':completion:*:processes' command 'ps -au$USER'
88 ## add colors to processes for kill completion
89 zstyle
':completion:*:*:kill:*:processes' list-colors
'=(#b) #([0-9]#)*=0=01;31'
90 zstyle
':completion:*:*:kill:*' verbose
yes
94 [[ -r ~
/.ssh
/known_hosts
]] && _ssh_hosts
=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\
*}%%,*}) || _ssh_hosts
=()
95 [[ -r ~
/.ssh
/debian_known_hosts
]] && _ssh_debian_hosts
=(${${${${(f)"$(<$HOME/.ssh/debian_known_hosts)"}:#[\|]*}%%\
*}%%,*}) || _ssh_debian_hosts
=()
96 [[ -r /etc
/ssh
/ssh_known_hosts
]] && _ssh_etc_hosts
=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\
*}%%,*}) || _ssh_etc_hosts
=()
97 [[ -r /etc
/hosts
]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
107 "$_ssh_debian_hosts[@]"
112 zstyle
':completion:*:hosts' hosts
$hosts
114 # Don't complete uninteresting users...
115 zstyle
':completion:*:*:*:users' ignored-patterns \
116 adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
117 dbus distcache dovecot fax
ftp games gdm gkrellmd gopher \
118 hacluster haldaemon halt hsqldb ident junkbust ldap
lp mail \
119 mailman mailnull mldonkey mysql nagios \
120 named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
121 operator pcap postfix postgres privoxy pulse pvm quagga radvd \
122 rpc rpcuser rpm shutdown squid sshd sync
uucp vcsa xfs
'_*'
124 # ... unless we really want to.
125 zstyle
'*' single-ignored show
128 # Dont complete CVS dirs and lost+found
129 zstyle
':completion:*:(all-|)files' ignored-patterns
'(|*/)CVS'
130 zstyle
':completion:*:cd:*' ignored-patterns
'(*/)#CVS'
131 zstyle
':completion:*:(all-|)files' ignored-patterns
'(|*/).svn'
132 zstyle
':completion:*:cd:*' ignored-patterns
'(*/)#.svn'
133 zstyle
':completion:*:cd:*' ignored-patterns
'(*/)#lost+found'
135 # complete manual by their section
136 zstyle
':completion:*:manuals' separate-sections true
137 zstyle
':completion:*:manuals.*' insert-sections true
138 zstyle
':completion:*:man:*' menu
yes select
140 # Search path for sudo completion
141 zstyle
':completion:*:sudo:*' command-path
/usr
/local
/sbin \
151 zstyle
':completion:*:(scp|rsync):*' tag-order
'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
152 zstyle
':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
153 zstyle
':completion:*:ssh:*' tag-order
'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
154 zstyle
':completion:*:ssh:*' group-order users hosts-domain hosts-host users hosts-ipaddr
155 zstyle
':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns
'*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
156 zstyle
':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns
'<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
157 zstyle
':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns
'^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
159 ## completion caching
160 zstyle
':completion::complete:*' use-cache
1
161 zstyle
':completion::complete:*' cache-path
${ZDOTDIR}/.zcompcache
163 compinit
-d ${ZDOTDIR}/var
/.zcompdump
165 ## generic completions for programs which understand GNU long options(--help)
166 compdef _gnu_generic
make df du gpg lintian
168 # Complete them as ssh
169 compdef _ssh ssha
=ssh
170 compdef _ssh sshc
=ssh
173 _debian_rules
() { words
=(make -f debian
/rules
) _make
}
174 compdef _debian_rules debian
/rules
179 compdef _git gst
=git-status
180 compdef _git gl
=git-pull
181 compdef _git gup
=git-fetch
182 compdef _git gp
=git-push
183 gdv
() { git
diff -w "$@" }
184 compdef _git gdv
=git-diff
185 compdef _git gc
=git-commit
186 compdef _git gca
=git-commit
187 compdef _git gco
=git-checkout
188 compdef _git gr
=git-remote
189 compdef _git grv
=git-remote
190 compdef _git grmv
=git-remote
191 compdef _git grrm
=git-remote
192 compdef _git grset
=git-remote
193 compdef _git grset
=git-remote
194 compdef _git gb
=git-branch
195 compdef _git gba
=git-branch
197 compdef _git gcp
=git-cherry-pick
198 compdef _git glg
=git-log
199 compdef _git glgg
=git-log
200 compdef _git glgga
=git-log
201 compdef _git gss
=git-status
202 compdef _git ga
=git-add
203 compdef _git gm
=git-merge