Skip to content

Instantly share code, notes, and snippets.

@arian
Created September 19, 2012 15:42
Show Gist options
  • Save arian/3750363 to your computer and use it in GitHub Desktop.
Save arian/3750363 to your computer and use it in GitHub Desktop.
.bashrc additions.
# add ~/bin to path
PATH=$PATH:/home/arian/bin
# use all 256 colors
if [ -n "$DISPLAY" -a "$TERM" == "xterm" ]; then
export TERM=xterm-256color
fi
function git_prompt {
local STATUS=`git status 2>&1`
if [[ "$STATUS" != *'Not a git repository'* ]]
then
if [[ "$STATUS" == *'working directory clean'* ]]
then
echo -e "\033[0;32m$(__git_ps1)\033[m"
else
echo -e "\033[0;31m$(__git_ps1)\033[m"
fi
fi
}
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(git_prompt) \$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment