2018-01-22 12:09:53 +00:00
|
|
|
|
# autoload completions
|
2019-02-01 10:13:51 +00:00
|
|
|
|
fpath=( "${ZDOTDIR:+$ZDOTDIR/compdef}" "/etc/zsh/compdef" $fpath )
|
2018-01-22 12:09:53 +00:00
|
|
|
|
|
2019-02-01 10:13:51 +00:00
|
|
|
|
[[ -n $(echo /etc/zsh/compdef/*(N:t)) ]] && autoload -U /etc/zsh/compdef/*(N:t)
|
|
|
|
|
[[ -n $(echo $ZDOTDIR/compdef/*(N:t)) ]] && autoload -U $ZDOTDIR/compdef/*(N:t)
|
2018-01-22 12:09:53 +00:00
|
|
|
|
|
2019-02-01 10:13:51 +00:00
|
|
|
|
autoload -Uz compinit && compinit -u
|
2020-02-13 13:21:42 +00:00
|
|
|
|
autoload -U +X bashcompinit && bashcompinit
|
2018-01-22 12:09:53 +00:00
|
|
|
|
|
|
|
|
|
zstyle ':completion:*:descriptions' format ‘%B%d%b’
|
|
|
|
|
zstyle ':completion:*:messages' format ‘%d’
|
|
|
|
|
zstyle ':completion:*:warnings' format ‘No matches for: %d’
|
2019-02-11 14:36:37 +00:00
|
|
|
|
zstyle ':completion:*' use-cache on
|
|
|
|
|
zstyle ':completion:*' cache-path ~/.zsh/cache
|
|
|
|
|
zstyle ':completion:*' completer _complete _ignored _match _approximate _correct
|
|
|
|
|
zstyle ':completion:*:match:*' original only
|
|
|
|
|
zstyle ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)'
|
|
|
|
|
zstyle ':completion:*:functions' ignored-patterns '_*'
|
|
|
|
|
zstyle ':completion:*' squeeze-slashes true
|
|
|
|
|
zstyle ':completion:*' expand prefix suffix
|
|
|
|
|
zstyle ':completion:*' group-name ''
|
|
|
|
|
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
|
|
|
|
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
|
|
|
|
|
zstyle ':completion:*' list-suffixes true
|
|
|
|
|
zstyle ':completion:*' preserve-prefix '//[^/]##/'
|
|
|
|
|
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
|
|
|
|
|
zstyle ':completion:*' special-dirs true
|
|
|
|
|
zstyle ':completion:*' verbose true
|
|
|
|
|
zstyle :compinstall filename '/etc/zsh/completion'
|
2018-01-22 12:09:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# completion for programs with standard gnu --help
|
2020-02-13 13:21:42 +00:00
|
|
|
|
for prog in amm tapestry virtualenv dragon; do
|
2018-01-22 12:09:53 +00:00
|
|
|
|
compdef _gnu_generic $prog
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# custom compdefs
|
|
|
|
|
|
|
|
|
|
compdef _xbps xi=xbps-install
|
2019-02-11 14:36:37 +00:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
local _myhosts
|
|
|
|
|
_myhosts=( $(awk '/^Host/ {for (i=2; i<=NF; i++) print $i}' ~/.ssh/config) )
|
|
|
|
|
zstyle ':completion:*' hosts $_myhosts
|
|
|
|
|
}&>/dev/null
|
|
|
|
|
|
|
|
|
|
zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
|
|
|
|
|
|
|
|
|
|
compdef _command fork
|
|
|
|
|
compdef _command detach
|
|
|
|
|
compdef _command ontv
|
2019-07-10 13:36:41 +00:00
|
|
|
|
compdef _notmuch nmfind=notmuch-search
|