Last active
December 11, 2015 04:59
-
-
Save minism/4549305 to your computer and use it in GitHub Desktop.
This file contains 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
# Returns "*" if the current git branch is dirty. | |
_parse_git_dirty() | |
{ | |
[[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "*" | |
} | |
# Get the current git branch name (if available) | |
_git_prompt() | |
{ | |
local ref=$(git symbolic-ref HEAD 2>/dev/null | cut -d'/' -f3) | |
if [ "$ref" != "" ]; then | |
echo "($ref$(_parse_git_dirty)) " | |
fi | |
} | |
_screen_prompt() | |
{ | |
if [ "${WINDOW}" != "" ]; then | |
echo "[$WINDOW] " | |
fi | |
} | |
alias ls='ls -FG' | |
alias grep='egrep --color=auto' | |
export CLICOLOR=1 | |
export PS1="\$(type -t _screen_prompt > /dev/null && _screen_prompt)\[\033[0;32m\]\u@\h\[\033[0m\] \[\033[0;36m\]\w\[\033[0m\] \[\033[0;33m\]\$(type -t _git_prompt > /dev/null && _git_prompt)\[\033[0;31m\]\[\033[0m\]% " | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment