Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/sbin:$PATH
#export PATH=/usr/local/share/python:$PATH
#export PATH=/usr/local/Cellar/ruby/1.9.3-p194/bin:$PATH
export PATH=/usr/local/opt/ruby/bin:$PATH
export PATH=/Applications/MATLAB_R2013b.app/bin:$PATH
export PATH=/usr/local/mysql/bin:$PATH
export NODE_PATH="/usr/local/lib/node"
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/share/npm/bin:$PATH"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagacedsource
alias ls='ls -Glah'
git_branch () {
if git rev-parse --git-dir >/dev/null 2>&1
then echo -e "" [$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')]
else
echo ""
fi
}
function git_color {
local STATUS=`git status 2>&1`
if [[ "$STATUS" == *'Not a git repository'* ]]
then echo ""
else
if [[ "$STATUS" != *'working directory clean'* ]]
then
# red if need to commit
echo -e '\033[0;31m'
else
if [[ "$STATUS" == *'Your branch is ahead'* ]]
then
# yellow if need to push
echo -e '\033[0;33m'
else
# else cyan
echo -e '\033[0;32m'
fi
fi
fi
}
export PS1='\[\033[0;35m\] λ \[\033[0;36m\]\w/\[$(git_color)\]$(git_branch)\[\033[m\] '
source "`brew --prefix`/etc/grc.bashrc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment