]> git.donarmstrong.com Git - zsh.git/blob - .zsh/zshrc/20_compsys
add ~/.local/bin to PATH
[zsh.git] / .zsh / zshrc / 20_compsys
1 # -*- mode: sh -*-
2 # -*- mode: sh -*-
3 # zshrc/20_compsys
4 #
5 # Configures the completions system
6 #
7 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
8 # Released under the terms of the Artistic Licence 2.0
9 #
10 # Source repository: git://git.madduck.net/etc/zsh.git
11 #
12
13 zstyle :compinstall filename '$ZDOTDIR/zshrc/20_compsys'
14
15 # automatically list choices on an ambiguous completion
16 setopt auto_list
17
18 # use menu after the second completion request
19 setopt auto_menu
20
21 # recognise exact matches even if they're ambiguous
22 setopt rec_exact
23
24 # move cursor to end of word being completed
25 setopt always_to_end
26
27 # correct the command if mistyped
28 setopt correct
29
30 # correct all arguments, not just the command
31 #setopt correctall
32
33 # be magic about adding/removing final characters on tab completion
34 setopt auto_param_keys auto_param_slash auto_remove_slash
35
36 # load fancy completion list and menu handler
37 zmodload zsh/complist
38
39 # initialise the completion system
40 autoload -U compinit
41 compinit -d $ZVARDIR/comp-$HOST
42
43 # cache results
44 zstyle ':completion:*' use-cache on
45 zstyle ':completion:*' cache-path $ZVARDIR/compcache
46
47 #zstyle ':completion:*' completer _list _expand _complete _ignored _match _correct _approximate _prefix
48 zstyle ':completion:*' completer _complete _ignored _match _correct _approximate
49
50 # allow cursor-key navigation through completion set
51 zstyle ':completion:*:*:*:*' menu select
52
53 # use colours in completion lists and menus
54 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
55
56 # ignore working and backup copies, and compiled objects
57 zstyle ':completion:*:(all-|)files' ignored-patterns \
58   '*.bk' '*.bak' '*.old' '*~' '.*.sw?' '*.o' '*.pyc'
59
60 zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) not-numeric )'
61 zstyle -e ':completion:*:correct:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2)) numeric )'
62 #zstyle ':completion:*:correct:::' max-errors 1 not-numeric
63 #zstyle ':completion:*:approximate:::' max-errors 2 numeric
64
65 #zstyle ':completion:*' list-suffixes true
66 #zstyle ':completion:*' match-original both
67 #zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
68 #zstyle ':completion:*:match:*' original only
69 #zstyle ':completion:*' original true
70 #zstyle ':completion:*' squeeze-slashes true
71
72 # functions which start with _ are internal and ignored
73 zstyle ':completion:*:functions' ignored-patterns '_*'
74
75 # do not offer files already specified on the line
76 zstyle ':completion:*:rm:*' ignore-line yes
77
78 #zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
79 #zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
80
81 # ignore current directory when completing in ../
82 #zstyle ':completion:*:cd:*' ignore-parents parent pwd
83 zstyle ':completion:*' ignore-parents parent pwd
84
85 # http://xana.scru.org/2005/08/20#ignorelatexjunk
86 zstyle -e ':completion:*:*:vim#:*:*' ignored-patterns \
87   'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] &&
88   reply=(*.(aux|dvi|log|ps|pdf|bbl|toc|lot|lof|latexmain)) || reply=()'
89
90 # http://madism.org/~madcoder/dotfiles/zsh/40_completion
91 zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"'
92
93 # commands that take commands as arguments
94 compdef _precommand gdb
95 compdef _precommand nohup
96 compdef _precommand strace
97 compdef _precommand faf
98
99 zstyle ':completion:*' verbose yes
100 zstyle ':completion:*:descriptions' format '%B%d%b'
101 zstyle ':completion:*:messages' format '%d'
102 zstyle ':completion:*:warnings' format 'no matches for: %d'
103 zstyle ':completion:*' group-name ''
104
105 # #527301
106 zstyle :completion::complete:xmms2:\*:values list-grouped false
107 zstyle :completion::complete:xmms2:\*:values sort false
108
109 # vim:ft=zsh