diff --git a/functions b/functions index 7175021..586dfc7 100644 --- a/functions +++ b/functions @@ -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 "$@" +} diff --git a/zshrc b/zshrc index c8896d6..f41015d 100644 --- a/zshrc +++ b/zshrc @@ -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