Replace rbenv and nvm with asdf

This commit is contained in:
Kevin Cotugno 2023-03-03 16:58:25 -07:00
parent 717fe2044d
commit 4ae63ce2cb

29
.zshrc
View File

@ -12,6 +12,7 @@ if [[ -f "$oh_my_zsh/oh-my-zsh.sh" ]]; then
themes
git
urltools
asdf
)
if [[ $(command -v tmux) ]]; then
@ -49,18 +50,6 @@ if [[ -d "$HOME/.cargo" ]]; then
export PATH=$HOME/.cargo/bin:$PATH
fi
if [[ -d "$HOME/.rbenv" ]]; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
fi
if [[ -d "$HOME/.nvm" ]]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
fi
if [[ $(command -v nvim) ]]; then
export EDITOR="nvim"
elif [ $(command -v vim) ]; then
@ -79,6 +68,20 @@ fi
mkdir -p "$HOME/.local/bin" && export PATH="$HOME/.local/bin:$PATH"
function install_asdf_plugins() {
if [[ ! $(command -v asdf) ]]; then return; fi
local asdf_plugins=(ruby nodejs)
foreach plugin in $asdf_plugins; do
if [[ ! -d "$HOME/.asdf/plugins/$plugin" ]]; then
echo "Installing asdf $plugin plugin"
asdf plugin add $plugin https://github.com/asdf-vm/asdf-$plugin.git
asdf install $plugin latest
fi
done
}
function weather() {
local loc=$1
if [[ -z "$loc" ]]; then
@ -114,3 +117,5 @@ alias l="ls -lah"
alias ll="ls -lh"
alias la="ls -lah"
alias hexenc="hexdump -e '1/1 \"%02x\"'"
install_asdf_plugins