helm/zsh/aliases

117 lines
2.1 KiB
Plaintext
Raw Normal View History

2013-12-19 06:48:28 -08:00
# GIT
if command_exists 'git'; then
# On top of oh-my-zsh's git aliases
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'
2013-03-03 05:49:37 -08:00
2013-12-19 06:48:28 -08:00
# find oh-my-zsh's here: ~/.oh-my-zsh/plugins/git/git.plugin.zsh
fi
# Tmux
command_exists 'tmux' && alias t='tmux'
# 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"
function btr {
bt -t$1 -r
}
fi
alias va='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-26 08:46:06 -07:00
if [ -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-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'
alias header='curl -I'
# Resume download if possible
alias wget='wget -c'
# Lets us sudo aliases
alias sudo='sudo '
2013-03-23 01:29:56 -07:00
if is_linux; then
alias ls='ls --color'
2013-03-23 01:29:56 -07:00
# iptables
alias ipt='sudo iptables'
function v {
if [ $# -eq 0 ]; then
vim .
else
vim "$@"
fi
}
2013-03-23 01:29:56 -07:00
elif is_mac; then
alias ls='ls -G'
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
function o {
if [ $# -eq 0 ]; then
open .
else
open "$@"
fi
}
function v {
if [ $# -eq 0 ]; then
2013-12-17 02:42:35 -08:00
mvim .
else
2013-12-17 02:42:35 -08:00
mvim "$@"
fi
}
2013-03-23 01:29:56 -07:00
fi
# Make a directory and change to it
function mkd {
mkdir "$@" && cd "$@"
}
2013-10-21 01:17:28 -07:00
# Meant for string search-and-replace via stdin
2013-10-21 01:17:28 -07:00
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: