summaryrefslogtreecommitdiff
path: root/dotfiles-darwin/zsh/rc
diff options
context:
space:
mode:
authorGrégoire Duchêne <gregoire@awhk.org>2026-05-04 18:02:23 +0100
committerGrégoire Duchêne <gregoire@awhk.org>2026-05-04 18:02:23 +0100
commit1766d34aab35777faae6e123d75783501cebb7b6 (patch)
tree38e756ff024a550262b1819f4b030faa6dacf1f4 /dotfiles-darwin/zsh/rc
parenta2620f6d53f9f086ebf63bddfbd4bbd0f0409f7e (diff)
darwin/zsh: Fix Homebrew position in PATH
Diffstat (limited to 'dotfiles-darwin/zsh/rc')
-rw-r--r--dotfiles-darwin/zsh/rc6
1 files changed, 6 insertions, 0 deletions
diff --git a/dotfiles-darwin/zsh/rc b/dotfiles-darwin/zsh/rc
index cb9ba33..12e295a 100644
--- a/dotfiles-darwin/zsh/rc
+++ b/dotfiles-darwin/zsh/rc
@@ -13,6 +13,12 @@ else
alias lsh='ls -Shlr | cut -f5- -w'
fi
+# Make Homebrew appear right after /usr/local/bin. For some reason,
+# Homebrew appears is at the end of the PATH, which is wrong.
+if (( path[(i)/usr/local/bin] + 1 != path[(i)/opt/homebrew/bin] )); then
+ path[(i)/opt/homebrew/bin]=()
+ path[$((path[(i)/usr/local/bin] + 1)),0]=/opt/homebrew/bin
+fi
if [[ ${TERM_PROGRAM} != iTerm.app ]]; then
autoload -Uz vcs_info