Skip to content

Instantly share code, notes, and snippets.

@shortcircuit3
Last active August 29, 2015 13:58
Show Gist options
  • Save shortcircuit3/9967271 to your computer and use it in GitHub Desktop.
Save shortcircuit3/9967271 to your computer and use it in GitHub Desktop.
## git completion (run brew install bash-completion first)
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
## branch name in prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
## Add git completion installed via homebrew.
source /usr/local/etc/bash_completion.d/git-completion.bash
function proml {
local GREEN="\[\033[0;32m\]"
local DEFAULT="\[\033[0m\]"
local CYAN="\[\033[1;36m\]"
local RED="\[\033[1;31m\]"
PS1="$CYAN\n\W\$(parse_git_branch)$RED\n⚡ $DEFAULT"
}
proml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment