Created
September 18, 2009 07:50
-
-
Save jstirk/188931 to your computer and use it in GitHub Desktop.
Bash prompt from my .bashrc file
This file contains hidden or 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
| # Add our current git branch out to our path | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| condense_path() { | |
| pwd | sed "s/\/home\/$USER/~/" | sed -r "s|(\/?)(.[^\/]{0,3})[^\/]*(\/)|\\1\\2\\3|g" | |
| } | |
| PS1="\\[\\033[01;32m\\]\\u@\\h\\[\\033[01;34m\\] \$(condense_path)\\[\\033[01;33m\\]\$(parse_git_branch)\\[\\033[01;34m\\] \\\$\\[\\033[00m\\] " | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment