Skip to content

Instantly share code, notes, and snippets.

@macournoyer
Created February 13, 2012 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save macournoyer/1812942 to your computer and use it in GitHub Desktop.
Save macournoyer/1812942 to your computer and use it in GitHub Desktop.
My bash prompt
function parse_git_branch {
ref=`git symbolic-ref HEAD 2> /dev/null` || return
branch="${ref#refs/heads/}"
if [ $branch != "master" ]
then
echo "($branch)"
fi
}
function parse_rvm_prompt {
gemset=`rvm-prompt g`
if [ "$gemset" != "" ]
then
echo "($gemset)"
fi
}
export PS1='\[\033[1;32m\]\W`parse_git_branch``parse_rvm_prompt`\[\033[0;33m\]\$\[\033[0;37m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment