-
Notifications
You must be signed in to change notification settings - Fork 0
/
completion.zsh
104 lines (85 loc) · 3.91 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# # autoload -Uz is-at-least
# # is-at-least 5.0.6 && setopt NO_GLOBAL_RCS
# # if [ZSH_VERSION > ZSH 5.0.6 ]
# # http://www.thregr.org/~wavexx/rnd/20141010-zsh_show_ambiguity/
# zstyle ':completion:*' show-ambiguity true # TODO: add screenshot?
# cd ~user have never been useful to me, but named directories can be
# if expansion of the user home directory is really wanted, one can call
# _next_tags (^Xn)
#
# TODO:
# title expansion -tilde- completion context, should only complete named
# directories,
# use tag-order (zshcompsys) can bind _complete_help to see the tag order
# named directories should be verbose and print the full path on the right
zstyle ':completion:*:*:-tilde-:*' tag-order named-directories
# be careful to not add a '/' at the end of these directories, otherwise print
# -p '%~' does not work
hash -d ironysrc=~/projects/irony/irony-mode/server/src
hash -d irony=~/projects/irony/irony-mode
hash -d projects=~/projects
# TODO: check word-context and stuff section instead of this setting
WORDCHARS=''
# ignore some files during completion of most commands (fignore), except that
# these file we ignore will be the default candidates for rm
#
# for example, if we have: foo.c foo.o
# completion for cat will complete foo.c
# completion for rm will complete foo.o
fignore=(.o .pyc \~) # see also ignored-patterns
zstyle ':completion:*:*:rm:*:*' file-patterns \
"*(${(j:|:)fignore}):ignored-filed:ignored\ files" '%p:all-files'
# TODO: substring completion on C-<up>/C-<down>?
# for example for repo sync, just type:
# sync C-<up>
# repo sync RET
# TODO: add some colors
# http://linuxshellaccount.blogspot.fr/2008/12/color-completion-using-zsh-modules-on.html
# STOPPED AT
#
# menu
#
#
# config initially generated by compinstall
# :completion:function:completer:command:argument:tag
# required before compinit to get menu-select
#
# > If you use the menu-select widget, which is part of the zsh/complist module,
# > you should make sure that that module is loaded before the call to compinit so
# > that that widget is also re-defined.
# -- man zshcompsys
zmodload zsh/complist
zstyle ':completion:*:*:git*:*' use-fallback false
zstyle ':completion:*:*:repo*:*' use-fallback false
zstyle ':completion:*:*:compdb*:*' use-fallback false
zstyle ':completion:*' auto-description 'specify: %d'
# to test repo download completion without a Gerrit server:
# zstyle ':completion:*:repo-review-url' command 'echo dummy'
# zstyle ':completion:*:gerrit-list-project-reviews' command 'cat "$ZDOTDIR/repo_completion/reviews/${GERRIT_PROJECT}.TEXT"'
# customize email addresses for 'repo upload --{cc,re,reviewers}=<mail>
autoload -Uz _email-coworkers
zstyle ':completion:*:*:repo-upload:*:*' tag-order email-coworkers
zstyle ':completion:*:*:repo-download:*' cols '[%t%0(T..@)%b]' '%s' '(%a)'
autoload -Uz colors && colors
zstyle ':completion:*:repo*:change:*' list-colors "=(#b)([0-9/]##) *=$color[none]=$color[bold]"
# _approximate
# The following lines were added by compinstall
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' file-sort modification
zstyle ':completion:*' format '%B--- %d%b'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' ignore-parents parent pwd
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**'
zstyle ':completion:*' max-errors 2 not-numeric
zstyle ':completion:*' menu select=1
zstyle ':completion:*' original false
zstyle ':completion:*' preserve-prefix '//[^/]##/'
zstyle ':completion:*' prompt 'corrected (%e error(s))'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*' verbose true
zstyle :compinstall filename "$ZUKODIR/completion.zsh"
autoload -Uz compinit
compinit
# End of lines added by compinstall