From bb88c39c17b62961ec6814849d4e1ca634d7730b Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 4 Dec 2021 13:57:41 +0100 Subject: [PATCH] Enhance handling of the Homebrew environment - Call "brew shellenv" to set all relevant environment variables, - and use "$HOMEBREW_PREFIX" when looking for installed files. --- plugins/autojump/autojump.zshrc | 1 + plugins/fzf/fzf.zshrc | 1 + plugins/homebrew/homebrew.zprofile | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/autojump/autojump.zshrc b/plugins/autojump/autojump.zshrc index f252aab..f5c9e0a 100644 --- a/plugins/autojump/autojump.zshrc +++ b/plugins/autojump/autojump.zshrc @@ -2,6 +2,7 @@ # autojump.zshrc: Initialize "autojump" for script ( + "$HOMEBREW_PREFIX/etc/profile.d/autojump.sh" "/usr/local/etc/profile.d/autojump.sh" "/usr/share/autojump/autojump.zsh" ); do diff --git a/plugins/fzf/fzf.zshrc b/plugins/fzf/fzf.zshrc index 85bcc37..95c6ff8 100644 --- a/plugins/fzf/fzf.zshrc +++ b/plugins/fzf/fzf.zshrc @@ -25,6 +25,7 @@ fi # Search for and read in FZF ZSH integration files for dir ( + "$HOMEBREW_PREFIX"/opt/fzf/shell /usr/local/lib/fzf/shell /usr/local/opt/fzf/shell /usr/local/share/examples/fzf/shell diff --git a/plugins/homebrew/homebrew.zprofile b/plugins/homebrew/homebrew.zprofile index 5885efd..ccab0b7 100644 --- a/plugins/homebrew/homebrew.zprofile +++ b/plugins/homebrew/homebrew.zprofile @@ -4,7 +4,9 @@ # Make sure that "brew(1)" is installed (( $+commands[brew] )) || return 1 -[[ -d "/usr/local/share/zsh-completions" ]] \ - && axzsh_fpath+=(/usr/local/share/zsh-completions) +eval "$(brew shellenv)" + +[[ -d "$HOMEBREW_PREIX/share/zsh-completions" ]] \ + && axzsh_fpath+=("$HOMEBREW_PREFIX/share/zsh-completions") return 0 -- 2.39.2