]> arthur.barton.de Git - ax-zsh.git/commitdiff
Enhance handling of the Homebrew environment
authorAlexander Barton <alex@barton.de>
Sat, 4 Dec 2021 12:57:41 +0000 (13:57 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 4 Dec 2021 12:57:41 +0000 (13:57 +0100)
- Call "brew shellenv" to set all relevant environment variables,
- and use "$HOMEBREW_PREFIX" when looking for installed files.

plugins/autojump/autojump.zshrc
plugins/fzf/fzf.zshrc
plugins/homebrew/homebrew.zprofile

index f252aabcbd5b9b048cab733c7dc32748fd7d27e0..f5c9e0acba07ee7713e51d50bc5e3002ef05dc8a 100644 (file)
@@ -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
index 85bcc37229f5cba9e75fd45b5323e11518d0352c..95c6ff8d0a3141877b9b93a5d549c150a88c1635 100644 (file)
@@ -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
index 5885efdb57b3720f80f9e10c7a502db94924e984..ccab0b73bb95f9bbaf41dc25aaf29f03b5c0a104 100644 (file)
@@ -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