# HG changeset patch # User Zeger Van de Vannet # Date 1643144043 -3600 # Node ID 22fb4745cb1b3e92ee096de5ac2fea2691f6151d # Parent e932c2076dba1406c002d4891133173cf62c00ac set more completion options in zsh diff -r e932c2076dba -r 22fb4745cb1b dot_zshrc --- a/dot_zshrc Fri Jan 21 09:33:28 2022 +0100 +++ b/dot_zshrc Tue Jan 25 21:54:03 2022 +0100 @@ -69,7 +69,16 @@ bindkey '^p' history-substring-search-up bindkey '^n' history-substring-search-down -bindkey '^ ' autosuggest-accept +bindkey '^f' autosuggest-accept + +zmodload zsh/complist +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -M menuselect 'l' vi-forward-char + +# Enter interactive search +bindkey -M menuselect '^xi' vi-insert export LESS_TERMCAP_mb=$(printf "\e[1;31m") export LESS_TERMCAP_md=$(printf "\e[1;31m") @@ -116,44 +125,54 @@ setopt complete_in_word setopt always_to_end setopt auto_menu +setopt auto_param_slash + +# Enable completers +zstyle ':completion:*' completer _complete _approximate + +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache" + +# file list info +zstyle ':completion:*' file-list list # activate color-completion -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} # format on completion -zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' +zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' # insert all expansions for expand completer -zstyle ':completion:*:expand:*' tag-order all-expansions -zstyle ':completion:*:history-words' list false +zstyle ':completion:*:expand:*' tag-order all-expansions +zstyle ':completion:*:history-words' list false # activate menu -zstyle ':completion:*:history-words' menu yes +zstyle ':completion:*:history-words' menu yes # ignore duplicate entries -zstyle ':completion:*:history-words' remove-all-dups yes -zstyle ':completion:*:history-words' stop yes +zstyle ':completion:*:history-words' remove-all-dups yes +zstyle ':completion:*:history-words' stop yes -zstyle ':completion:*:matches' group 'yes' -zstyle ':completion:*' group-name '' +zstyle ':completion:*:matches' group 'yes' +zstyle ':completion:*' group-name '' if [[ "$NOMENU" -eq 0 ]] ; then # if there are more than 5 options allow selecting from a menu - zstyle ':completion:*' menu select=5 + zstyle ':completion:*' menu select=5 else # don't use any menus at all setopt no_auto_menu fi -zstyle ':completion:*:messages' format '%d' -zstyle ':completion:*:options' auto-description '%d' +zstyle ':completion:*:messages' format '%d' +zstyle ':completion:*:options' auto-description '%d' # describe options in full -zstyle ':completion:*:options' description 'yes' +zstyle ':completion:*:options' description 'yes' # complete manual by their section -zstyle ':completion:*:manuals' separate-sections true -zstyle ':completion:*:manuals.*' insert-sections true -zstyle ':completion:*:man:*' menu yes select +zstyle ':completion:*:manuals' separate-sections true +zstyle ':completion:*:manuals.*' insert-sections true +zstyle ':completion:*:man:*' menu yes select # Search path for sudo completion zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ @@ -171,7 +190,8 @@ zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' # nvim completion -zstyle ':completion::*:nvim:*' ignored-patterns '*.(o|hex|elf|pyc|pdf|dup)' +zstyle ':completion:*:*:nvim:*' ignored-patterns '*.(o|hex|elf|pyc|pdf|dup)' +zstyle ':completion:*:*:nvim:*' file-sort modification autoload -U compinit && compinit