Skip to content

Instantly share code, notes, and snippets.

@dipth
Created August 5, 2011 11:22
Show Gist options
  • Save dipth/1127340 to your computer and use it in GitHub Desktop.
Save dipth/1127340 to your computer and use it in GitHub Desktop.
My bash profile
c_red='^[[31m'
c_green='^[[32m'
c_sgr0='^[[00m'
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2
then
gitver=${c_green}$gitver${c_sgr0}
else
gitver=${c_red}'!'$gitver${c_sgr0}
fi
else
return 0
fi
echo $gitver
}
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
[[ -r /Users/thomas/.rvm/scripts/scripts/completion ]] && . /Users/thomas/.rvm/scripts/completion # for RVM completion
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then source `brew --prefix`/etc/bash_completion.d/git-completion.bash; fi # for Git completion
export PS1="\[\033[01;37m\]\$(~/.rvm/bin/rvm-prompt) \[\033[01;32m\]\w\[\033[00;33m\]\$(__git_ps1 \" (%s)\") \[\033[01;36m\]\$\[\033[00m\] "
alias bex='bundle exec'
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/share/npm/bin:$PATH" # Remove if npm is not installed
export NODE_PATH="/usr/local/lib/node" # Remove if node.js is not installed
[[ -s "/Users/thomas/.rvm/scripts/rvm" ]] && source "/Users/thomas/.rvm/scripts/rvm" # This loads RVM into a shell session
@dipth
Copy link
Author

dipth commented Aug 27, 2011

Requires:

brew install git
brew install bash-completion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment