Created
June 1, 2015 03:25
-
-
Save TheNaoX/e3cf7654bc7cfbb660b4 to your computer and use it in GitHub Desktop.
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
function parse_git_dirty { | |
git diff --quiet HEAD &>/dev/null | |
[[ $? == 1 ]] && echo "…" | |
} | |
if [ -n __git_ps1 ]; then | |
function parse_git_branch { | |
local branch=$(__git_ps1 "%s") | |
[[ $branch ]] && echo " $branch$(parse_git_dirty)" | |
} | |
fi | |
DIRECTORY_COLOR="\[\033[1;33m\]" | |
USER_COLOR="\[\033[1;36m\]" | |
BRANCH_COLOR="\[\033[1;31m\]" | |
BLACK="\[\033[0;1m\]" | |
export PS1="$USER_COLOR\u :: $DIRECTORY_COLOR\W$BRANCH_COLOR\$(parse_git_branch) $DIRECTORY_COLOR$ $BLACK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment