diff --git a/zsh/zshrc b/zsh/zshrc index 34c423c..5d188de 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -45,7 +45,7 @@ zle -N down-line-or-beginning-search [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search _command-exists() { - [[ -x "$(command -v $1)" ]] && return true || return false + [[ -x "$(command -v $1)" ]] && return 0 || return 1 } export COMPLETION_WAITING_DOTS="true" @@ -93,7 +93,7 @@ if [[ -d ~/.cargo/bin ]]; then path=($path $HOME/.cargo/bin) fi -if [[ $(_command-exists starship) -eq 0 ]]; then +if (_command-exists starship); then znap eval starship 'starship init zsh --print-full-init' znap prompt starship else @@ -159,10 +159,13 @@ if [[ $(_command-exists mcfly) -eq 0 ]]; then export MCFLY_USED=1 fi -path+=($(yarn global bin)) -export PATH +if (_command-exists yarn); then + echo "found yarn: $(command -v yarn)" + path+=($(yarn global bin)) + export PATH +fi -if [[ $(_command-exists pdm) -eq 0 ]]; then +if (_command-exists pdm); then eval "$(pdm --pep582 zsh)" fi