Mercurial > dotfiles
annotate .shell.d/50.completions.zsh @ 77:45d7441d0cf2
Modularize .emacs
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 09 Apr 2009 13:39:20 -0500 |
parents | 7755c3adb60d |
children |
rev | line source |
---|---|
0 | 1 ## Completions |
54
7755c3adb60d
Fix completion stuff so that _hg will work as it should.
Augie Fackler <durin42@gmail.com>
parents:
39
diff
changeset
|
2 autoload -U compinit |
7755c3adb60d
Fix completion stuff so that _hg will work as it should.
Augie Fackler <durin42@gmail.com>
parents:
39
diff
changeset
|
3 compinit |
0 | 4 ## completions #### |
5 autoload -U zstyle+ | |
6 ## General completion technique | |
7 ## complete as much you can .. | |
8 zstyle ':completion:*' completer _complete _list _oldlist _expand _ignored _match _correct _approximate _prefix | |
9 ## complete less | |
10 #zstyle ':completion:*' completer _expand _complete _list _ignored _approximate | |
11 ## complete minimal | |
12 #zstyle ':completion:*' completer _complete _ignored | |
13 | |
14 local _myhosts | |
15 _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} ) | |
16 zstyle ':completion:*' hosts $_myhosts | |
17 | |
18 ## allow one error | |
19 #zstyle ':completion:*:approximate:*' max-errors 1 numeric | |
20 ## allow one error for every three characters typed in approximate completer | |
21 zstyle -e ':completion:*:approximate:*' max-errors \ | |
22 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' | |
23 | |
24 ## formatting and messages | |
25 zstyle ':completion:*' verbose yes | |
26 #describe options presented at completion | |
27 #zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}%d%{\e[0m%}' | |
28 zstyle ':completion:*:messages' format $'%{\e[0;31m%}%d%{\e[0m%}' | |
29 zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for: %d%{\e[0m%}' | |
30 zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}' | |
31 zstyle ':completion:*' group-name '' | |
32 | |
33 ## determine in which order the names (files) should be | |
34 ## listed and completed when using menu completion. | |
35 ## `size' to sort them by the size of the file | |
36 ## `links' to sort them by the number of links to the file | |
37 ## `modification' or `time' or `date' to sort them by the last modification time | |
38 ## `access' to sort them by the last access time | |
39 ## `inode' or `change' to sort them by the last inode change time | |
40 ## `reverse' to sort in decreasing order | |
41 ## If the style is set to any other value, or is unset, files will be | |
42 ## sorted alphabetically by name. | |
43 zstyle ':completion:*' file-sort name | |
44 | |
45 ## how many completions switch on menu selection | |
46 ## use 'long' to start menu compl. if list is bigger than screen | |
47 ## or some number to start menu compl. if list has that number | |
48 ## of completions (or more). | |
49 zstyle ':completion:*' menu select=long | |
50 | |
51 ## case-insensitive (uppercase from lowercase) completion | |
52 #zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' | |
53 ## case-insensitive (all) completion | |
54 #zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' | |
55 ## case-insensitive,partial-word and then substring completion | |
56 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' | |
57 | |
58 ## offer indexes before parameters in subscripts | |
59 zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters | |
60 | |
61 ## insert all expansions for expand completer | |
62 zstyle ':completion:*:expand:*' tag-order all-expansions | |
63 | |
64 ## ignore completion functions (until the _ignored completer) | |
65 zstyle ':completion:*:functions' ignored-patterns '_*' | |
66 | |
67 ## completion caching | |
68 zstyle ':completion::complete:*' use-cache 1 | |
69 zstyle ':completion::complete:*' cache-path ~/.zcompcache/$HOST | |
70 | |
71 ## add colors to completions | |
72 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} | |
73 | |
74 ## don't complete backup files as executables | |
75 zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~' | |
76 | |
77 ## filename suffixes to ignore during completion (except after rm command) | |
78 zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.(o|c~|old|pro|zwc)' | |
79 | |
80 ## add colors to processes for kill completion | |
81 zstyle ':completion:*:*:kill:*:processes' command 'ps -axco pid,user,command' | |
82 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' |