Skip to content

Instantly share code, notes, and snippets.

@simonc
Last active December 16, 2015 21:49
Show Gist options
  • Save simonc/5502812 to your computer and use it in GitHub Desktop.
Save simonc/5502812 to your computer and use it in GitHub Desktop.
My ZSH configuration
# tweaking the Ruby GC to speed up tests
export RUBY_GC_MALLOC_LIMIT=90000000
export RUBY_FREE_MIN=200000
# chruby
source /usr/local/opt/chruby/share/chruby/chruby.sh
source /usr/local/opt/chruby/share/chruby/auto.sh
RUBIES=(/usr/local/rubies/*)
chruby $(cat ~/.ruby-version)
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="happynoff"
DISABLE_CORRECTION="true"
plugins=(autojump brew bundler capistrano gem git heroku pow rails textmate vagrant)
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $ZSH/oh-my-zsh.sh
setopt NO_NOMATCH
unsetopt share_history
unsetopt correct_all
export BUNDLER_EDITOR=mate
# Add brew installed coreutils without the 'g' prefix
export PATH=$(brew --prefix coreutils)/libexec/gnubin:$PATH
export PATH=~/zone51/bin:$PATH
# If your mac is in English
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
alias a='git add'
alias b='bundle'
alias c='git ci -m'
alias d='colordiff -u'
alias l='ls -1'
alias m='tm'
alias p='git push'
alias r='rails'
alias s='git st'
alias t='git tree'
# T rake db:migrate
# => RAILS_ENV=test rake db:migrate
alias -g T='RAILS_ENV=test'
alias cpr='rsync -p --progress'
alias gd='git diff'
alias ll='ls -Fhl'
alias ls='ls --group-directories-first --color=auto'
alias nl='nl -ba'
alias rc='r c'
alias log='tail -fn0'
alias mig='rake db:migrate'
alias rmf='rm -f'
# Stop using grep! Use ack or the_silver_searcher (Ag)
alias grep='echo "use ag !"'
alias rmrf='rm -rf'
alias roll='rake db:rollback'
alias clear-dns-cache='sudo killall -HUP mDNSResponder'
function aa() {
git add -N . && git add --patch .
}
function mcd() {
mkdir -p "$1" && cd "$1";
}
# Removes a files from the entire git history
# rmgit <some-file>
function rmgit() {
git filter-branch --index-filter "git rm --cached --ignore-unmatch $1"
rm -rf .git/refs/original/
git reflog expire --all --expire='0 days'
git repack -A -d
git prune
git fsck --full --unreachable
}
# install-ruby 2.0.0-p0
function install-ruby() {
ruby-install -i /usr/local/rubies/ruby-$1 ruby $1 -- CFLAGS="-march=native -O3"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment