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
|
|
|
|
# On top of oh-my-zsh's git aliases
|
2014-07-07 15:22:15 -07:00
|
|
|
alias git='noglob git'
|
2013-12-19 06:48:28 -08:00
|
|
|
alias gs='git status'
|
|
|
|
alias gst='git stash'
|
|
|
|
alias gap='git add -p'
|
|
|
|
alias gf='git ls-files | grep -i'
|
|
|
|
alias gt='git tag'
|
|
|
|
alias gtl='git describe --tags --abbrev=0'
|
2014-06-30 23:17:16 -07:00
|
|
|
alias gpb='git push origin'
|
2013-03-03 05:49:37 -08:00
|
|
|
|
2014-06-30 23:17:16 -07:00
|
|
|
function git-new-root {
|
|
|
|
git filter-branch --subdirectory-filter "$@" --prune-empty -- --all
|
|
|
|
}
|
2013-12-19 06:48:28 -08:00
|
|
|
# find oh-my-zsh's here: ~/.oh-my-zsh/plugins/git/git.plugin.zsh
|
|
|
|
fi
|
|
|
|
|
2014-07-17 01:26:38 -07:00
|
|
|
# OS-specific aliases
|
|
|
|
if is_linux; then
|
|
|
|
alias ipt='sudo iptables'
|
|
|
|
elif is_mac; then
|
|
|
|
alias b='brew'
|
|
|
|
alias ql='quicklook'
|
|
|
|
|
|
|
|
alias v='vim'
|
|
|
|
|
|
|
|
function o {
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
open .
|
|
|
|
else
|
|
|
|
open $@
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Open file in emacs daemon (will auto-start it)
|
|
|
|
function e {
|
|
|
|
macos=/Applications/Emacs.app/Contents/MacOS
|
|
|
|
if pgrep -qf 'Emacs.*--daemon'; then
|
|
|
|
args=-n
|
|
|
|
else
|
|
|
|
$macos/Emacs --daemon
|
|
|
|
args=-nc
|
|
|
|
fi
|
|
|
|
echo $args
|
|
|
|
emacsclient $args "$@"
|
|
|
|
}
|
|
|
|
alias es="emacsclient -e '(kill-emacs)'"
|
|
|
|
fi
|
|
|
|
|
2013-12-19 06:48:28 -08:00
|
|
|
# Tmux
|
2014-04-11 00:30:35 -07:00
|
|
|
command_exists 'tmux' && alias t='tmux -CC'
|
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-04-11 00:30:35 -07:00
|
|
|
function btr { bt -t$1 -r }
|
|
|
|
function bts { bt -t$1 -S }
|
2013-12-19 06:48:28 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
alias va='vagrant'
|
2013-10-16 22:35:11 -07:00
|
|
|
|
|
|
|
# Interpreters
|
2014-06-30 23:17:16 -07:00
|
|
|
command_exists "rbenv" && alias rbe='rbenv'
|
|
|
|
command_exists "ruby" && alias rb='ruby'
|
|
|
|
command_exists "pyenv" && alias pye='pyenv'
|
|
|
|
command_exists "python" && alias py='python'
|
|
|
|
command_exists "python3" && alias py3='python3'
|
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
|
2014-07-17 01:26:38 -07:00
|
|
|
alias ls='ls --color=auto'
|
2013-08-03 13:00:57 -07:00
|
|
|
alias l='ls -1'
|
2013-03-03 05:49:37 -08:00
|
|
|
alias ll='ls -l'
|
|
|
|
alias la='ls -la'
|
2013-03-16 11:29:46 -07:00
|
|
|
alias l.='ls -Ad .*'
|
|
|
|
alias du='du -h -d 1'
|
2013-03-17 19:49:25 -07:00
|
|
|
alias q='exit'
|
2013-10-26 08:49:13 -07:00
|
|
|
|
2013-03-22 18:12:07 -07:00
|
|
|
alias sha1='openssl sha1'
|
|
|
|
alias mkdir='mkdir -pv'
|
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
|
|
|
|
|
|
|
# Lets us sudo aliases
|
|
|
|
alias sudo='sudo '
|
2013-03-22 18:12:49 -07:00
|
|
|
|
2013-03-23 01:29:56 -07:00
|
|
|
|
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-03-29 14:56:33 -07:00
|
|
|
alias reload='exec $SHELL -l'
|
|
|
|
alias c='clear'
|
2014-06-18 20:44:07 -07:00
|
|
|
alias r='rake -g'
|
|
|
|
|
|
|
|
# Disable zsh glob syntax on the rake command
|
|
|
|
alias rake='noglob rake'
|
2013-10-21 01:17:28 -07:00
|
|
|
|
2013-03-22 18:10:59 -07:00
|
|
|
# vim:set ft=zsh:
|