Skip to content

Instantly share code, notes, and snippets.

@stratequip
Created August 25, 2011 02:46
Show Gist options
  • Select an option

  • Save stratequip/1169855 to your computer and use it in GitHub Desktop.

Select an option

Save stratequip/1169855 to your computer and use it in GitHub Desktop.
RVM_PROMPT="\e[1;30m(\e[m\e[0;32m\$(rvm-prompt v p g)\e[m\e[1;30m)\e[m"
DIRECTORY="\e[1;30m(\e[m\e[1;34m\w\e[m\e[1;30m)\e[m"
PROMPT_SYM="९\e[0;37m "
# show branch and dirty status,
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "⚡"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
}
PS1="\e[1;30m[\e[m\e[0;36m\$(parse_git_branch)\e[m\e[1;30m]\e[m$RVM_PROMPT\n$DIRECTORY$PROMPT_SYM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment