Skip to content

Instantly share code, notes, and snippets.

@willpatera
Created August 9, 2014 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willpatera/17088b4ee468ccbf8347 to your computer and use it in GitHub Desktop.
Save willpatera/17088b4ee468ccbf8347 to your computer and use it in GitHub Desktop.
dotfiles
export EDITOR=slime
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"
# Set architecture flags
# export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
# path for node.js
export PATH=/usr/local/share/npm/bin:$PATH
# alias shortcuts
alias code="cd /Volumes/HD_Two/Users/Will/Documents/Code"
alias docs="cd /Volumes/HD_Two/Users/Will/Documents"
alias sites="cd /Volumes/HD_Two/Users/Will/Sites"
alias pupil="cd /Volumes/HD_Two/Users/Will/Code/pupil"
# password store auto completion
source /usr/local/etc/bash_completion.d/password-store
# terminal styling with git functionality
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\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment