Created
July 29, 2011 20:19
-
-
Save roelbondoc/1114639 to your computer and use it in GitHub Desktop.
bashrc ps1 setup
This file contains hidden or 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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
parse_rvm() { | |
rvm list 2> /dev/null | grep '=>' | sed -e 's/.*\s\(ruby\S*\).*/ (\1)/' | |
} | |
parse_gemset() { | |
rvm gemset list 2> /dev/null | grep '=>' | sed -e 's/=>\s*\(\w*\)/ (\1)/g' | |
} | |
PS1="\w\e[0;32m\$(parse_git_branch)\e[m\e[0;31m\$(parse_rvm)\e[m\e[0;34m\$(parse_gemset)\e[m\n$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment