Skip to content

Instantly share code, notes, and snippets.

@mattvagni
Created March 12, 2013 15:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattvagni/5144042 to your computer and use it in GitHub Desktop.
Save mattvagni/5144042 to your computer and use it in GitHub Desktop.
My bash prompt thing...
export EDITOR='subl -w'
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
function make_prompt {
local BLUE="\[\033[0;34m\]"
local GREEN="\[\033[0;32m\]"
local DEFAULT="\[\033[0m\]"
PS1="\u :: $GREEN[\w]$BLUE\$(parse_git_branch) $DEFAULT\$ "
}
make_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment