]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/05_fpath/05_fpath.zshrc
50_prompt: Show "logname" for root user by default
[ax-zsh.git] / core / 05_fpath / 05_fpath.zshrc
index 7ba822f817db686681a0a5bdd98ea681cbe0a628..f39645a30a0955549eeade7c7b44535e40d94414 100644 (file)
@@ -3,4 +3,24 @@
 
 typeset -xTU AXZSH_FPATH axzsh_fpath 2>/dev/null
 
-[[ -n "$AXZSH_FPATH" ]] && fpath=($axzsh_fpath $fpath)
+# Search for additional ZSH function paths: lower priority than plugins
+for dir (
+       /usr/local/share/zsh/site-functions(N)
+       /usr/share/zsh/site-functions(N)
+); do
+               [[ -d "$dir" ]] && axzsh_fpath=($axzsh_fpath "$dir")
+done
+
+# Add current "fpath" to axzsh_fpath
+axzsh_fpath=($axzsh_fpath $fpath)
+
+# Search for additional ZSH function paths: higher priority than plugins
+for dir (
+       $HOME/.config/zsh/functions(N)
+       $HOME/.zsh/functions(N)
+); do
+       [[ -d "$dir" ]] && axzsh_fpath=("$dir" $axzsh_fpath)
+done
+
+# Set ZSH "fpath" from axzsh_fpath (which is exported to subshells)
+fpath=($axzsh_fpath)