aboutsummaryrefslogtreecommitdiff
path: root/files/.zsh/rc/S40_completion
blob: dc58319ec82735f78f4a9adbd63beadd3337e9e6 (plain) (blame)
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
zstyle ':completion:*' add-space true
zstyle ':completion:*' completer _expand _complete _match _prefix _approximate _list
zstyle ':completion:*' menu select=1
zstyle ':completion:*' file-sort name
zstyle ':completion:*' list-colots ${(s.:.)ZLS_COLORS}
zstyle ':completion:*' menu select
zstyle ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'

# {{{ Formats
zstyle ':completion:*' group 1
zstyle ':completion:*' format '%B---- %d%b'
zstyle ':completion:*:corrections' format '%B---- %d (errors %e)%b'
zstyle ':completion:*:descriptions' format '%B---- %d%b'
zstyle ':completion:*:messages' format '%B%U---- d%u%b'
zstyle ':completion:*:warnings' format "%B$fg[red]%}---- no match for: $fg[white]%d%b"
zstyle ':completion:*' group-name ''
# }}}

# {{{ Kill
zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd | grep -v "ps -au$USER -o pid,time,cmd"'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)[ 0-9:]##([^ ]#)*=01;30=01;31=01;38'
# }}}

# {{{ Host and users
hosts=($( ( \
        ( [ -r ~/.ssh/config ] && awk '/^host +[a-z]/ { print $2 }' ~/.ssh/config) ; \
        ( [ -r ~/.ssh/known_hosts ] && awk '{print $1}' ~/.ssh/known_hosts | tr , '\n') \
        ) | sort -u))
zstyle ':completion:*' hosts $hosts
zstyle ':completion:*:hosts' list-colors '=(#b)(*)(bobov.name)=01;30=01;31' '=[^.]#=01;31'

users=(root dexter)
zstyle ':completion:*' users $users

# }}}

# Ignore for vim
zstyle ':completion:*:*:vi(m|):*:*files' ignored-patterns '*?.(aux|dvi|ps|pdf|bbl|toc|lot|lof|o|cm?|class|py[oc])'




# vim: et ft=zsh fdm=marker :