Conditionally load zsh-autosuggestions

File is located in different directories in different operating systems
This commit is contained in:
2025-07-11 23:04:39 -04:00
parent 45506cfca3
commit 975d1712c3

View File

@@ -33,7 +33,15 @@ if type brew &>/dev/null; then
compinit
fi
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# zsh-autosuggestions
case `uname` in
Darwin)
[[ -f /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] && source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
;;
Linux)
[[ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]] && source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
;;
esac
# heroku autocomplete setup
HEROKU_AC_ZSH_SETUP_PATH=/Users/myockey/Library/Caches/heroku/autocomplete/zsh_setup && test -f $HEROKU_AC_ZSH_SETUP_PATH && source $HEROKU_AC_ZSH_SETUP_PATH