2014-07-17 01:26:38 -07:00
|
|
|
#!/bin/zsh
|
2014-03-17 14:25:17 -07:00
|
|
|
|
2013-12-19 06:48:28 -08:00
|
|
|
# GIT
|
|
|
|
if command_exists 'git'; then
|
2014-08-21 00:27:32 -07:00
|
|
|
alias gi='git init'
|
2014-07-29 02:24:29 -07:00
|
|
|
alias ga='git add'
|
|
|
|
alias gap='git add --patch'
|
2013-12-19 06:48:28 -08:00
|
|
|
alias gt='git tag'
|
|
|
|
alias gtl='git describe --tags --abbrev=0'
|
2013-03-03 05:49:37 -08:00
|
|
|
|
2014-07-29 02:24:29 -07:00
|
|
|
git-move-root() {
|
2014-06-30 23:17:16 -07:00
|
|
|
git filter-branch --subdirectory-filter "$@" --prune-empty -- --all
|
|
|
|
}
|
2014-08-21 00:27:32 -07:00
|
|
|
|
|
|
|
git-undo-commit() {
|
|
|
|
git reset --soft "HEAD^"
|
|
|
|
}
|
2013-12-19 06:48:28 -08:00
|
|
|
fi
|
|
|
|
|
2014-08-12 22:19:03 -07:00
|
|
|
# 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
|
|
|
|
}
|
2014-08-21 00:27:32 -07:00
|
|
|
|
|
|
|
if command_exists 'irssi'; then
|
|
|
|
function tmux-irssi-nickpane {
|
|
|
|
tmux renamew irssi # name the window
|
|
|
|
tmux -q setw main-pane-width $(( $(tput cols) - 21)) # set the main pane width to the total width-20
|
|
|
|
tmux splitw -v "cat ~/.irssi/nicklistfifo" # create the window and begin reading the fifo
|
|
|
|
tmux -q selectl main-vertical # assign the layout
|
|
|
|
tmux selectw -t irssi # select window 'irssi'
|
|
|
|
tmux selectp -t 0 # select pane 0
|
|
|
|
}
|
|
|
|
|
|
|
|
function tmux-irssi {
|
|
|
|
tmux-irssi-nickpane
|
|
|
|
$(which irssi) # launch irssi
|
|
|
|
}
|
|
|
|
|
|
|
|
# repair running irssi's nicklist pane
|
|
|
|
function tmux-irssi-repair() {
|
|
|
|
tmux selectw -t irssi
|
|
|
|
tmux selectp -t 0
|
|
|
|
tmux killp -a # kill all panes
|
|
|
|
irssi_nickpane
|
|
|
|
}
|
|
|
|
fi
|
2014-08-12 22:19:03 -07:00
|
|
|
fi
|
|
|
|
|
2014-07-17 01:26:38 -07:00
|
|
|
# OS-specific aliases
|
2014-07-29 16:03:03 -07:00
|
|
|
if [[ "$OSTYPE" == darwin* ]]; then
|
2014-08-24 03:31:58 -07:00
|
|
|
alias codekit='open -a CodeKit'
|
2014-07-17 01:26:38 -07:00
|
|
|
alias b='brew'
|
|
|
|
alias v='vim'
|
2014-07-18 15:57:25 -07:00
|
|
|
# Open file in emacs server; must be running!
|
|
|
|
alias e="emacsclient -n"
|
2014-07-29 02:24:29 -07:00
|
|
|
else
|
|
|
|
alias ipt='sudo iptables'
|
2014-07-17 01:26:38 -07:00
|
|
|
fi
|
|
|
|
|
2013-12-19 06:48:28 -08:00
|
|
|
# transmission-remote
|
|
|
|
if command_exists 'transmission-remote'; then
|
2013-12-20 11:32:29 -08:00
|
|
|
alias bt="transmission-remote server"
|
2013-12-19 06:48:28 -08:00
|
|
|
alias btl="bt -l"
|
|
|
|
alias bta="bt --add"
|
|
|
|
|
2014-07-21 00:07:34 -07:00
|
|
|
btr() { bt -t$1 -r }
|
|
|
|
bts() { bt -t$1 -S }
|
2013-12-19 06:48:28 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
alias va='vagrant'
|
2014-08-21 00:27:32 -07:00
|
|
|
alias r='noglob rake -g'
|
2013-10-16 22:35:11 -07:00
|
|
|
|
|
|
|
# Interpreters
|
2014-07-29 02:24:29 -07:00
|
|
|
alias rbe='rbenv'
|
|
|
|
alias rb='ruby'
|
|
|
|
alias pye='pyenv'
|
|
|
|
alias py='python'
|
|
|
|
alias py3='python3'
|
2014-08-24 03:31:58 -07:00
|
|
|
alias be='bundle exec'
|
2014-04-11 00:30:35 -07:00
|
|
|
[ -e /Applications/love.app ] && alias love="/Applications/love.app/Contents/MacOS/love"
|
2013-10-16 22:35:11 -07:00
|
|
|
|
2013-10-21 01:17:28 -07:00
|
|
|
# Shell conveniences
|
2013-03-22 18:12:07 -07:00
|
|
|
alias sha1='openssl sha1'
|
2013-10-26 08:49:13 -07:00
|
|
|
alias header='curl -I'
|
2013-03-22 18:12:07 -07:00
|
|
|
# Resume download if possible
|
|
|
|
alias wget='wget -c'
|
2013-10-26 08:49:13 -07:00
|
|
|
|
|
|
|
# Make a directory and change to it
|
2014-04-11 00:30:35 -07:00
|
|
|
function mkd { mkdir "$@" && cd "$@" }
|
2013-10-21 01:17:28 -07:00
|
|
|
|
2014-08-21 00:27:32 -07:00
|
|
|
alias qq='exit'
|
|
|
|
alias cc='clear'
|
2014-06-18 20:44:07 -07:00
|
|
|
|
2013-03-22 18:10:59 -07:00
|
|
|
# vim:set ft=zsh:
|