2014-07-17 01:26:38 -07:00
|
|
|
#!/bin/zsh
|
2014-03-17 14:25:17 -07:00
|
|
|
|
2015-01-20 00:00:13 -08:00
|
|
|
export p=~/Dropbox/projects
|
2013-12-19 06:48:28 -08:00
|
|
|
|
2015-01-20 00:00:13 -08:00
|
|
|
alias q=exit
|
|
|
|
alias clr=clear
|
|
|
|
alias sudo='sudo '
|
|
|
|
|
|
|
|
# Homebrew
|
|
|
|
alias br='brew'
|
|
|
|
alias bru='brew update'
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
alias codekit='open -a CodeKit'
|
2014-09-20 13:38:40 -07:00
|
|
|
alias ag='nocorrect noglob ag'
|
|
|
|
alias rk='noglob rake'
|
|
|
|
alias rkg='noglob rake -g'
|
2015-01-20 00:00:13 -08:00
|
|
|
alias ln="${aliases[ln]:-ln} -v" # Verbose ln
|
|
|
|
alias wget='wget -c' # Resume dl if possible
|
|
|
|
alias rsyncd='rsync -va --delete' # Hard sync two directories
|
|
|
|
zman() { PAGER="less -g -s '+/^ "$1"'" man zshall; }
|
2014-09-05 13:55:50 -07:00
|
|
|
|
2015-01-20 00:00:13 -08:00
|
|
|
# transmission-remote
|
|
|
|
if is-callable 'transmission-remote'; then
|
|
|
|
alias bt='transmission-remote server'
|
|
|
|
|
|
|
|
# pretty print torrent list on remote server
|
|
|
|
function btl {
|
|
|
|
results=`transmission-remote server -l | \
|
|
|
|
awk 'NR > 1 { s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print $9 " | " s }' | \
|
|
|
|
sed '$d' | \
|
|
|
|
perl -pe 's/\s\[[a-zA-Z0-9]+\]\s/ /g'`
|
2014-10-09 15:31:34 -07:00
|
|
|
|
2015-01-20 00:00:13 -08:00
|
|
|
if [ -z "$results" ]; then
|
|
|
|
echo "No torrents!"
|
|
|
|
else
|
|
|
|
echo $results
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Editors
|
|
|
|
unalias e
|
|
|
|
v() { [ $# -eq 0 ] && vim . || vim $@ }
|
|
|
|
e() { # emacs
|
|
|
|
[ $# -eq 0 ] && input=$@
|
|
|
|
emacsclient -n ${input:-.}
|
2014-09-05 13:55:50 -07:00
|
|
|
}
|
2015-01-20 00:00:13 -08:00
|
|
|
|
|
|
|
# Compilers 'n interpretors
|
|
|
|
alias va='vagrant'
|
|
|
|
alias py='python'
|
|
|
|
alias pye='pyenv'
|
|
|
|
alias pip='sudo pip'
|
|
|
|
alias rb='ruby'
|
|
|
|
alias rbe='rbenv'
|
|
|
|
alias b='bundle'
|
|
|
|
alias be='bundle exec'
|
|
|
|
alias bi='bundle install -path vendor'
|
|
|
|
|
|
|
|
alias c11='clang++ -std=c++11 -stdlib=libc++'
|
|
|
|
alias eclimd='/Applications/eclipse/eclimd'
|
|
|
|
|
|
|
|
# GIT
|
|
|
|
is-callable 'hub' && alias git='hub'
|
|
|
|
g() { [ $# -eq 0 ] && git status --short || git $* }
|
|
|
|
|
|
|
|
alias gi='git init'
|
|
|
|
alias gs='git status'
|
|
|
|
alias gco='git checkout'
|
|
|
|
alias gc='git commit'
|
|
|
|
alias gcm='noglob git commit -m'
|
|
|
|
alias gc='git diff'
|
|
|
|
alias gp='git push'
|
|
|
|
alias gl='git pull'
|
|
|
|
alias ga='git add'
|
|
|
|
alias gb='git branch'
|
|
|
|
alias gap='git add --patch'
|
|
|
|
alias gr='git reset "HEAD^"'
|
|
|
|
|
|
|
|
# Tmux
|
|
|
|
if is-callable 'tmux'; then
|
|
|
|
alias t='tmux'
|
|
|
|
alias ts='tmux send-keys'
|
|
|
|
alias tl='tmux ls'
|
|
|
|
|
|
|
|
# Start new session or create a grouped session so I'm not simply watching
|
|
|
|
# the same session in both windows.
|
|
|
|
alias ta='tmux new -s $(hostname) || tmux new -t $(hostname) -s $(hostname)-2 || tmux attach -t "io-2"'
|
|
|
|
|
|
|
|
# New instance attached to old session
|
|
|
|
alias tn='tmux new-session -t $(hostname)'
|
|
|
|
fi
|