-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompletion.zsh
44 lines (36 loc) · 1.28 KB
/
completion.zsh
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
zmodload zsh/complist
autoload -U compinit && compinit
compctl -K screen-sessions screen
compctl -g '*(-/D)' cd
compctl -g '*(-/)' mkdir
compctl -j kill
compctl -c which
compctl -c sudo
compctl -v export
compctl -o setopt unsetopt
compctl -g "* (-/D)" + -g "*.class(.:r)" java
compctl -g '*.par2' + -g '*(-/)' par2
compctl -g '*.r01 *.part01.rar *.rar' + -g '*(-/)' unrar
compctl -g '*.zip' + -g '*(-/)' unzip
compctl -g '*.mp3 *.ogg *.mod *.wav *.avi *.mpg *.mpeg *.wmv' + -g '*(-/)' mplayer
# cache completions
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh.d/cache
# fuzzy matching of completions
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
# complete process ID's with menu selection
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
# remove trailing slash when using directory as argument
zstyle ':completion:*' squeeze-slashes true
# cd will never select the parent directory (cd ../<TAB>)
zstyle ':completion:*:cd:*' ignore-parents parent pwd
function screen-sessions {
typeset -a sessions
for i in /tmp/screens/S-${USER}/*(p:t); do
sessions+=(${i#*.})
done
reply=($sessions)
}