Created
January 25, 2014 10:11
-
-
Save mpangrazzi/8614322 to your computer and use it in GitHub Desktop.
Clean PS1 (with current git branch displayed)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is a simple, clean PS1 with current git branch displayed. | |
# How will look like: | |
# | |
# λ ~/home/project (master) | |
# | |
# NOTE: You may have to configure your terminal to support UTF-8 Unicode (so λ will displayed correctly) | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
WHITE="\[\033[1;37m\]" | |
YELLOW="\[\033[1;33m\]" | |
NO_COLOUR="\[\033[0m\]" | |
GREEN="\[\033[1;32m\]" | |
PS1="\[\033[1;37m\]λ $GREEN\w$YELLOW\$(parse_git_branch)$NO_COLOUR " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome, thanks!