Skip to content

Instantly share code, notes, and snippets.

@listrophy
Created December 31, 2008 19:05
Show Gist options
  • Save listrophy/42088 to your computer and use it in GitHub Desktop.
Save listrophy/42088 to your computer and use it in GitHub Desktop.
parse_git_branch(){
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
parse_home_dir(){
pwd -P | sed -e "s/^$(echo $HOME | sed -e 's/\//\\\//g')/~/" -e 's/~\/Development/~\/dev/'
}
PS1="\$(parse_home_dir)\$(parse_git_branch) $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment