Created
May 5, 2011 00:46
-
-
Save edercosta/956327 to your computer and use it in GitHub Desktop.
rvm - name prompt
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
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)]/" | |
} | |
# rvm | |
# if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi | |
PS1='\n[\u] \[\033[1;33m\]\w\a\[\033[0m\] \[\033[1;30m\][$(~/.rvm/bin/rvm-prompt)] \[\033[0m\]\[\033[1;32m\]$(parse_git_branch)\[\033[0m\]\n$ ' | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment