Created
September 19, 2012 15:42
-
-
Save arian/3750363 to your computer and use it in GitHub Desktop.
.bashrc additions.
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
# 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