Permalink
Browse files

add rbenv ruby version to prompt

  • Loading branch information...
1 parent b9244ec commit 86e900de53397662ccac00eacd66f36edc465c00 Jason Mayfield committed Apr 12, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 .zshrc
View
8 .zshrc
@@ -59,6 +59,12 @@ function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
+function rbenv_prompt_info() {
+ local ruby_version
+ ruby_version=$(rbenv version 2> /dev/null) || return
+ echo "$ruby_version" | sed 's/[ \t].*$/›/'
+}
+
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg_bold[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=""
@@ -85,4 +91,4 @@ eval "$(rbenv init -)"
PROMPT='
%{$fg[cyan]%}${PWD/#$HOME/~}%{$reset_color%}
$(virtualenv_info)%{$fg[green]%}>%{$reset_color%} '
-RPROMPT='%{$fg[white]%}$(~/bin/git-cwd-info.rb)%{$reset_color%}'
+RPROMPT='%{$fg[white]%}$(rbenv_prompt_info)$(~/bin/git-cwd-info.rb)%{$reset_color%}'

0 comments on commit 86e900d

Please sign in to comment.