Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
315 lines (257 sloc) 8.01 KB
# *************************************
#
# Aliases
#
# *************************************
# -------------------------------------
# Ag
# -------------------------------------
alias a='ag'
# -------------------------------------
# Brew
# -------------------------------------
# ----- Drew's Brew ----- #
alias drew='brew'
alias d='brew'
alias dc='brew cask'
alias dcs='brew cask search'
alias dci='brew cask install'
alias dcu='brew cask uninstall'
alias dd='brew doctor'
alias di='brew install'
alias dl='brew list'
alias du='brew update'
alias dg='brew upgrade'
alias beerfest='brew update && brew cleanup && brew prune && brew doctor'
# -------------------------------------
# Files & Jumps
# -------------------------------------
alias al="vim $ALIASES_PATH"
alias bfunc="vim $GENERALFUNC_PATH"
alias cd.="cd $DOTFILES_PATH"
alias cdl="cd $DOTFILES_LOCAL_PATH"
alias mappings="vim $VIM_MAPPINGS_PATH"
alias rc="vim $VIMRC_PATH"
alias vfiles="vim $VIM_FILES_PATH"
# -------------------------------------
# Git
# -------------------------------------
# ----- Git ----- #
alias g='git'
alias ga='git add'
alias gac='git add . && git commit'
alias gacv='git add . && git commit --verbose'
alias gap='git add -p'
alias gast='git add . && git stash save'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -D'
alias gbdr='git push origin --delete'
alias gc='git commit'
alias gce='git commit --amend'
alias gcv='git commit --verbose'
alias gd='git diff'
alias gdc='git diff --stat --color'
alias gdcn='git diff --name-status'
alias gdcs='git shortlog'
alias gds='git diff --staged'
alias gdst='git diff --stat'
alias gdt='git difftool'
alias gfb='git checkout -b'
alias gg='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative -15'
alias gga='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative'
alias ggo='git log --oneline --stat'
alias gl='git pull'
alias glr='git pull --rebase'
alias gm='git merge'
alias gmff='git merge --no-ff'
alias gmm='git merge master'
alias gmt='git mergetool'
alias go='git checkout'
alias gom='git checkout master'
alias gp='git push'
alias gpf='git push -f'
alias gpo='git push origin'
alias gpom='git push origin master'
alias gpp='git pull --rebase && git push'
alias gppm='git push production master'
alias gppt='git pull --rebase && git push && git push --tags'
alias gptb='git push -u origin'
alias gr='git reset'
alias grd='git reset --hard'
alias grh='git reset HEAD^'
alias grp='git remote prune origin'
alias grpd='git remote prune origin --dry-run'
alias grtb='git_remote_tracking_branch'
alias gs='git status'
alias gss='git status -sb'
alias gst='git stash save'
alias gstd='git stash drop stash@{0}'
alias gsth='git stash show'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gstpr='git stash pop && git reset'
alias gt='git tag'
alias gtd='git tag -d'
alias gw='git show'
alias git_config_vars='git config --global -l'
alias git_current_tag='git describe --abbrev=0 --tags'
alias git_push_deploy='git pull --rebase && git push && rake deploy'
alias git_tag='git-tag'
alias git_update_submodules='git submodule foreach git pull'
# ----- Heroku ----- #
alias hd='gpmp'
alias hl='heroku logs'
alias hlt='heroku logs -t'
alias hrc='heroku run rails console'
alias hrk='heroku run rake'
# ----- Hub ----- #
alias h='hub'
alias hb='hub browse'
alias hc='hub clone'
alias hpr='hub pull-request'
# ----- GHI ----- #
alias i='ghi'
alias ia='ghi edit -u'
alias iam='ghi edit --claim'
alias ic='ghi close'
alias icm='ghi comment -v'
alias il='ghi list'
alias ill='ghi list -L'
alias ilm='ghi list --mine'
alias ilma='ghi list -a --mine'
alias is='ghi show'
# -------------------------------------
# Middleman
# -------------------------------------
alias mmb='./bin/middleman build'
alias mms='./bin/middleman s'
# -------------------------------------
# Miscellaneous
# -------------------------------------
alias coffeelint='coffeelint -f $HOME/.dotfiles/coffeelint/coffeelint.json'
alias mas='reattach-to-user-namespace mas'
alias pomodoro='time-police 25'
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
# -------------------------------------
# NPM
# -------------------------------------
alias ni='npm install'
alias nin='npm init'
alias nis='npm install --save'
alias nisd='npm install --save-dev'
alias npm_list='npm -g ls --depth=0'
alias nr='npm run'
alias ns='npm start'
# -------------------------------------
# macOS
# -------------------------------------
# Clean up LaunchServices to remove duplicates in the 'Open With' menu
alias ls_cleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
# Latest macOS versions don't loading SSH keys on restart for some reason
alias add_ssh_key='ssh-add -K ~/.ssh/id_rsa'
# -------------------------------------
# Rails Environment
# -------------------------------------
# ----- Bundle ----- #
alias be='bundle exec'
alias bi='bundle install'
alias bib='bundle install --binstubs'
# ----- Pow ----- #
alias pd='powder'
alias pdl='powder link'
alias pdo='powder open'
alias pdr='powder restart'
# ----- Rails ----- #
alias ra='./bin/rails'
alias rac='./bin/rails c'
alias rag='./bin/rails g'
alias ram='./bin/rails g migration'
alias ras='./bin/rails s'
# ----- Rake ----- #
alias rk='./bin/rake'
alias rkap='RAILS_ENV=development ./bin/rake assets:precompile'
alias rkdbc='./bin/rake db:create'
alias rkdbd='./bin/rake db:drop'
alias rkdbm='./bin/rake db:migrate'
alias rkdbr='./bin/rake db:reset'
alias rkdbs='./bin/rake db:seed'
alias rkdbt='./bin/rake db:setup'
alias rkdy='rake deploy'
alias rkt='./bin/rake -T'
# -------------------------------------
# rbenv
# -------------------------------------
alias rb='rbenv'
alias rbi='rbenv install'
alias rbil='rbenv install --list'
alias rbr='rbenv rehash'
alias rbv='rbenv version'
alias rbva='rbenv versions'
alias update_rbenv='cd $HOME/.rbenv && git pull && cd -'
alias update_ruby_build='cd $HOME/.rbenv/plugins/ruby-build && git pull && cd -'
# -------------------------------------
# tmux
# -------------------------------------
alias tx='tmux'
alias txa='tmux a -t'
alias txd='tmux kill-session -t'
alias txl='tmux ls'
alias txn='tmux new -s'
alias txs='tmux source-file ~/.tmux.conf'
# -------------------------------------
# Tmuxinator
# -------------------------------------
alias mux='tmuxinator'
# -------------------------------------
# tpm
# -------------------------------------
alias tpmi='~/.tmux/plugins/tpm/bin/install_plugins'
alias tpmu='~/.tmux/plugins/tpm/bin/update_plugins'
alias tpmua='~/.tmux/plugins/tpm/bin/update_plugins all'
alias tpmr='~/.tmux/plugins/tpm/bin/clean_plugins'
# -------------------------------------
# Unix
# -------------------------------------
# ----- Listing ----- #
alias l='ls -1F'
alias la='ls -A1F'
alias ld='ls -lFh'
alias path="echo $PATH | tr ':' '\n'"
# ----- Miscellaneous ----- #
alias ..='cd ..'
alias ...='cd ../..'
alias -- -='cd -'
alias c='clear'
alias md='mkdir'
alias mf='touch'
alias p='less'
alias sbp='source ~/.bash_profile'
alias sym='ln -s'
# ----- Removal ----- #
alias rmd='rm -rf'
alias rmorig='find . -name *.orig -delete'
# ----- Searching ----- #
alias fa='alias | grep'
alias grep='grep --color=auto'
alias magic_numbers="ag -i '(FIXME: Magic number!)'" # `| wc -l` to get the count
alias todos="ag -i '(TODO|FIX(ME)|NOTE?):'"
# -------------------------------------
# Vim
# -------------------------------------
# Disable C-s in terminal
alias vim="stty stop '' -ixoff ; vim"
alias f='fg'
alias v='vim_launch'
alias vn='vim_launch_no_fun'
alias vc='vim -u NONE'
# -------------------------------------
# Yarn
# -------------------------------------
alias y='yarn'
alias ya='yarn add'
alias yd='yarn outdated'
alias yi='yarn init'
alias yr='yarn remove'
alias yu='yarn upgrade'
alias yui='yarn upgrade-interactive'