From ed4e8cabe9d2ba3bae88efc4569aa698f128b5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Mon, 9 Mar 2026 13:35:28 +0100 Subject: [PATCH] feat(zsh): harden completion setup --- .gitignore | 2 -- zsh/.zshrc | 12 ++++++++++-- zsh/completions/.keep | 0 3 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 zsh/completions/.keep diff --git a/.gitignore b/.gitignore index 6ba475c..79421c7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,7 @@ zsh/* !zsh/.zsh_plugins*.txt !zsh/scripts.zsh !zsh/aliases.zsh -!zsh/completions/.keep !zsh/ssh-menu -!zsh/get-dump # starship !starship diff --git a/zsh/.zshrc b/zsh/.zshrc index 5c460d1..1f2f0fe 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -33,10 +33,18 @@ source "$ZDOTDIR/aliases.zsh" source "$ZDOTDIR/scripts.zsh" # completion -fpath=("$ZDOTDIR/completions" $fpath) +fpath=("$XDG_DATA_HOME/zsh/completions" $fpath) autoload -Uz compinit -compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" +# only regenerate dump once per day +local _zcompdump="$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" +if [[ -n $_zcompdump(#qN.mh+24) ]]; then + compinit -d "$_zcompdump" +else + compinit -C -d "$_zcompdump" +fi zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache" +zstyle ':completion:*' menu select +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' eval "$(starship init zsh)" eval "$(direnv hook zsh)" diff --git a/zsh/completions/.keep b/zsh/completions/.keep deleted file mode 100644 index e69de29..0000000