From dbd769d051f3dce8519f7e67a5efa0a27abfc078 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:35 +0100 Subject: feat(zsh): rebuild PATH hash on every completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `zstyle ':completion:*' rehash true` makes zle re-scan $PATH directories on every TAB instead of caching the hash table at shell startup. Cost is trivial (one stat() per PATH entry per completion), benefit is that newly installed binaries — from paru, cargo install, pip install --user, npm install -g, manual /usr/local/bin drops, anything — show up immediately without an explicit `hash -r` or new shell. The pacman-hook alternative at https://wiki.archlinux.org/title/Zsh#Persistent_rehash only catches paru/pacman installs, missing cargo/pip/manual; rehash=true catches them all for the same negligible cost. --- dot_config/zsh/dot_zshrc | 1 + 1 file changed, 1 insertion(+) (limited to 'dot_config/zsh/dot_zshrc') diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc index 3bce27c..552f9eb 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc @@ -48,6 +48,7 @@ zstyle ':completion:*' completer _expand_alias _complete _ignored _match _approx zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} # colorize file completions like ls zstyle ':completion:*' use-cache on # cache completions (speeds up pip, dpkg, etc.) zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh" +zstyle ':completion:*' rehash true # rebuild PATH hash on every completion (catches paru, cargo, pip, manual installs) zstyle ':completion:*:match:*' original only # only show original when pattern-matching zstyle ':completion:*:functions' ignored-patterns '_*' # hide internal completion functions zstyle ':completion:*:*:kill:*' menu yes select # interactive menu for kill completion -- cgit v1.3.1