Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pavelbinar
Created January 9, 2018 18:47
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 pavelbinar/6b2ba9e0d6fd3f0db647ef0eee8f21d0 to your computer and use it in GitHub Desktop.
Save pavelbinar/6b2ba9e0d6fd3f0db647ef0eee8f21d0 to your computer and use it in GitHub Desktop.
function color_my_prompt {
local __user_and_location="\n\[\e[32;1m\](\[\e[37;1m\]\u\[\e[32;1m\])-(\[\e[37;1m\]\w\[\e[32;1m\])"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt="\n$\[\e[0m\]"
export PS1="$__user_and_location $__git_branch $__prompt "
}
color_my_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment