aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:35 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-13 13:43:35 +0100
commitdbd769d051f3dce8519f7e67a5efa0a27abfc078 (patch)
treee6f0d28f74167f5dfee27bc69fe566dc0f0cb9a2
parent3b1790712c54e330cde1c7ba7f1f7db2b97de19f (diff)
downloaddotfiles-dbd769d051f3dce8519f7e67a5efa0a27abfc078.tar.gz
dotfiles-dbd769d051f3dce8519f7e67a5efa0a27abfc078.tar.bz2
dotfiles-dbd769d051f3dce8519f7e67a5efa0a27abfc078.zip
feat(zsh): rebuild PATH hash on every completion
`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.
-rw-r--r--dot_config/zsh/dot_zshrc1
1 files changed, 1 insertions, 0 deletions
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