Mercurial > dotfiles
comparison dot_zshrc @ 533:22fb4745cb1b
set more completion options in zsh
author | Zeger Van de Vannet <zegervdv@me.com> |
---|---|
date | Tue, 25 Jan 2022 21:54:03 +0100 |
parents | 5d57fac601e3 |
children | aee830df7a88 |
comparison
equal
deleted
inserted
replaced
532:e932c2076dba | 533:22fb4745cb1b |
---|---|
67 bindkey "$terminfo[kcuu1]" history-substring-search-up | 67 bindkey "$terminfo[kcuu1]" history-substring-search-up |
68 bindkey "$terminfo[kcud1]" history-substring-search-down | 68 bindkey "$terminfo[kcud1]" history-substring-search-down |
69 bindkey '^p' history-substring-search-up | 69 bindkey '^p' history-substring-search-up |
70 bindkey '^n' history-substring-search-down | 70 bindkey '^n' history-substring-search-down |
71 | 71 |
72 bindkey '^ ' autosuggest-accept | 72 bindkey '^f' autosuggest-accept |
73 | |
74 zmodload zsh/complist | |
75 bindkey -M menuselect 'h' vi-backward-char | |
76 bindkey -M menuselect 'k' vi-up-line-or-history | |
77 bindkey -M menuselect 'j' vi-down-line-or-history | |
78 bindkey -M menuselect 'l' vi-forward-char | |
79 | |
80 # Enter interactive search | |
81 bindkey -M menuselect '^xi' vi-insert | |
73 | 82 |
74 export LESS_TERMCAP_mb=$(printf "\e[1;31m") | 83 export LESS_TERMCAP_mb=$(printf "\e[1;31m") |
75 export LESS_TERMCAP_md=$(printf "\e[1;31m") | 84 export LESS_TERMCAP_md=$(printf "\e[1;31m") |
76 export LESS_TERMCAP_me=$(printf "\e[0m") | 85 export LESS_TERMCAP_me=$(printf "\e[0m") |
77 export LESS_TERMCAP_se=$(printf "\e[0m") | 86 export LESS_TERMCAP_se=$(printf "\e[0m") |
114 | 123 |
115 # Completion | 124 # Completion |
116 setopt complete_in_word | 125 setopt complete_in_word |
117 setopt always_to_end | 126 setopt always_to_end |
118 setopt auto_menu | 127 setopt auto_menu |
128 setopt auto_param_slash | |
129 | |
130 # Enable completers | |
131 zstyle ':completion:*' completer _complete _approximate | |
132 | |
133 zstyle ':completion:*' use-cache on | |
134 zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache" | |
135 | |
136 # file list info | |
137 zstyle ':completion:*' file-list list | |
119 | 138 |
120 # activate color-completion | 139 # activate color-completion |
121 zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} | 140 zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} |
122 | 141 |
123 # format on completion | 142 # format on completion |
124 zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' | 143 zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' |
125 | 144 |
126 # insert all expansions for expand completer | 145 # insert all expansions for expand completer |
127 zstyle ':completion:*:expand:*' tag-order all-expansions | 146 zstyle ':completion:*:expand:*' tag-order all-expansions |
128 zstyle ':completion:*:history-words' list false | 147 zstyle ':completion:*:history-words' list false |
129 | 148 |
130 # activate menu | 149 # activate menu |
131 zstyle ':completion:*:history-words' menu yes | 150 zstyle ':completion:*:history-words' menu yes |
132 | 151 |
133 # ignore duplicate entries | 152 # ignore duplicate entries |
134 zstyle ':completion:*:history-words' remove-all-dups yes | 153 zstyle ':completion:*:history-words' remove-all-dups yes |
135 zstyle ':completion:*:history-words' stop yes | 154 zstyle ':completion:*:history-words' stop yes |
136 | 155 |
137 zstyle ':completion:*:matches' group 'yes' | 156 zstyle ':completion:*:matches' group 'yes' |
138 zstyle ':completion:*' group-name '' | 157 zstyle ':completion:*' group-name '' |
139 if [[ "$NOMENU" -eq 0 ]] ; then | 158 if [[ "$NOMENU" -eq 0 ]] ; then |
140 # if there are more than 5 options allow selecting from a menu | 159 # if there are more than 5 options allow selecting from a menu |
141 zstyle ':completion:*' menu select=5 | 160 zstyle ':completion:*' menu select=5 |
142 else | 161 else |
143 # don't use any menus at all | 162 # don't use any menus at all |
144 setopt no_auto_menu | 163 setopt no_auto_menu |
145 fi | 164 fi |
146 | 165 |
147 zstyle ':completion:*:messages' format '%d' | 166 zstyle ':completion:*:messages' format '%d' |
148 zstyle ':completion:*:options' auto-description '%d' | 167 zstyle ':completion:*:options' auto-description '%d' |
149 | 168 |
150 # describe options in full | 169 # describe options in full |
151 zstyle ':completion:*:options' description 'yes' | 170 zstyle ':completion:*:options' description 'yes' |
152 | 171 |
153 # complete manual by their section | 172 # complete manual by their section |
154 zstyle ':completion:*:manuals' separate-sections true | 173 zstyle ':completion:*:manuals' separate-sections true |
155 zstyle ':completion:*:manuals.*' insert-sections true | 174 zstyle ':completion:*:manuals.*' insert-sections true |
156 zstyle ':completion:*:man:*' menu yes select | 175 zstyle ':completion:*:man:*' menu yes select |
157 | 176 |
158 # Search path for sudo completion | 177 # Search path for sudo completion |
159 zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ | 178 zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ |
160 /usr/local/bin \ | 179 /usr/local/bin \ |
161 /usr/sbin \ | 180 /usr/sbin \ |
169 | 188 |
170 # case insensitive path-completion | 189 # case insensitive path-completion |
171 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:|=*' | 190 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:|=*' |
172 | 191 |
173 # nvim completion | 192 # nvim completion |
174 zstyle ':completion::*:nvim:*' ignored-patterns '*.(o|hex|elf|pyc|pdf|dup)' | 193 zstyle ':completion:*:*:nvim:*' ignored-patterns '*.(o|hex|elf|pyc|pdf|dup)' |
194 zstyle ':completion:*:*:nvim:*' file-sort modification | |
175 | 195 |
176 autoload -U compinit && compinit | 196 autoload -U compinit && compinit |
177 | 197 |
178 # fg when pressing Ctrl+Z | 198 # fg when pressing Ctrl+Z |
179 function fancy-ctrl-z () { | 199 function fancy-ctrl-z () { |