comparison zsh/completion.zsh @ 151:87498dbd779a

Move away from oh-my-zsh
author zegervdv <zegervdv@me.com>
date Mon, 20 Oct 2014 21:49:21 +0200
parents
children
comparison
equal deleted inserted replaced
150:de8d4246c8fe 151:87498dbd779a
1 # add in zsh-completions
2 fpath=(/usr/local/share/zsh-completions $fpath)
3
4 autoload -U compinit && compinit
5 zmodload -i zsh/complist
6 # GRML style completion
7 # activate color-completion
8 zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
9
10 # format on completion
11 zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'
12
13 # automatically complete 'cd -<tab>' and 'cd -<ctrl-d>' with menu
14 # zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
15
16 # insert all expansions for expand completer
17 zstyle ':completion:*:expand:*' tag-order all-expansions
18 zstyle ':completion:*:history-words' list false
19
20 # activate menu
21 zstyle ':completion:*:history-words' menu yes
22
23 # ignore duplicate entries
24 zstyle ':completion:*:history-words' remove-all-dups yes
25 zstyle ':completion:*:history-words' stop yes
26
27 # match uppercase from lowercase
28 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
29
30 zstyle ':completion:*:matches' group 'yes'
31 zstyle ':completion:*' group-name ''
32 if [[ "$NOMENU" -eq 0 ]] ; then
33 # if there are more than 5 options allow selecting from a menu
34 zstyle ':completion:*' menu select=5
35 else
36 # don't use any menus at all
37 setopt no_auto_menu
38 fi
39
40 zstyle ':completion:*:messages' format '%d'
41 zstyle ':completion:*:options' auto-description '%d'
42
43 # describe options in full
44 zstyle ':completion:*:options' description 'yes'
45
46 # complete manual by their section
47 zstyle ':completion:*:manuals' separate-sections true
48 zstyle ':completion:*:manuals.*' insert-sections true
49 zstyle ':completion:*:man:*' menu yes select
50
51 # Search path for sudo completion
52 zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
53 /usr/local/bin \
54 /usr/sbin \
55 /usr/bin \
56 /sbin \
57 /bin \
58 /usr/X11R6/bin
59
60 # provide .. as a completion
61 zstyle ':completion:*' specal-dirs ..
62
63
64 zstyle ':completion::*:(m|)vim:*' ignored-patterns '*.(o|hex|elf|pyc|pdf|out|aux|toc|out|fls|bbl|synctex.gz|dvi|blg|fdb_latexmk)'
65
66 # ag tab complete
67 _ag() {
68 if (( CURRENT == 2 )); then
69 compadd $(cut -f 1 .git/tags tmp/tags 2>/dev/null | grep -v '!_TAG')
70 fi
71 }
72
73 compdef _ag ag
74