From 40e9e3d1a7291b7948774ed1f46d9cb8db4e3f5d Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 26 Mar 2020 20:18:43 +0100 Subject: completion, zshrc: add kubectl completion --- .zsh/zshrc/20_compsys | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to '.zsh/zshrc/20_compsys') diff --git a/.zsh/zshrc/20_compsys b/.zsh/zshrc/20_compsys index 3da9ea8..102c31b 100644 --- a/.zsh/zshrc/20_compsys +++ b/.zsh/zshrc/20_compsys @@ -9,10 +9,22 @@ # Released under the terms of the Artistic Licence 2.0 # # Source repository: git://git.distanz.ch/dotfiles/zsh.git -# zstyle :compinstall filename '$ZDOTDIR/zshrc/20_compsys' +### INIT + +autoload -Uz compinit +compinit -d $ZVARDIR/comp-$HOST + +# load fancy completion list and menu handler +zmodload zsh/complist + +# avoid old-style completion (compctl) +zstyle ':completion:*' use-compctl false + +### OPTIONS + # do not complete just at the end setopt completeinword @@ -37,13 +49,6 @@ setopt correct # be magic about adding/removing final characters on tab completion setopt auto_param_keys auto_param_slash auto_remove_slash -# load fancy completion list and menu handler -zmodload zsh/complist - -# initialise the completion system -autoload -U compinit -compinit -d $ZVARDIR/comp-$HOST - # cache results zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path $ZVARDIR/compcache @@ -65,7 +70,7 @@ zstyle ':completion:*:history-words' remove-all-dups yes zstyle ':completion:*:history-words' stop yes # match uppercase from lowercase -zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' # ignore working and backup copies, and compiled objects #zstyle ':completion:*:(all-|)files' ignored-patterns \ @@ -134,6 +139,9 @@ zstyle ':completion:*:manuals.*' insert-sections true zstyle ':completion:*:man:*' menu yes select # provide .. as a completion -zstyle ':completion:*' special-dirs .. +zstyle ':completion:*' special-dirs true + +# automatically load bash completion functions +autoload -Uz bashcompinit && bashcompinit # vim:ft=zsh -- cgit v1.2.3-54-g00ecf