helm/zsh/aliases
2014-08-13 01:19:03 -04:00

76 lines
1.5 KiB
Bash

#!/bin/zsh
# GIT
if command_exists 'git'; then
alias ga='git add'
alias gap='git add --patch'
alias gt='git tag'
alias gtl='git describe --tags --abbrev=0'
alias gcu='git reset --soft "HEAD^"'
git-move-root() {
git filter-branch --subdirectory-filter "$@" --prune-empty -- --all
}
fi
# Tmux
if command_exists '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 b='brew'
alias v='vim'
# Open file in emacs server; must be running!
alias e="emacsclient -n"
else
alias ipt='sudo iptables'
fi
# transmission-remote
if command_exists 'transmission-remote'; then
alias bt="transmission-remote server"
alias btl="bt -l"
alias bta="bt --add"
btr() { bt -t$1 -r }
bts() { bt -t$1 -S }
fi
alias va='vagrant'
# Interpreters
alias rbe='rbenv'
alias rb='ruby'
alias pye='pyenv'
alias py='python'
alias py3='python3'
[ -e /Applications/love.app ] && alias love="/Applications/love.app/Contents/MacOS/love"
# Shell conveniences
alias q='exit'
alias sha1='openssl sha1'
alias header='curl -I'
# Resume download if possible
alias wget='wget -c'
# Lets us sudo aliases
# alias sudo='sudo '
# Make a directory and change to it
function mkd { mkdir "$@" && cd "$@" }
alias c='clear'
alias r='noglob rake -g'
# vim:set ft=zsh: