From b1ec241cac0435af4ed16c9c8cd12d8a012c85b1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 17 Oct 2013 01:35:11 -0400 Subject: [PATCH] Modularize & clean up aliases --- zsh/alias/git | 9 +++++++++ zsh/alias/tmux | 7 +++++++ zsh/alias/vagrant | 3 +++ zsh/aliases | 50 ++++++++++++++--------------------------------- 4 files changed, 34 insertions(+), 35 deletions(-) create mode 100644 zsh/alias/git create mode 100644 zsh/alias/tmux create mode 100644 zsh/alias/vagrant diff --git a/zsh/alias/git b/zsh/alias/git new file mode 100644 index 00000000..264938fc --- /dev/null +++ b/zsh/alias/git @@ -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' diff --git a/zsh/alias/tmux b/zsh/alias/tmux new file mode 100644 index 00000000..a8e71080 --- /dev/null +++ b/zsh/alias/tmux @@ -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' diff --git a/zsh/alias/vagrant b/zsh/alias/vagrant new file mode 100644 index 00000000..9dd7f23c --- /dev/null +++ b/zsh/alias/vagrant @@ -0,0 +1,3 @@ + +# vagrant +alias va='vagrant' diff --git a/zsh/aliases b/zsh/aliases index 6f3146c9..e66da478 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -2,6 +2,20 @@ # 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 alias ls='ls -G' else @@ -17,46 +31,15 @@ alias sha1='openssl sha1' alias mkdir='mkdir -pv' # Resume download if possible 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' -# directory shortcuts -alias dot='cd ~/.dotfiles' - if is_linux; then # iptables alias ipt='sudo iptables' elif is_mac; then alias b='brew' alias brewp='cd `brew --prefix`' + alias ql='quick-look' fi # vim @@ -70,7 +53,4 @@ else alias v='vim' fi -# vagrant -alias va='vagrant' - # vim:set ft=zsh: