Skip to content

Instantly share code, notes, and snippets.

@fredoliveira
Created December 14, 2008 05:39
Show Gist options
  • Save fredoliveira/35633 to your computer and use it in GitHub Desktop.
Save fredoliveira/35633 to your computer and use it in GitHub Desktop.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/@\1/'
}
function prompt {
local BLACK="\[\033[0;30m\]"
local VIOLET="\[\033[1;35m\]"
local CYAN="\[\033[1;36m\]"
local RESET="\[\033[0m\]"
local GREEN="\[\033[0;32m\]"
local BGY="\[\033[43m\]"
local RED="\[\033[1;31m\]"
local BLACKONYELLOW="\[\033[30;43m\]"
PS1=">> $VIOLET\u$CYAN@$VIOLET\h $RESET[$GREEN\w$RESET] $BLACKONYELLOW\$(parse_git_branch)$RESET \n \$ "
}
prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment