helm/zsh/aliases

74 lines
1.4 KiB
Plaintext
Raw Normal View History

2013-03-16 10:31:51 -07:00
#############
# Aliases #
#############
2013-03-03 05:49:37 -08:00
2013-10-21 01:17:28 -07:00
command_exists "git" && source ~/.zsh/alias/git
command_exists "tmux" && source ~/.zsh/alias/tmux
command_exists "vagrant" && source ~/.zsh/alias/vagrant
2013-10-16 22:35:11 -07:00
# Interpreters
command_exists "ruby" && alias rb='ruby'
command_exists "python" && alias py='python'
command_exists "node" && alias js='node'
2013-10-21 01:17:28 -07:00
if is_mac && [ -e /Applications/love.app ]; then
2013-10-16 22:35:11 -07:00
alias love="/Applications/love.app/Contents/MacOS/love"
fi
2013-10-21 01:17:28 -07:00
# Shell conveniences
2013-08-01 23:38:33 -07:00
if is_mac; then
alias ls='ls -G'
else
alias ls='ls -G --color'
fi
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'
alias sha1='openssl sha1'
alias mkdir='mkdir -pv'
# Resume download if possible
alias wget='wget -c'
alias header='curl -I'
2013-03-23 01:29:56 -07:00
if is_linux; then
# iptables
alias ipt='sudo iptables'
elif is_mac; then
2013-10-01 15:02:32 -07:00
alias b='brew'
2013-03-22 11:49:23 -07:00
alias brewp='cd `brew --prefix`'
2013-10-18 03:40:12 -07:00
alias ql='quicklook'
2013-03-22 11:49:23 -07:00
fi
2013-03-23 01:29:56 -07:00
# vim
2013-07-31 09:10:08 -07:00
if [[ ! -n $SSH_CLIENT ]]; then
if command_exists mvim; then
alias v='mvim'
else
alias v='gvim'
fi
2013-03-23 01:29:56 -07:00
else
alias v='vim'
fi
2013-10-21 01:17:28 -07:00
# Text-editing niceties
# Replace
function repl {
sed $3 -e "s/${1/\//\\\/}/${2/\//\\\/}/g"
}
if command_exists "ag"; then
# Project-wide search 'n replace using the_silver_searcher:
# https://github.com/ggreer/the_silver_searcher
function agr {
ag -l "$1" | xargs repl "$1" "$2" -i
ag "$2"
}
fi
2013-03-22 18:10:59 -07:00
# vim:set ft=zsh: