Skip to content

Instantly share code, notes, and snippets.

@bwv988
Created September 27, 2018 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwv988/286da149c3146d64dc08d615453dcd34 to your computer and use it in GitHub Desktop.
Save bwv988/286da149c3146d64dc08d615453dcd34 to your computer and use it in GitHub Desktop.
# Add this to bash profile
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export PS1="[\[\e[33;1;40m\]\t\[\e[0m\]][\u@\h:\[\e[37;1;40m\]\w\[\e[0m\]]\$ "
# This adds the current git branch to the PS1 string started above.
function execute_parse {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Add a little space...
function parse_git_branch {
local ret
if [ -z "$(execute_parse)" ]; then
ret=""
else
ret=" $(execute_parse)"
fi
echo "$ret"
}
function proml {
local WHITE='\e[0m'
local GREEN='\e[0;32m'
PS1="[\[\e[33;1;40m\]\t\[\e[0m\]][\u@\h:\[\e[37;1;40m\]\w\[\e[0m\]\[$GREEN\]\$(parse_git_branch)\[$WHITE\]]\$ "
PS2='> '
PS4='+ '
}
proml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment