helm/bash/aliases
2014-09-22 12:06:02 -04:00

91 lines
1.9 KiB
Bash

#!/bin/bash
alias q='exit'
alias clr='clear'
alias catn='cat -n' # cat + line numbers
alias -- -='cd -'
# Command fixes
alias ln="${aliases[ln]:-ln} -v" # verbose ln
alias wget='wget -c' # Resume download if possible
alias rsyncd='rsync -va --delete' # Hard sync two directories
# Shortcut for git
alias g=git
is-callable 'hub' && alias git='hub'
alias gi='git init'
alias ga='git add'
alias gap='git add --patch'
alias gc='git commit --verbose'
alias gcm='git commit --verbose -m'
alias gco='git checkout'
alias gcl='git clone'
alias gp='git push'
alias gpl='git pull'
alias gb='git branch'
alias gt='git tag'
alias gs='git status --short'
alias gS='git status'
alias gr='git reset "HEAD^"'
alias gd='git diff'
if is-callable 'tmux'; then
alias t='tmux new -s x || tmux attach -t x'
alias tl='tmux list-sessions'
alias ts='tmux switch'
function tmux-send {
tmux send-keys -s "x" $1 Enter
}
fi
# OS-specific aliases
if [[ "$OSTYPE" == darwin* ]]; then
alias codekit='open -a CodeKit'
alias b='brew'
function v {
[ $# -eq 0 ] && vim . || vim $@
}
unalias e # get rid of prezto's alias
function e {
[ -z "$@" ] && input="." || input=$@
open -a "Emacs" $input
}
else
alias ipt='sudo iptables'
fi
# transmission-remote
if is-callable 'transmission-remote'; then
alias bt='transmission-remote server'
alias btl='bt -l'
fi
alias va='vagrant'
alias rk='rake'
alias rkg='rake -g'
# Interpreters
alias rb='ruby'
alias rbe='rbenv'
alias be='bundle exec'
alias spec='rspec'
alias py='python'
alias pye='pyenv'
[ -e /Applications/love.app ] && alias love='/Applications/love.app/Contents/MacOS/love'
# Bash-only aliases
if [ -z "$ZSH_VERSION" ]; then
# Allow sudo with aliases
alias sudo='sudo '
alias ls='ls -G'
alias l='ls -o'
alias la='ls -AGFoh'
fi