Skip to content

Instantly share code, notes, and snippets.

@jamesbebbington
Created June 15, 2011 08:34
Show Gist options
  • Save jamesbebbington/1026705 to your computer and use it in GitHub Desktop.
Save jamesbebbington/1026705 to your computer and use it in GitHub Desktop.
My bash profile
# bash history (see: http://blog.macromates.com/2008/working-with-history-in-bash/)
export HISTCONTROL=erasedups
export HISTSIZE=10000
shopt -s histappend
export PATH=$PATH:/usr/local/mysql/bin/
# For mysql gem install. See: http://pathfindersoftware.com/2010/10/installing-mysql-gem-with-bundler-on-snow-leopard/
export ARCHFLAGS="-arch i386"
# Aliases
alias reload='. ~/.bash_profile' # Run this alias to make shell pick up changes to this file
alias mop='top -o rsize'
alias flushdns='dscacheutil -flushcache'
alias lock='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend'
alias rubytest='ruby -I.:lib:test -rubygems' # e.g. $rubytest path/to/test.rb -n '/test name/'
# git
export GIT_EDITOR="mate -w"
# Tab completion for git
source /usr/local/git/contrib/completion/git-completion.bash
# Tab completion of known hosts
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
# Tab completion for sudo
complete -c -f command sudo
# Prompt
PS1="\$(__git_ps1) $PS1" # Git branch
PS1="\$(~/.rvm/bin/rvm-prompt i v g)$PS1" # RVM ruby
# RVM
[[ -s "/Users/james/.rvm/scripts/rvm" ]] && source "/Users/james/.rvm/scripts/rvm" # This loads RVM into a shell session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment