diff options
| -rw-r--r-- | .config/zsh/lib/completion.zsh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.config/zsh/lib/completion.zsh b/.config/zsh/lib/completion.zsh new file mode 100644 index 0000000..fe6efe7 --- /dev/null +++ b/.config/zsh/lib/completion.zsh @@ -0,0 +1,23 @@ +# Auto-completion +autoload -Uz compinit +if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then + compinit; +else + compinit -C; +fi; + +# Accept completion with <tab> or Ctrl+i and go to next/previous suggestions with Vi like keys: Ctrl+n/p +zmodload -i zsh/complist +accept-and-complete-next-history() { + zle expand-or-complete-prefix +} + +zstyle ':completion:*' menu select=1 + +zstyle ':completion:*:directory-stack' list-colors '=(#b) #([0-9]#)*( *)==95=38;5;12' + +zle -N accept-and-complete-next-history +bindkey -M menuselect '^i' accept-and-complete-next-history +bindkey '^n' expand-or-complete +bindkey '^p' reverse-menu-complete +zstyle ':completion:*' menu select=1 |
