Skip to content

Instantly share code, notes, and snippets.

@krzysztofjablonski
Created September 5, 2011 12:11
Show Gist options
  • Save krzysztofjablonski/1194809 to your computer and use it in GitHub Desktop.
Save krzysztofjablonski/1194809 to your computer and use it in GitHub Desktop.
my sweet bash file configuration
# Git branch name
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
parse_git_branch() {
git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
parse_rvm() {
~/.rvm/bin/rvm-prompt
}
PS1="\[\033[1;35m\]\u\[\033[1;33m\]@\[\033[1;32m\]\h \[\033[1;36m\]\t \[\033[1;37m\]\$(parse_rvm)\[\033[1;31m\] \w \[\033[1;37m\]\$(parse_git_branch)\[\033[1;32m\] "
case `id -u` in
0) PS1="${PS1}\n# \[\033[0m\]";;
*) PS1="${PS1}\n$ \[\033[0m\]";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment