Deferring rbenv init until we need it

since it appears to be the shell init hog.
This commit is contained in:
Dan Buch 2013-01-19 23:45:51 -05:00
parent bc0fc62b2f
commit 1bce27ce8b
3 changed files with 13 additions and 9 deletions

View File

@ -12,6 +12,7 @@ alias ll='l -l'
alias lla='l -la'
alias p=ipython
alias psg='pgrep -fl'
alias rbi='rbenv_init'
alias s="cat $HOME/.ssh/config | grep '^Host ' | sed \"s/Host //\" | sort | uniq"
alias sS='TERM=xterm screen -Rd -S '
alias scr='TERM=xterm screen -Rd'

View File

@ -157,3 +157,14 @@ function precmd(){
function unhyphenate() {
ruby -e "puts '$1'.gsub(/[\-_]/, ' ')"
}
function rbenv_init() {
if [ -n "$DEBUG" ] ; then
export RBENV_DEBUG=1
time eval "$(rbenv init -)"
unset RBENV_DEBUG
else
eval "$(rbenv init -)"
fi
}

View File

@ -70,14 +70,6 @@ _bash_profile_main() {
get_ssh_agent
get_gpg_agent
if [ -n "$DEBUG" ] ; then
export RBENV_DEBUG=1
time eval "$(rbenv init -)"
unset RBENV_DEBUG
else
eval "$(rbenv init -)"
fi
_source_if_exists "$HOME/.gvm/scripts/gvm"
_source_if_exists "$HOME/.gvmrc"
_source_if_exists "$HOME/src/gocode/src/.env"