Skip to content

Instantly share code, notes, and snippets.

@colin
Created August 3, 2009 11:37
Show Gist options
  • Save colin/160501 to your computer and use it in GitHub Desktop.
Save colin/160501 to your computer and use it in GitHub Desktop.
# environment variables
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/opt/local/bin:$PATH"
export EDITOR='mate -w'
# aliases
alias l="ls -la"
alias gemi='sudo gem install --no-rdoc --no-ri'
alias gemu='sudo gem update --no-rdoc --no-ri'
alias ss='ruby script/server'
alias sc='ruby script/console'
alias sg='ruby script/generate '
alias a='autotest -rails'
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
# git
alias gst='git status'
alias gl='git pull'
alias gp='git push'
alias gd='git diff | mate'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcb='git checkout -b'
alias gb='git branch -v'
alias gba='git branch -v -a --color'
alias gru='git remote update'
# git completion, see:
# http://railsdog.com/2009/03/custom-bash-prompt-for-git-branches/
source ~/.git_completion.sh
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\h:\W$(__git_ps1 "[\[\e[0;32m\]%s\[\e[0m\]\[\e[0;33m\]$(parse_git_dirty)\[\e[0m\]]")$ '
# colors
export TERM=xterm-color
export CLICOLOR=true
export LSCOLORS=dxfxcxdxbxegedabagacad
# Cappuccino
export CAPP_BUILD="/usr/local/src/capp_build"
# iPhone
alias simwd='cd "/Users/$USER/Library/Application Support/iPhone Simulator/User/Applications/" && cd `ls -t | cut -f 1 | head -1` && echo "Changed to `pwd`"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment