Last Updated: February 25, 2016
·
528
· kmerz

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