diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-01-31 23:44:45 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-01-31 23:44:45 +0200 |
| commit | d6f9e916593c58aa68066fd8b394c261c5aa4988 (patch) | |
| tree | fde79f1ec0e729804a08041b69e737bd2b9598ca /.config/zsh/lib | |
| parent | 3092bc1129c9eb458a660b5e15ba8e3b4d8ba62d (diff) | |
| download | dotfiles-d6f9e916593c58aa68066fd8b394c261c5aa4988.tar.gz dotfiles-d6f9e916593c58aa68066fd8b394c261c5aa4988.zip | |
Made zsh config more modular
Diffstat (limited to '.config/zsh/lib')
| -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 |
