colorfull bash prompt with git branch
Found here: https://techcommons.stanford.edu/topics/git/show-git-branch-bash-prompt
function gb {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local WHITE="\[\033[1;37m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
PS1="$LIGHT_GRAY\u@\h:$LIGHT_RED\w $LIGHT_GREEN\$(gb)\
$LIGHT_GRAY# "
PS2='> '
PS4='+ '
}
proml
Written by Konrad Merz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#