Skip to content

Instantly share code, notes, and snippets.

@joaoneto
Last active December 13, 2015 18:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaoneto/4954479 to your computer and use it in GitHub Desktop.
Save joaoneto/4954479 to your computer and use it in GitHub Desktop.
Put .bashrc_ps1 in your home (~/) and at the end of your .bashrc add follow lines: if [ -f ~/.bashrc_ps1 ]; then . ~/.bashrc_ps1 fi
# Put .bashrc_ps1 in your home (~/) and at the end of your .bashrc add follow lines:
# if [ -f ~/.bashrc_ps1 ]; then
# . ~/.bashrc_ps1
# fi
RED='\[\e[0;31m\]'
BRED='\[\e[1;31m\]'
BLUE='\[\e[0;34m\]'
BBLUE='\[\e[1;34m\]'
CYAN='\[\e[0;36m\]'
BCYAN='\[\e[1;36m\]'
NC='\[\e[0m\]' # No Color
BLACK='\[\e[0;30m\]'
BBLACK='\[\e[1;30m\]'
GREEN='\[\e[0;32m\]'
BGREEN='\[\e[1;32m\]'
YELLOW='\[\e[0;33m\]'
BYELLOW='\[\e[1;33m\]'
MAGENTA='\[\e[0;35m\]'
BMAGENTA='\[\e[1;35m\]'
WHITE='\[\e[0;37m\]'
BWHITE='\[\e[1;37m\]'
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1="$CYAN\$(date +%H:%M) $YELLOW[$BLUE\u@\h:$RED\w$YELLOW]$NC\n$YELLOW\$(parse_git_branch)$NC% "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment