Permalink
Fetching contributors…
Cannot retrieve contributors at this time
141 lines (111 sloc) 3.1 KB
# Vim
alias v='vim'
#########
# Rails #
#########
# Local servers
alias fs='clear && forego start -p 3000'
alias rs='rails server'
alias rc='rails console'
# Routing
alias rr='rake routes'
alias rrg='rake routes | grep'
# Migrations
alias migrate='rake db:migrate db:test:prepare'
alias remigrate='rake db:migrate && rake db:migrate:redo && rake db:schema:dump db:test:prepare'
alias remongrate='rake mongoid:migrate && rake mongoid:migrate:redo'
# Bundler
alias be='bundle exec'
alias bake='bundle exec rake'
alias bmr='bundle && migrate && time rake'
#######
# Git #
#######
# git
alias g='git'
alias ga='git add'
alias gaa='git add .'
alias gap='clear && git add --patch'
alias gb='clear && git branch --all'
alias gcb='git checkout -b'
alias gci='git pull --rebase && rake && git push'
alias gco='git checkout'
alias gcom='git checkout master'
alias gd='clear && git diff'
alias gdc='clear && git diff --cached'
alias gdm='clear && git diff origin/master'
alias gl='clear && git log'
alias gp='git push'
alias gq='git rebase -i origin/master'
alias gs='git status'
alias grc='git rebase --continue'
alias gsh='git show'
alias gu='git remote prune origin && git up'
alias gca='git commit -a'
alias prune='git remote prune origin'
alias unstage='git reset HEAD'
alias wip="git commit -m 'fixup! wip [ci skip]' && git push"
function gcm() {
git commit -m $1 && git push
}
function gc() {
git commit -v $1 && git push
}
function gcam() {
git commit -am $1 && git push
}
# middleman
alias mm='middleman'
#########
# Shell #
#########
# Command line utils
alias -g G='| grep'
alias -g M='| less'
alias -g C='| pbcopy'
alias ...='../..'
alias ack='clear && ack'
alias ag='clear && ag -i'
alias c='clear'
alias df='df -h'
alias du='du -hs * | gsort -hr'
alias l='ll'
alias ll='ls -alh'
alias ln='ln -v'
alias mkdir='mkdir -p'
alias s='cd ..'
alias tr='tree -L 2'
alias diff='colordiff'
# Jump to different marked folders
# https://github.com/flavio/jump
alias j='jump'
# Tail logs
alias tlf='tail -f'
alias tld='tail -f log/development.log'
alias tlt='tail -f log/test.log'
# Tmux
alias tmn='tmux new -s'
alias tma='tmux attach -t'
# Homebrew
alias brew_update_all='brew update && brew upgrade && brew cleanup'
alias vim_update_plugins='vim +PlugUpgrade +PlugUpdate +qall'
alias good_morning='brew_update_all && vim_update_plugins'
# Misc
alias -g L='| wc -l'
alias -g ONE='| awk '{ print \$1}''
alias favorites='print -l -- ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
alias rerun="rerun --no-notify -c -i 'coverage/*'"
# rsync is better than cp
alias rsync='rsync -avz --progress --partial'
# Heroku
alias deploy-staging='git push staging && hk run rake db:migrate -a staging && hk restart -a staging'
alias deploy-production='git push production && hk run rake db:migrate -a production && hk restart -a production'
# Quick terminal notifications via https://github.com/alloy/terminal-notifier
alias notify='terminal-notifier -message'
########
# Meta #
########
# Edit aliases and source them afterward.
alias aliases='vi ~/.aliases; source ~/.aliases'
# Include custom aliases
[[ -f ~/.aliases.local ]] && source ~/.aliases.local