Skip to content

Instantly share code, notes, and snippets.

@carlos-jenkins
Last active May 30, 2017 06:08
Show Gist options
  • Save carlos-jenkins/e1e9f52c2911e21b69c6231589be5c2f to your computer and use it in GitHub Desktop.
Save carlos-jenkins/e1e9f52c2911e21b69c6231589be5c2f to your computer and use it in GitHub Desktop.
Colored prompt for bash with git support
# Prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
}
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$\[\033[38;5;166m\]$(parse_git_branch)\[\033[00m\] '
# Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment