Add support for ruby gem paths and rvm

Update convention to use -s over !-f
This commit is contained in:
Daniel Lynn 2021-07-22 15:18:16 -04:00
parent 12d3671b52
commit a23362f69d
No known key found for this signature in database
GPG Key ID: 6F440E53B7A8C151
2 changed files with 17 additions and 8 deletions

14
zshenv
View File

@ -1,10 +1,20 @@
export EDITOR="nvim"
export GPG_TTY=$(tty)
export NVM_DIR="$HOME/.nvm"
fpath+=(~/.zsh/completions)
# Setup cargo
[[ ! -f ~/.cargo/env ]] || source ~/.cargo/env
[[ -s ~/.cargo/env ]] && source ~/.cargo/env
# Source machine-specific environment
[[ ! -f ~/.zshenv.local ]] || source ~/.zshenv.local
[[ -s ~/.zshenv.local ]] && source ~/.zshenv.local
# Local gems
if (( $+commands[ruby] )); then
local gem_bin_path="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
[[ -d "$gem_bin_path" ]] && path+=("$gem_bin_path")
fi
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
[[ -d "$HOME/.rvm/bin" ]] && path+=("$HOME/.rvm/bin")

11
zshrc
View File

@ -20,15 +20,14 @@ if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[[ -s ~/.p10k.zsh ]] && source ~/.p10k.zsh
# Custom aliases
[[ ! -f ~/.aliases ]] || source ~/.aliases
[[ -s ~/.aliases ]] && source ~/.aliases
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" # This loads nvm
[[ -s "$NVM_DIR/bash_completion" ]] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Source machine-specific setup
[[ ! -f ~/.zshrc.local ]] || source ~/.zshrc.local
[[ -s ~/.zshrc.local ]] && source ~/.zshrc.local