From 1bce27ce8bd9c21f99d692a7eb9ca2347c3d0055 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sat, 19 Jan 2013 23:45:51 -0500 Subject: [PATCH] Deferring rbenv init until we need it since it appears to be the shell init hog. --- bash_aliases | 1 + bash_functions | 13 ++++++++++++- bash_profile | 8 -------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bash_aliases b/bash_aliases index c20f490..024210f 100644 --- a/bash_aliases +++ b/bash_aliases @@ -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' diff --git a/bash_functions b/bash_functions index e15b250..3e6d66e 100644 --- a/bash_functions +++ b/bash_functions @@ -154,6 +154,17 @@ function precmd(){ } -function unhyphenate(){ +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 +} diff --git a/bash_profile b/bash_profile index 9b9464e..858a5b7 100644 --- a/bash_profile +++ b/bash_profile @@ -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"