From a1e01875dec41f03657ca742f52b4022a47b27ca Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 12 Dec 2024 20:44:48 +0300 Subject: [PATCH] zsh completion plugin --- .gitignore | 3 ++- home/user/.config/zsh/completion | 14 +++++--------- home/user/.config/zsh/plugin | 4 +++- install-hooks/zsh/post-install | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 1a2baa7..956b9ac 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ home/user/.config/zsh/zshrc.d/* !home/user/.config/zsh/zshrc.d/00_zhashd.sh home/user/.config/zsh/.zcalc_history +.zcompdump *.zwc home/user/.ssh/* @@ -35,4 +36,4 @@ home/user/.tmux/* home/user/.config/git/local home/user/.config/i3/config.d/* -!home/user/.config/i3/config.d/.gitkeep \ No newline at end of file +!home/user/.config/i3/config.d/.gitkeep diff --git a/home/user/.config/zsh/completion b/home/user/.config/zsh/completion index 0619ef8..b576f1d 100644 --- a/home/user/.config/zsh/completion +++ b/home/user/.config/zsh/completion @@ -1,12 +1,10 @@ # enable completion features fpath=(~/.zfunc $fpath) zmodload zsh/complist -autoload -Uz compinit -compinit -d ~/.cache/zsh/.zcompdump zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path "${HOME}/.cache/zsh/.zcompcache" -zstyle ':completion:*' menu yes select +zstyle ':completion:*' menu select zstyle ':completion:*' auto-description 'specify: %d' zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' group-name '' @@ -35,6 +33,9 @@ zstyle ':completion:*:cd:*' ignore-parents parent pwd zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f' zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f' +zstyle ':autocomplete:*' min-input 3 +zstyle ':autocomplete:*' delay 0.3 + bindkey -M menuselect '^h' vi-backward-char bindkey -M menuselect '^k' vi-up-line-or-history @@ -43,9 +44,4 @@ bindkey -M menuselect '^l' vi-forward-char bindkey -M menuselect '^e' undo bindkey -M menuselect '^[' cancel bindkey -M menuselect '^M' check-command -bindkey -M menuselect '^I' accept-and-infer-next-history - - -compdef _directories _d -compdef _files _f -compdef _directories mcd \ No newline at end of file +bindkey -M menuselect '^I' accept-and-infer-next-history \ No newline at end of file diff --git a/home/user/.config/zsh/plugin b/home/user/.config/zsh/plugin index bf61716..e611a11 100644 --- a/home/user/.config/zsh/plugin +++ b/home/user/.config/zsh/plugin @@ -13,8 +13,10 @@ install_if_not_exists zsh-users/zsh-autosuggestions install_if_not_exists zsh-users/zsh-syntax-highlighting install_if_not_exists hlissner/zsh-autopair install_if_not_exists unixorn/fzf-zsh-plugin +install_if_not_exists marlonrichert/zsh-autocomplete _so "${HOME}/.config/zsh/plugins/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" _so "${HOME}/.config/zsh/plugins/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh" _so "${HOME}/.config/zsh/plugins/hlissner/zsh-autopair/autopair.zsh" -_so "${HOME}/.config/zsh/plugins/unixorn/fzf-zsh-plugin/fzf-zsh-plugin.plugin.zsh" \ No newline at end of file +_so "${HOME}/.config/zsh/plugins/unixorn/fzf-zsh-plugin/fzf-zsh-plugin.plugin.zsh" +_so "${HOME}/.config/zsh/plugins/marlonrichert/zsh-autocomplete/zsh-autocomplete.plugin.zsh" \ No newline at end of file diff --git a/install-hooks/zsh/post-install b/install-hooks/zsh/post-install index 94eabb9..be2ec42 100755 --- a/install-hooks/zsh/post-install +++ b/install-hooks/zsh/post-install @@ -8,6 +8,6 @@ zfiles+=($(find "${ZDOTDIR}/" -maxdepth 1 -type f -not -name '*.zwc')) for zfile in "${zfiles[@]}" do - echo zcompile "${zfile}" + echo "zcompile ${zfile}" zcompile "${zfile}" done \ No newline at end of file