Skip to content

Instantly share code, notes, and snippets.

@nedmas
Created November 10, 2011 16:16
Show Gist options
  • Save nedmas/1355258 to your computer and use it in GitHub Desktop.
Save nedmas/1355258 to your computer and use it in GitHub Desktop.
Mac OS X Bash Profile
export PATH=~/bin:$PATH
export CLICOLOR=1
export LSCOLORS='Axfxcxdxbxegedabagacad'
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
else
return 0
fi
echo -e "($gitver)"
}
branch_color ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
color=""
if git diff --quiet 2>/dev/null >&2
then
color="\033[00;32m"
else
color="\033[00;31m"
fi
else
return 0
fi
echo -ne "$color"
}
export PS1='\[\033[01;30m\]\u@\h\[\033[01;37m\]:\[\033[01;33m\]\w\[$(branch_color)\]$(parse_git_branch)\[\033[00;00m\]$ '
alias grep="grep --colour=auto"
alias la="ls -a"
alias ll="ls -al"
alias targzip="tar -czfv"
alias tarbzip2="tar -cjfv"
alias untargzip="tar -xzfv"
alias untarbzip2="tar -xjfv"
alias genpwd="gpg --gen-random --armor 1 9"
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
[[ -s "/Users/tomdensham/.rvm/scripts/rvm" ]] && source "/Users/tomdensham/.rvm/scripts/rvm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment