Created
July 26, 2010 10:00
-
-
Save liangzan/490372 to your computer and use it in GitHub Desktop.
to show rvm in zsh prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add the rvm_info_for_prompt into your prompt | |
# below is my full prompt | |
PS1='%{$fg[white]%}%n%{$fg[cyan]%}:%{$fg_no_bold[yellow]%}%3~%{$fg_no_bold[green]%}$(git_info_for_prompt)%{$fg_no_bold[magenta]%}$(rvm_info_for_prompt)%{$reset_color%}# ' | |
# this tests for the presence of rvm | |
# if its loaded, it'll add the prompt | |
function rvm_info_for_prompt { | |
ruby_version=$(~/.rvm/bin/rvm-prompt) | |
if [ -n "$ruby_version" ]; then | |
echo "[$ruby_version]" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment