summaryrefslogtreecommitdiff
path: root/etc/completion
blob: 91b9c47021a3bb40663eeba2505be61861ce158c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## vim:ft=zsh

zstyle :compinstall filename ~/.zshrc
zstyle ':completion:*' cache-path ~/var/cache/zsh
zstyle ':completion:*' use-cache true

# Use ls-colors for file completion
check_com -c dircolors && zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

# Mark the current selection when tabbing through possible completions
zstyle ':completion:*' menu select=1

# Complete uppercase names with lowercase and spaces with _
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z} m:_=\\\ ' ''

# Be verbose
char=${ps_yellow}·${ps_reset}
zstyle ':completion:*' verbose true
zstyle ':completion:*:descriptions' format \
       "$char %d $char"
zstyle ':completion:*:messages' format \
       "$char %d $char"
zstyle ':completion:*:corrections' format \
       "$char %d $char"
zstyle ':completion:*:warnings' format \
       "${ps_red}no match:${ps_reset} %d"

zstyle ':completion:*' group-name ''
unset char

# Force menu completion since the input is just a stupid number
zstyle ':completion:*:*:kill:*' menu yes
zstyle ':completion:*:*:(todo|td*):*:items' menu yes

# $hosts is set from the hosts package
zstyle -e ':completion:*' hosts 'reply=(${(k)hosts})'

if [[ -r $compdump ]] {
	compinit -C -d $compdump
} else {
	echo -n "Creating completion cache..."
	compinit -d $compdump
	echo
}

compdef _hosts sshmount
compdef _functions reload