Modularize & clean up aliases

This commit is contained in:
Henrik Lissner 2013-10-17 01:35:11 -04:00
parent 1b90afec37
commit b1ec241cac
4 changed files with 34 additions and 35 deletions

9
zsh/alias/git Normal file
View file

@ -0,0 +1,9 @@
# git
# 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'

7
zsh/alias/tmux Normal file
View file

@ -0,0 +1,7 @@
# tmux
alias t='tmux'
alias tn='tmux new -s'
alias ta='tmux attach -t'
alias tl='tmux list-sessions'
alias td='tmux detach'

3
zsh/alias/vagrant Normal file
View file

@ -0,0 +1,3 @@
# vagrant
alias va='vagrant'

View file

@ -2,6 +2,20 @@
# Aliases # # Aliases #
############# #############
RELPATH=$(dirname "$0")
command_exists "git" && source $RELPATH/alias/git
command_exists "tmux" && source $RELPATH/alias/tmux
command_exists "vagrant" && source $RELPATH/alias/vagrant
# Interpreters
command_exists "ruby" && alias rb='ruby'
command_exists "python" && alias py='python'
command_exists "node" && alias js='node'
if is_mac && [ -e /Applications/love.app/Contents/MacOS/love ]; then
alias love="/Applications/love.app/Contents/MacOS/love"
fi
if is_mac; then if is_mac; then
alias ls='ls -G' alias ls='ls -G'
else else
@ -17,46 +31,15 @@ alias sha1='openssl sha1'
alias mkdir='mkdir -pv' alias mkdir='mkdir -pv'
# Resume download if possible # Resume download if possible
alias wget='wget -c' alias wget='wget -c'
alias rb='ruby'
alias py='python'
alias js='node'
if is_mac; then
alias love="/Applications/love.app/Contents/MacOS/love"
fi
# tmux
alias t='tmux'
alias tn='tmux new -s'
alias ta='tmux attach -t'
alias tl='tmux list-sessions'
alias td='tmux detach'
# git
# 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'
# Laravel
alias artisan='php artisan'
alias bob='php artisan bob::build'
# debug
alias header='curl -I' alias header='curl -I'
# directory shortcuts
alias dot='cd ~/.dotfiles'
if is_linux; then if is_linux; then
# iptables # iptables
alias ipt='sudo iptables' alias ipt='sudo iptables'
elif is_mac; then elif is_mac; then
alias b='brew' alias b='brew'
alias brewp='cd `brew --prefix`' alias brewp='cd `brew --prefix`'
alias ql='quick-look'
fi fi
# vim # vim
@ -70,7 +53,4 @@ else
alias v='vim' alias v='vim'
fi fi
# vagrant
alias va='vagrant'
# vim:set ft=zsh: # vim:set ft=zsh: