Lazy load our shim loaders

This commit is contained in:
Andrew Tomaka 2017-01-03 16:28:49 -05:00
parent 0fccfd640c
commit 982439c2b2
2 changed files with 17 additions and 10 deletions

View file

@ -55,3 +55,20 @@ function run {
function npm-exec {
(PATH=$(npm bin):$PATH; eval $@;)
}
# lazy loading
function rbenv {
eval "$(command rbenv init -)"
rbenv "$@"
}
function nodeenv {
eval "$(command nodenv init -)"
nodenv "$@"
}
function pyenv {
eval "$(command pyenv init -)"
eval "$(command pyenv virtualenv-init -)"
pyenv "$@"
}

10
zshrc
View file

@ -27,16 +27,6 @@ fi
zle -N insert-sudo
bindkey "^z" insert-sudo
# init rbenv
if test -d "$HOME/.rbenv"; then
eval "$(rbenv init -)"
fi
# init nodenv
if which nodenv > /dev/null; then
eval "$(nodenv init -)";
fi
# completion
autoload -U compinit
compinit