From 1766d34aab35777faae6e123d75783501cebb7b6 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Mon, 4 May 2026 18:02:23 +0100 Subject: darwin/zsh: Fix Homebrew position in PATH --- dotfiles-darwin/zsh/rc | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.3