summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/zsh/.zshrc9
1 files changed, 7 insertions, 2 deletions
diff --git a/user/zsh/.zshrc b/user/zsh/.zshrc
index 2e9d521..ba07dc2 100644
--- a/user/zsh/.zshrc
+++ b/user/zsh/.zshrc
@@ -55,8 +55,13 @@ export INPUTRC=$XDG_CONFIG_HOME/readline/inputrc
export NPM_CONFIG_PREFIX="$HOME/.local/npm"
export PYTHON_BASIC_REPL=1 # use readline (Python >=3.13 defaults to its own REPL which has no vi keybindings)
-export PATH="$PATH:$HOME/.cargo/bin"
-export PATH="$PATH:$NPM_CONFIG_PREFIX/bin"
+# If we'd extend the PATH with PATH=$PATH:extra the PATH would become longer with each subshell.
+# In ZSH PATH is tied to the $path array. We force that array to have unique values:
+typeset -U path PATH
+# Now we can append PATH entries with path+=... without the PATH growing in each subshell.
+
+path+=~/.cargo/bin
+path+=($NPM_CONFIG_PREFIX/bin)
## Completion
autoload -Uz compinit