Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created July 8, 2013 18:42
Show Gist options
  • Save jasonroelofs/5951363 to your computer and use it in GitHub Desktop.
Save jasonroelofs/5951363 to your computer and use it in GitHub Desktop.
My current prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
parse_git_dirty () {
if [[ $((git status 2> /dev/null) | tail -n1) = "" ]]; then
echo ""
elif [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
echo "✗"
else
echo ""
fi
}
LIGHT_CYAN="\[\033[1;36m\]"
YELLOW="\[\033[1;33m\]"
LIGHT_RED="\[\033[1;31m\]"
WHITE="\[\033[1;37m\]"
export PS1="$LIGHT_CYAN\u@\h:$YELLOW\w $LIGHT_RED\$(parse_git_branch)$YELLOW\n] $WHITE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment