587832f15579398e54690e62ea588178e951f8f8

Author
Peter Tillemans <pti@snamellit.com>
Committer
Peter Tillemans <pti@snamellit.com>
Date

Message

Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh

Diff

This diff is truncated to protect this page.

   1diff --git a/README.textile b/README.textile
   2index a38e2d7cf83748f562590b4eb9383a827bc8d16f..0a4545bac277459e010242a976c097601d063979 100644
   3--- a/README.textile
   4+++ b/README.textile
   5@@ -26,17 +26,20 @@ h3. The manual way
   6 
   7   @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
   8 
   9-2. Create a new zsh config by copying the zsh template we've provided.
  10+2. *OPTIONAL* Backup your existing ~/.zshrc file
  11 
  12-  *NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings.
  13+  @cp ~/.zshrc ~/.zshrc.orig@
  14+
  15+3. Create a new zsh config by copying the zsh template we've provided.
  16 
  17   @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
  18 
  19-3. Set zsh as your default shell:
  20+
  21+4. Set zsh as your default shell:
  22 
  23   @chsh -s /bin/zsh@
  24 
  25-4. Start / restart zsh (open a new terminal is easy enough...)
  26+5. Start / restart zsh (open a new terminal is easy enough...)
  27 
  28 h3. Problems?
  29 
  30diff --git a/lib/aliases.zsh b/lib/aliases.zsh
  31index 0555be2642fcd73e6d4ced8bc44e7eee75e13607..a7f699c19f1ad76390e3b0be8cfafd81c521ca05 100644
  32--- a/lib/aliases.zsh
  33+++ b/lib/aliases.zsh
  34@@ -8,6 +8,7 @@ alias -- -='cd -'
  35 
  36 # Super user
  37 alias _='sudo'
  38+alias please='sudo'
  39 
  40 #alias g='grep -in'
  41 
  42@@ -16,8 +17,9 @@ alias history='fc -l 1'
  43 
  44 # List direcory contents
  45 alias lsa='ls -lah'
  46-alias l='ls -la'
  47+alias l='ls -lA1'
  48 alias ll='ls -l'
  49+alias la='ls -lA'
  50 alias sl=ls # often screw this up
  51 
  52 alias afind='ack-grep -il'
  53diff --git a/lib/completion.zsh b/lib/completion.zsh
  54index f31e101d5d2c9ad441af6468b8327b0c675997c8..ba839a067c81085e283c71cbd4ee4ead3c5a4727 100644
  55--- a/lib/completion.zsh
  56+++ b/lib/completion.zsh
  57@@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
  58 cdpath=(.)
  59 
  60 # use /etc/hosts and known_hosts for hostname completion
  61-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  62+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
  63 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  64 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
  65 hosts=(
  66diff --git a/lib/directories.zsh b/lib/directories.zsh
  67index a787db9ebda2664163bebd1a42ce4727801eef61..6c743e40ec943bbe3f188e187752e584c3bfa2db 100644
  68--- a/lib/directories.zsh
  69+++ b/lib/directories.zsh
  70@@ -26,9 +26,9 @@ cd () {
  71   elif [[ "x$*" == "x...." ]]; then
  72     cd ../../..
  73   elif [[ "x$*" == "x....." ]]; then
  74-    cd ../../..
  75-  elif [[ "x$*" == "x......" ]]; then
  76     cd ../../../..
  77+  elif [[ "x$*" == "x......" ]]; then
  78+    cd ../../../../..
  79   else
  80     builtin cd "$@"
  81   fi
  82@@ -37,8 +37,3 @@ cd () {
  83 alias md='mkdir -p'
  84 alias rd=rmdir
  85 alias d='dirs -v | head -10'
  86-
  87-# mkdir & cd to it
  88-function mcd() { 
  89-  mkdir -p "$1" && cd "$1"; 
  90-}
  91diff --git a/lib/functions.zsh b/lib/functions.zsh
  92index d2dcadd0cb4d7235c8876556eb863140c315df12..63ab755cf72b1094975ef017cd71727c756e1943 100644
  93--- a/lib/functions.zsh
  94+++ b/lib/functions.zsh
  95@@ -1,5 +1,5 @@
  96 function zsh_stats() {
  97-  history | awk '{print $2}' | sort | uniq -c | sort -rn | head
  98+  history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n20
  99 }
 100 
 101 function uninstall_oh_my_zsh() {
 102diff --git a/lib/git.zsh b/lib/git.zsh
 103index fb4ad8ca64ffbf7bcfd34ca82b1acbe8947d36bf..b1dfce3575489d10d007ad3970d5b469f26cfad8 100644
 104--- a/lib/git.zsh
 105+++ b/lib/git.zsh
 106@@ -1,6 +1,7 @@
 107 # get the name of the branch we are on
 108 function git_prompt_info() {
 109-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
 110+  ref=$(git symbolic-ref HEAD 2> /dev/null) || \
 111+  ref=$(git rev-parse --short HEAD 2> /dev/null) || return
 112   echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
 113 }
 114 
 115@@ -18,6 +19,25 @@ parse_git_dirty() {
 116   fi
 117 }
 118 
 119+# get the difference between the local and remote branches
 120+git_remote_status() {
 121+    remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
 122+    if [[ -n ${remote} ]] ; then
 123+        ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
 124+        behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
 125+
 126+        if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
 127+        then
 128+            echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
 129+        elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
 130+        then
 131+            echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
 132+        elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
 133+        then
 134+            echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
 135+        fi
 136+    fi
 137+}
 138 
 139 # Checks if there are commits ahead from remote
 140 function git_prompt_ahead() {
 141@@ -38,7 +58,7 @@ function git_prompt_long_sha() {
 142 
 143 # Get the status of the working tree
 144 git_prompt_status() {
 145-  INDEX=$(git status --porcelain 2> /dev/null)
 146+  INDEX=$(git status --porcelain -b 2> /dev/null)
 147   STATUS=""
 148   if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
 149     STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
 150@@ -60,18 +80,32 @@ git_prompt_status() {
 151   fi
 152   if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
 153     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 154+  elif $(echo "$INDEX" | grep '^D  ' &> /dev/null); then
 155+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 156   elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
 157     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 158   fi
 159+  if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
 160+    STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
 161+  fi
 162   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
 163     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
 164   fi
 165+  if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
 166+    STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
 167+  fi
 168+  if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
 169+    STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
 170+  fi
 171+  if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
 172+    STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
 173+  fi
 174   echo $STATUS
 175 }
 176 
 177 #compare the provided version of git to the version installed and on path
 178 #prints 1 if input version <= installed version
 179-#prints -1 otherwise 
 180+#prints -1 otherwise
 181 function git_compare_version() {
 182   local INPUT_GIT_VERSION=$1;
 183   local INSTALLED_GIT_VERSION
 184diff --git a/lib/misc.zsh b/lib/misc.zsh
 185index 0f7e7e9254959f01d6186c16f147764e9645e8b2..a8678b8ecd0185d66500e79bab39224676def2a6 100644
 186--- a/lib/misc.zsh
 187+++ b/lib/misc.zsh
 188@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
 189 setopt long_list_jobs
 190 
 191 ## pager
 192-export PAGER="less -R"
 193+export PAGER="less"
 194+export LESS="-R"
 195+
 196 export LC_CTYPE=$LANG
 197diff --git a/lib/rvm.zsh b/lib/rvm.zsh
 198index cb870a9bbca96bfa1f3a1d795510daf1ef7c63b4..e8744e61e373799201c3d55f4777f47be8728135 100644
 199--- a/lib/rvm.zsh
 200+++ b/lib/rvm.zsh
 201@@ -1,5 +1,8 @@
 202-# get the name of the branch we are on
 203+# get the name of the ruby version
 204 function rvm_prompt_info() {
 205-  ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
 206-  [[ ! -z $ruby_version ]] && echo "($ruby_version)"
 207+  [ -f $HOME/.rvm/bin/rvm-prompt ] || return
 208+  local rvm_prompt
 209+  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
 210+  [[ "${rvm_prompt}x" == "x" ]] && return
 211+  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 212 }
 213diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 214index e26fef6d30d8a3f46e1fa4862c20626815743891..c056989eb5a49df87a69f343362f11adb545acfb 100644
 215--- a/lib/termsupport.zsh
 216+++ b/lib/termsupport.zsh
 217@@ -26,8 +26,8 @@ function omz_termsupport_precmd {
 218 function omz_termsupport_preexec {
 219   emulate -L zsh
 220   setopt extended_glob
 221-  local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 222-  title "$CMD" "%100>...>$2%<<"
 223+  local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 224+  title "$CMD" "%100>...>${2:gs/%/%%}%<<"
 225 }
 226 
 227 autoload -U add-zsh-hook
 228diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 229index ddef1ad6cf280b2c4ce53af32a77f8e493bab7fc..689a79feffe989472c5b4aa76117a746f4e696c8 100644
 230--- a/oh-my-zsh.sh
 231+++ b/oh-my-zsh.sh
 232@@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
 233 
 234 # Load all of the config files in ~/oh-my-zsh that end in .zsh
 235 # TIP: Add files you don't want in git to .gitignore
 236-for config_file ($ZSH/lib/*.zsh) source $config_file
 237+for config_file ($ZSH/lib/*.zsh); do
 238+  source $config_file
 239+done
 240 
 241 # Set ZSH_CUSTOM to the path where your custom config files
 242 # and plugins exists, or else we will use the default custom/
 243@@ -51,7 +53,10 @@ for plugin ($plugins); do
 244 done
 245 
 246 # Load all of your custom configurations from custom/
 247-for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
 248+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
 249+  source $config_file
 250+done
 251+unset config_file
 252 
 253 # Load the theme
 254 if [ "$ZSH_THEME" = "random" ]
 255diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
 256index 294dc5354cce12627ab52e0d0d69f45ec9859131..ae92a0b4c5913ee7b7074f48b9cb283b5c437992 100644
 257--- a/plugins/archlinux/archlinux.plugin.zsh
 258+++ b/plugins/archlinux/archlinux.plugin.zsh
 259@@ -11,7 +11,7 @@ if [[ -x `which yaourt` ]]; then
 260   alias yaupg='yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
 261   alias yasu='yaourt --sucre'      # Same as yaupg, but without confirmation
 262   alias yain='yaourt -S'           # Install specific package(s) from the repositories
 263-  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file 
 264+  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file
 265   alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
 266   alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
 267   alias yarep='yaourt -Si'         # Display information about a given package in the repositories
 268@@ -35,7 +35,7 @@ fi
 269 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
 270 alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
 271 alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
 272-alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file 
 273+alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file
 274 alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
 275 alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
 276 alias pacrep='pacman -Si'              # Display information about a given package in the repositories
 277@@ -75,3 +75,19 @@ pacdisowned() {
 278 
 279   comm -23 "$fs" "$db"
 280 }
 281+
 282+pacmanallkeys() {
 283+  # Get all keys for developers and trusted users
 284+  curl https://www.archlinux.org/{developers,trustedusers}/ |
 285+  awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
 286+  xargs sudo pacman-key --recv-keys
 287+}
 288+
 289+pacmansignkeys() {
 290+  for key in $*; do
 291+    sudo pacman-key --recv-keys $key
 292+    sudo pacman-key --lsign-key $key
 293+    printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
 294+      --no-permission-warning --command-fd 0 --edit-key $key
 295+  done
 296+}
 297diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
 298index d367863b86f2baff8892278b06259370e0f02164..3894ccd2f56c392f004327a5931b6b6a327b02b3 100644
 299--- a/plugins/autojump/autojump.plugin.zsh
 300+++ b/plugins/autojump/autojump.plugin.zsh
 301@@ -3,9 +3,11 @@ if [ $commands[autojump] ]; then # check if autojump is installed
 302     . /usr/share/autojump/autojump.zsh
 303   elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
 304     . /etc/profile.d/autojump.zsh
 305+  elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
 306+    . $HOME/.autojump/etc/profile.d/autojump.zsh
 307   elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
 308     . /opt/local/etc/profile.d/autojump.zsh
 309-  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
 310-    . `brew --prefix`/etc/autojump
 311+  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
 312+    . `brew --prefix`/etc/autojump.zsh
 313   fi
 314 fi
 315diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
 316index bc75c5cf9ad01bd58ef29c4d83782ce5a849baff..95f8906321a948c4d0228c6ba0f580cd67556d73 100644
 317--- a/plugins/battery/battery.plugin.zsh
 318+++ b/plugins/battery/battery.plugin.zsh
 319@@ -1,20 +1,71 @@
 320-if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
 321-  function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
 322-  function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
 323-  function battery_pct_prompt() {
 324-    b=$(battery_pct_remaining)
 325-    if [ $b -gt 50 ] ; then
 326-      color='green'
 327-    elif [ $b -gt 20 ] ; then
 328-      color='yellow'
 329+###########################################
 330+# Battery plugin for oh-my-zsh            #
 331+# Original Author: Peter hoeg (peterhoeg) #
 332+# Email: peter@speartail.com              #
 333+###########################################
 334+# Author: Sean Jones (neuralsandwich)     #
 335+# Email: neuralsandwich@gmail.com         #
 336+# Modified to add support for Apple Mac   #
 337+###########################################
 338+
 339+if [[ $(uname) == "Darwin" ]] ; then
 340+
 341+  function battery_pct_remaining() {
 342+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
 343+      typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
 344+      typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
 345+      integer i=$(((currentcapacity/maxcapacity) * 100))
 346+      echo $i
 347     else
 348-      color='red'
 349+      echo "External Power"
 350     fi
 351-    echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
 352   }
 353-else
 354-  error_msg='no battery'
 355-  function battery_pct_remaining() { echo $error_msg }
 356-  function battery_time_remaining() { echo $error_msg }
 357-  function battery_pct_prompt() { echo '' }
 358+
 359+  function battery_time_remaining() {
 360+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
 361+      timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
 362+      echo "~$((timeremaining / 60)):$((timeremaining % 60))"
 363+    else
 364+      echo "∞"
 365+    fi
 366+  }
 367+
 368+  function battery_pct_prompt () {
 369+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
 370+      b=$(battery_pct_remaining)
 371+      if [ $b -gt 50 ] ; then
 372+        color='green'
 373+      elif [ $b -gt 20 ] ; then
 374+        color='yellow'
 375+      else
 376+        color='red'
 377+      fi
 378+      echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
 379+    else
 380+      echo ""
 381+    fi
 382+  }
 383+
 384+elif [[ $(uname) == "Linux"  ]] ; then
 385+
 386+  if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
 387+    function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
 388+    function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
 389+    function battery_pct_prompt() {
 390+      b=$(battery_pct_remaining)
 391+      if [ $b -gt 50 ] ; then
 392+        color='green'
 393+      elif [ $b -gt 20 ] ; then
 394+        color='yellow'
 395+      else
 396+        color='red'
 397+      fi
 398+      echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
 399+    }
 400+  else
 401+    error_msg='no battery'
 402+    function battery_pct_remaining() { echo $error_msg }
 403+    function battery_time_remaining() { echo $error_msg }
 404+    function battery_pct_prompt() { echo '' }
 405+  fi
 406 fi
 407diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 408index 2305c49796f58b4ae2e5b79943245f83b0e06448..10c221acd5bcc38cac0caf8a8b2cacfe7fe9fd9f 100644
 409--- a/plugins/bundler/bundler.plugin.zsh
 410+++ b/plugins/bundler/bundler.plugin.zsh
 411@@ -6,7 +6,7 @@ alias bu="bundle update"
 412 
 413 # The following is based on https://github.com/gma/bundler-exec
 414 
 415-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
 416+bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus)
 417 
 418 ## Functions
 419 
 420@@ -33,6 +33,7 @@ _run-with-bundler() {
 421 
 422 ## Main program
 423 for cmd in $bundled_commands; do
 424+  eval "function unbundled_$cmd () { $cmd \$@ }"
 425   eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
 426   alias $cmd=bundled_$cmd
 427 
 428diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh
 429new file mode 100644
 430index 0000000000000000000000000000000000000000..455da862151d56f299dbd3923e09b28dc73895f0
 431--- /dev/null
 432+++ b/plugins/bwana/bwana.plugin.zsh
 433@@ -0,0 +1,13 @@
 434+#
 435+# Requires http://www.bruji.com/bwana/
 436+#
 437+if [[ -e /Applications/Bwana.app ]] ||
 438+    ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
 439+then
 440+  function man() {
 441+    open "man:$1"
 442+  }
 443+else
 444+  echo "Bwana lets you read man files in Safari through a man: URI scheme" 
 445+  echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
 446+fi
 447diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh
 448deleted file mode 100644
 449index d22d104017ecdddad5b670d1188140e6c39f2672..0000000000000000000000000000000000000000
 450--- a/plugins/cap/cap.plugin.zsh
 451+++ /dev/null
 452@@ -1,41 +0,0 @@
 453-stat -f%m . > /dev/null 2>&1
 454-if [ "$?" = 0 ]; then
 455-  stat_cmd=(stat -f%m)
 456-else
 457-  stat_cmd=(stat -L --format=%y)
 458-fi
 459-
 460-# Cache filename
 461-_cap_show_undescribed_tasks=0
 462-
 463-# Cache filename
 464-_cap_task_cache_file='.cap_task_cache'
 465-
 466-_cap_get_task_list () {
 467-  if [ ${_cap_show_undescribed_tasks} -eq 0 ]; then
 468-    cap -T | grep '^cap' | cut -d " " -f 2
 469-  else
 470-    cap -vT | grep '^cap' | cut -d " " -f 2
 471-  fi
 472-}
 473-
 474-_cap_does_task_list_need_generating () {
 475-
 476-  if [ ! -f ${_cap_task_cache_file} ]; then return 0;
 477-  else
 478-    accurate=$($stat_cmd $_cap_task_cache_file)
 479-    changed=$($stat_cmd config/deploy.rb)
 480-    return $(expr $accurate '>=' $changed)
 481-  fi
 482-}
 483-
 484-function _cap () {
 485-  if [ -f config/deploy.rb ]; then
 486-    if _cap_does_task_list_need_generating; then
 487-      _cap_get_task_list > ${_cap_task_cache_file}
 488-    fi
 489-    compadd `cat ${_cap_task_cache_file}`
 490-  fi
 491-}
 492-
 493-compdef _cap cap
 494diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano
 495new file mode 100644
 496index 0000000000000000000000000000000000000000..cf6b50c7f9b62cd5d499352e5520cc43bcd9c2b5
 497--- /dev/null
 498+++ b/plugins/capistrano/_capistrano
 499@@ -0,0 +1,10 @@
 500+#compdef cap
 501+#autoload
 502+
 503+if [ -f config/deploy.rb ]; then
 504+  if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
 505+    echo "\nGenerating .cap_tasks~..." > /dev/stderr
 506+    cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
 507+  fi
 508+  compadd `cat .cap_tasks~`
 509+fi
 510diff --git a/plugins/coffee/_coffee b/plugins/coffee/_coffee
 511new file mode 100644
 512index 0000000000000000000000000000000000000000..5c8eb9a084050bf740c12992af8b609cb99a104c
 513--- /dev/null
 514+++ b/plugins/coffee/_coffee
 515@@ -0,0 +1,71 @@
 516+#compdef coffee
 517+# ------------------------------------------------------------------------------
 518+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
 519+# All rights reserved.
 520+#
 521+# Redistribution and use in source and binary forms, with or without
 522+# modification, are permitted provided that the following conditions are met:
 523+#     * Redistributions of source code must retain the above copyright
 524+#       notice, this list of conditions and the following disclaimer.
 525+#     * Redistributions in binary form must reproduce the above copyright
 526+#       notice, this list of conditions and the following disclaimer in the
 527+#       documentation and/or other materials provided with the distribution.
 528+#     * Neither the name of the zsh-users nor the
 529+#       names of its contributors may be used to endorse or promote products
 530+#       derived from this software without specific prior written permission.
 531+#
 532+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 533+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 534+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 535+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
 536+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 537+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 538+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 539+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 540+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 541+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 542+# ------------------------------------------------------------------------------
 543+# Description
 544+# -----------
 545+#
 546+#  Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
 547+#
 548+# ------------------------------------------------------------------------------
 549+# Authors
 550+# -------
 551+#
 552+#  * Mario Fernandez (https://github.com/sirech)
 553+#
 554+# ------------------------------------------------------------------------------
 555+
 556+local curcontext="$curcontext" state line ret=1
 557+typeset -A opt_args
 558+
 559+_arguments -C \
 560+  '(- *)'{-h,--help}'[display this help message]' \
 561+  '(- *)'{-v,--version}'[display the version number]' \
 562+  '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
 563+  '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
 564+  '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
 565+  '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
 566+  '(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
 567+  '(--nodejs)--nodejs[pass options directly to the "node" binary]' \
 568+  '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
 569+  '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
 570+  '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
 571+  '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
 572+  '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
 573+  '(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
 574+  '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
 575+  '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
 576+  '*:script or directory:_files' && ret=0
 577+
 578+return ret
 579+
 580+# Local Variables:
 581+# mode: Shell-Script
 582+# sh-indentation: 2
 583+# indent-tabs-mode: nil
 584+# sh-basic-offset: 2
 585+# End:
 586+# vim: ft=zsh sw=2 ts=2 et
 587diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
 588index 5ab03d5a9a57c3ff3f46a9ae881e6bb1643becbd..567da1b450014b4db7b5445bf564973b76c1afea 100644
 589--- a/plugins/command-not-found/command-not-found.plugin.zsh
 590+++ b/plugins/command-not-found/command-not-found.plugin.zsh
 591@@ -2,4 +2,4 @@
 592 # as seen in http://www.porcheron.info/command-not-found-for-zsh/
 593 # this is installed in Ubuntu
 594 
 595-source /etc/zsh_command_not_found
 596+[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
 597diff --git a/plugins/cp/cp.plugin.zsh b/plugins/cp/cp.plugin.zsh
 598new file mode 100644
 599index 0000000000000000000000000000000000000000..7355a99902792ba5875256322da3997b3e348760
 600--- /dev/null
 601+++ b/plugins/cp/cp.plugin.zsh
 602@@ -0,0 +1,14 @@
 603+#Show progress while file is copying
 604+
 605+# Rsync options are:
 606+#  -p - preserve permissions
 607+#  -o - preserve owner
 608+#  -g - preserve group
 609+#  -h - output in human-readable format
 610+#  --progress - display progress
 611+#  -b - instead of just overwriting an existing file, save the original
 612+#  --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
 613+#  -e /dev/null - only work on local files
 614+#  -- - everything after this is an argument, even if it looks like an option
 615+
 616+alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"
 617diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
 618index 39d3ef36a05280e9e285412afecba861278bd73c..55b90e3793a3bc1f13cf43f7c1c0e74eb84062cc 100644
 619--- a/plugins/debian/debian.plugin.zsh
 620+++ b/plugins/debian/debian.plugin.zsh
 621@@ -6,14 +6,14 @@
 622 
 623 # Use aptitude if installed, or apt-get if not.
 624 # You can just set apt_pref='apt-get' to override it.
 625-if [[ -e $( which aptitude ) ]]; then
 626+if [[ -e $( which aptitude 2>&1 ) ]]; then
 627     apt_pref='aptitude'
 628 else
 629     apt_pref='apt-get'
 630 fi
 631 
 632 # Use sudo by default if it's installed
 633-if [[ -e $( which sudo ) ]]; then
 634+if [[ -e $( which sudo 2>&1 ) ]]; then
 635     use_sudo=1
 636 fi
 637 
 638@@ -21,7 +21,7 @@ fi
 639 # These are for more obscure uses of apt-get and aptitude that aren't covered
 640 # below.
 641 alias ag='apt-get'
 642-alias at='aptitude'
 643+alias ap='aptitude'
 644 
 645 # Some self-explanatory aliases
 646 alias acs="apt-cache search"
 647@@ -35,7 +35,7 @@ alias afs='apt-file search --regexp'
 648 
 649 # These are apt-get only
 650 alias asrc='apt-get source'
 651-alias ap='apt-cache policy'
 652+alias app='apt-cache policy'
 653 
 654 # superuser operations ######################################################
 655 if [[ $use_sudo -eq 1 ]]; then
 656@@ -61,7 +61,8 @@ if [[ $use_sudo -eq 1 ]]; then
 657     # Install all .deb files in the current directory.
 658     # Warning: you will need to put the glob in single quotes if you use:
 659     # glob_subst
 660-    alias di='sudo dpkg -i ./*.deb'
 661+    alias dia='sudo dpkg -i ./*.deb'
 662+    alias di='sudo dpkg -i'
 663 
 664     # Remove ALL kernel images and headers EXCEPT the one in use
 665     alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
 666@@ -100,7 +101,8 @@ else
 667 
 668     # Install all .deb files in the current directory
 669     # Assumes glob_subst is off
 670-    alias di='su -lc "dpkg -i ./*.deb" root'
 671+    alias dia='su -lc "dpkg -i ./*.deb" root'
 672+    alias di='su -lc "dpkg -i" root'
 673 
 674     # Remove ALL kernel images and headers EXCEPT the one in use
 675     alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
 676diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh
 677new file mode 100644
 678index 0000000000000000000000000000000000000000..056069d36211daa345cf245105fbfe1ee104c993
 679--- /dev/null
 680+++ b/plugins/forklift/forklift.plugin.zsh
 681@@ -0,0 +1,44 @@
 682+# Open folder in ForkLift.app from console
 683+# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
 684+#
 685+# Usage:
 686+#   fl [<folder>]
 687+#
 688+# Opens specified directory or current working directory in ForkLift.app
 689+#
 690+# Notes:
 691+# It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new
 692+# app window.
 693+#
 694+# https://gist.github.com/3313481
 695+function fl {
 696+  if [ ! -z "$1" ]; then
 697+    DIR=$1
 698+    if [ ! -d "$DIR" ]; then
 699+      DIR=$(dirname $DIR)
 700+    fi
 701+    if [ "$DIR" != "." ]; then
 702+      PWD=`cd "$DIR";pwd`
 703+    fi
 704+  fi
 705+  osascript 2>&1 1>/dev/null <<END
 706+    tell application "ForkLift"
 707+      activate
 708+    end tell
 709+    tell application "System Events"
 710+      tell application process "ForkLift"
 711+        try
 712+          set topWindow to window 1
 713+        on error
 714+          keystroke "n" using command down
 715+          set topWindow to window 1
 716+        end try
 717+        keystroke "g" using {command down, shift down}
 718+        tell sheet 1 of topWindow
 719+          set value of text field 1 to "$PWD"
 720+        	keystroke return
 721+        end tell
 722+      end tell
 723+    end tell
 724+END
 725+}
 726diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
 727new file mode 100644
 728index 0000000000000000000000000000000000000000..8419166abc10b7f05a30fe02d39aa34d3c33cddb
 729--- /dev/null
 730+++ b/plugins/git-extras/git-extras.plugin.zsh
 731@@ -0,0 +1,285 @@
 732+#compdef git
 733+# ------------------------------------------------------------------------------
 734+# Description
 735+# -----------
 736+#
 737+#  Completion script for git-extras (http://github.com/visionmedia/git-extras).
 738+#
 739+# ------------------------------------------------------------------------------
 740+# Authors
 741+# -------
 742+#
 743+#  * Alexis GRIMALDI (https://github.com/agrimaldi)
 744+#
 745+# ------------------------------------------------------------------------------
 746+# Inspirations
 747+# -----------
 748+#
 749+#  * git-extras (http://github.com/visionmedia/git-extras)
 750+#  * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
 751+#
 752+# ------------------------------------------------------------------------------
 753+
 754+
 755+__git_command_successful () {
 756+    if (( ${#pipestatus:#0} > 0 )); then
 757+        _message 'not a git repository'
 758+        return 1
 759+    fi
 760+    return 0
 761+}
 762+
 763+
 764+__git_tag_names() {
 765+    local expl
 766+    declare -a tag_names
 767+    tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
 768+    __git_command_successful || return
 769+    _wanted tag-names expl tag-name compadd $* - $tag_names
 770+}
 771+
 772+
 773+__git_branch_names() {
 774+    local expl
 775+    declare -a branch_names
 776+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
 777+    __git_command_successful || return
 778+    _wanted branch-names expl branch-name compadd $* - $branch_names
 779+}
 780+
 781+
 782+__git_feature_branch_names() {
 783+    local expl
 784+    declare -a branch_names
 785+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
 786+    __git_command_successful || return
 787+    _wanted branch-names expl branch-name compadd $* - $branch_names
 788+}
 789+
 790+
 791+__git_refactor_branch_names() {
 792+    local expl
 793+    declare -a branch_names
 794+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
 795+    __git_command_successful || return
 796+    _wanted branch-names expl branch-name compadd $* - $branch_names
 797+}
 798+
 799+
 800+__git_bug_branch_names() {
 801+    local expl
 802+    declare -a branch_names
 803+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
 804+    __git_command_successful || return
 805+    _wanted branch-names expl branch-name compadd $* - $branch_names
 806+}
 807+
 808+
 809+__git_submodule_names() {
 810+    local expl
 811+    declare -a submodule_names
 812+    submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
 813+    __git_command_successful || return
 814+    _wanted submodule-names expl submodule-name compadd $* - $submodule_names
 815+}
 816+
 817+
 818+__git_author_names() {
 819+    local expl
 820+    declare -a author_names
 821+    author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
 822+    __git_command_successful || return
 823+    _wanted author-names expl author-name compadd $* - $author_names
 824+}
 825+
 826+
 827+_git-changelog() {
 828+    _arguments \
 829+        '(-l --list)'{-l,--list}'[list commits]' \
 830+}
 831diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
 832index 71b343884a5428660c92ce86ca63823d4337f8c7..ec21019e65c24ad21351dba73044952f687434e8 100644
 833--- a/plugins/git-flow/git-flow.plugin.zsh
 834+++ b/plugins/git-flow/git-flow.plugin.zsh
 835@@ -195,7 +195,7 @@ __git-flow-feature ()
 836 				'start:Start a new feature branch.'
 837 				'finish:Finish a feature branch.'
 838 				'list:List all your feature branches. (Alias to `git flow feature`)'
 839-				'publish: public'
 840+				'publish: publish'
 841 				'track: track'
 842 				'diff: diff'
 843 				'rebase: rebase'
 844@@ -221,6 +221,7 @@ __git-flow-feature ()
 845 					_arguments \
 846 						-F'[Fetch from origin before performing finish]' \
 847 						-r'[Rebase instead of merge]'\
 848+						-k'[Keep branch after performing finish]'\
 849 						':feature:__git_flow_feature_list'
 850 				;;
 851 
 852@@ -236,13 +237,13 @@ __git-flow-feature ()
 853 
 854 				(diff)
 855 					_arguments \
 856-						':branch:__git_branch_names'\
 857+						':branch:__git_flow_feature_list'\
 858 				;;
 859 
 860 				(rebase)
 861 					_arguments \
 862 						-i'[Do an interactive rebase]' \
 863-						':branch:__git_branch_names'
 864+						':branch:__git_flow_feature_list'
 865 				;;
 866 
 867 				(checkout)
 868@@ -253,7 +254,7 @@ __git-flow-feature ()
 869 				(pull)
 870 					_arguments \
 871 						':remote:__git_remotes'\
 872-						':branch:__git_branch_names'
 873+						':branch:__git_flow_feature_list'
 874 				;;
 875 
 876 				*)
 877@@ -333,4 +334,4 @@ __git_command_successful () {
 878 	return 0
 879 }
 880 
 881-zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
 882+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
 883diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh
 884new file mode 100644
 885index 0000000000000000000000000000000000000000..a09f88391778e6af32ab4329aa53542a90f2ae80
 886--- /dev/null
 887+++ b/plugins/git-hubflow/git-hubflow.plugin.zsh
 888@@ -0,0 +1,348 @@
 889+#!zsh
 890+#
 891+# Installation
 892+# ------------
 893+#
 894+# To achieve git-hubflow completion nirvana:
 895+#
 896+#  0. Update your zsh's git-completion module to the newest verion.
 897+#     From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
 898+#
 899+#  1. Install this file. Either:
 900+#
 901+#     a. Place it in your .zshrc:
 902+#
 903+#     b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in
 904+#        your .zshrc:
 905+#
 906+#            source ~/.git-hubflow-completion.zsh
 907+#
 908+#     c. Or, use this file as a oh-my-zsh plugin.
 909+#
 910+
 911+_git-hf ()
 912+{
 913+    local curcontext="$curcontext" state line
 914+    typeset -A opt_args
 915+
 916+    _arguments -C \
 917+        ':command:->command' \
 918+        '*::options:->options'
 919+
 920+    case $state in
 921+        (command)
 922+
 923+            local -a subcommands
 924+            subcommands=(
 925+                'init:Initialize a new git repo with support for the branching model.'
 926+                'feature:Manage your feature branches.'
 927+                'release:Manage your release branches.'
 928+                'hotfix:Manage your hotfix branches.'
 929+                'support:Manage your support branches.'
 930+                'update:Pull upstream changes down into your master and develop branches.'
 931+                'version:Shows version information.'
 932+            )
 933+            _describe -t commands 'git hf' subcommands
 934+        ;;
 935+
 936+        (options)
 937+            case $line[1] in
 938+
 939+                (init)
 940+                    _arguments \
 941+                        -f'[Force setting of gitflow branches, even if already configured]'
 942+                ;;
 943+
 944+                (version)
 945+                ;;
 946+
 947+                (hotfix)
 948+                    __git-hf-hotfix
 949+                ;;
 950+
 951+                (release)
 952+                    __git-hf-release
 953+                ;;
 954+
 955+                (feature)
 956+                    __git-hf-feature
 957+                ;;
 958+            esac
 959+        ;;
 960+    esac
 961+}
 962+
 963+__git-hf-release ()
 964+{
 965+    local curcontext="$curcontext" state line
 966+    typeset -A opt_args
 967+
 968+    _arguments -C \
 969+        ':command:->command' \
 970+        '*::options:->options'
 971+
 972+    case $state in
 973+        (command)
 974+
 975+            local -a subcommands
 976+            subcommands=(
 977+                'start:Start a new release branch.'
 978+                'finish:Finish a release branch.'
 979+                'list:List all your release branches. (Alias to `git hf release`)'
 980+                'cancel:Cancel release'
 981+                'push:Push release to github'
 982+                'pull:Pull release from github'
 983+                'track:Track release'
 984+            )
 985+            _describe -t commands 'git hf release' subcommands
 986+            _arguments \
 987+                -v'[Verbose (more) output]'
 988diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 989new file mode 100644
 990index 0000000000000000000000000000000000000000..ff98cbf87a296045abbff56082dfeae839f79dbf
 991--- /dev/null
 992+++ b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 993@@ -0,0 +1,18 @@
 994+_git_remote_branch() {
 995+  ref=$(git symbolic-ref HEAD 2> /dev/null)
 996+  if [[ -n $ref ]]; then
 997+    if (( CURRENT == 2 )); then
 998+      # first arg: operation
 999+      compadd create publish rename delete track
1000+    elif (( CURRENT == 3 )); then
1001+      # second arg: remote branch name
1002+      compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"`
1003+    elif (( CURRENT == 4 )); then
1004+      # third arg: remote name
1005+      compadd `git remote`
1006+    fi
1007+  else;
1008+    _files
1009+  fi
1010+}
1011+compdef _git_remote_branch grb
1012diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
1013index d3d3f702a362c6ebe24109369da2e6d1a8652464..154aa6db1a4d686c65be2c4931c40eaac4d6bd8d 100644
1014--- a/plugins/git/git.plugin.zsh
1015+++ b/plugins/git/git.plugin.zsh
1016@@ -5,10 +5,11 @@ alias gst='git status'
1017 compdef _git gst=git-status
1018 alias gl='git pull'
1019 compdef _git gl=git-pull
1020-alias gup='git fetch && git rebase'
1021+alias gup='git pull --rebase'
1022 compdef _git gup=git-fetch
1023 alias gp='git push'
1024 compdef _git gp=git-push
1025+alias gd='git diff'
1026 gdv() { git diff -w "$@" | view - }
1027 compdef _git gdv=git-diff
1028 alias gc='git commit -v'
1029@@ -18,18 +19,33 @@ compdef _git gca=git-commit
1030 alias gco='git checkout'
1031 compdef _git gco=git-checkout
1032 alias gcm='git checkout master'
1033+alias gr='git remote'
1034+compdef _git gr=git-remote
1035+alias grv='git remote -v'
1036+compdef _git grv=git-remote
1037+alias grmv='git remote rename'
1038+compdef _git grmv=git-remote
1039+alias grrm='git remote remove'
1040+compdef _git grrm=git-remote
1041+alias grset='git remote set-url'
1042+compdef _git grset=git-remote
1043+alias grup='git remote update'
1044+compdef _git grset=git-remote
1045 alias gb='git branch'
1046 compdef _git gb=git-branch
1047 alias gba='git branch -a'
1048 compdef _git gba=git-branch
1049 alias gcount='git shortlog -sn'
1050 compdef gcount=git
1051+alias gcl='git config --list'
1052 alias gcp='git cherry-pick'
1053 compdef _git gcp=git-cherry-pick
1054 alias glg='git log --stat --max-count=5'
1055 compdef _git glg=git-log
1056 alias glgg='git log --graph --max-count=5'
1057 compdef _git glgg=git-log
1058+alias glgga='git log --graph --decorate --all'
1059+compdef _git glgga=git-log
1060 alias gss='git status -s'
1061 compdef _git gss=git-status
1062 alias ga='git add'
1063@@ -38,6 +54,13 @@ alias gm='git merge'
1064 compdef _git gm=git-merge
1065 alias grh='git reset HEAD'
1066 alias grhh='git reset HEAD --hard'
1067+alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
1068+alias gf='git ls-files | grep'
1069+alias gpoat='git push origin --all && git push origin --tags'
1070+
1071+# Will cd into the top of the current repository
1072+# or submodule.
1073+alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
1074 
1075 # Git and svn mix
1076 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
1077@@ -50,13 +73,14 @@ alias gsd='git svn dcommit'
1078 # Usage example: git pull origin $(current_branch)
1079 #
1080 function current_branch() {
1081-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
1082+  ref=$(git symbolic-ref HEAD 2> /dev/null) || \
1083+  ref=$(git rev-parse --short HEAD 2> /dev/null) || return
1084   echo ${ref#refs/heads/}
1085 }
1086 
1087 function current_repository() {
1088-
1089-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
1090+  ref=$(git symbolic-ref HEAD 2> /dev/null) || \
1091+  ref=$(git rev-parse --short HEAD 2> /dev/null) || return
1092   echo $(git remote -v | cut -d':' -f 2)
1093 }
1094 
1095diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git
1096new file mode 100644
1097index 0000000000000000000000000000000000000000..45775021fff11011a98b90a6b8ebaa72d3d0cd9f
1098--- /dev/null
1099+++ b/plugins/gitfast/_git
1100@@ -0,0 +1,78 @@
1101+#compdef git gitk
1102+
1103+# zsh completion wrapper for git
1104+#
1105+# You need git's bash completion script installed somewhere, by default on the
1106+# same directory as this script.
1107+#
1108+# If your script is on ~/.git-completion.sh instead, you can configure it on
1109+# your ~/.zshrc:
1110+#
1111+#  zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
1112+#
1113+# The recommended way to install this script is to copy to
1114+# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file:
1115+#
1116+#  fpath=(~/.zsh/completion $fpath)
1117+
1118+complete ()
1119+{
1120+	# do nothing
1121+	return 0
1122+}
1123+
1124+zstyle -s ":completion:*:*:git:*" script script
1125+test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
1126+ZSH_VERSION='' . "$script"
1127+
1128+__gitcomp ()
1129+{
1130+	emulate -L zsh
1131+
1132+	local cur_="${3-$cur}"
1133+
1134+	case "$cur_" in
1135+	--*=)
1136+		;;
1137+	*)
1138+		local c IFS=$' \t\n'
1139+		local -a array
1140+		for c in ${=1}; do
1141+			c="$c${4-}"
1142+			case $c in
1143+			--*=*|*.) ;;
1144+			*) c="$c " ;;
1145+			esac
1146+			array+=("$c")
1147+		done
1148+		compset -P '*[=:]'
1149+		compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
1150+		;;
1151+	esac
1152+}
1153+
1154+__gitcomp_nl ()
1155+{
1156+	emulate -L zsh
1157+
1158+	local IFS=$'\n'
1159+	compset -P '*[=:]'
1160+	compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
1161+}
1162+
1163+_git ()
1164+{
1165+	local _ret=1
1166+	() {
1167+		emulate -L ksh
1168+		local cur cword prev
1169+		cur=${words[CURRENT-1]}
1170+		prev=${words[CURRENT-2]}
1171+		let cword=CURRENT-1
1172+		__${service}_main
1173+	}
1174+	let _ret && _default -S '' && _ret=0
1175+	return _ret
1176+}
1177+
1178+_git
1179diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash
1180new file mode 100644
1181index 0000000000000000000000000000000000000000..be800e09bdf0656951c415105e0d32ce0b0edf9e
1182--- /dev/null
1183+++ b/plugins/gitfast/git-completion.bash
1184@@ -0,0 +1,2483 @@
1185+#!bash
1186+#
1187+# bash/zsh completion support for core Git.
1188+#
1189+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
1190+# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
1191+# Distributed under the GNU General Public License, version 2.0.
1192+#
1193+# The contained completion routines provide support for completing:
1194+#
1195+#    *) local and remote branch names
1196+#    *) local and remote tag names
1197+#    *) .git/remotes file names
1198+#    *) git 'subcommands'
1199+#    *) tree paths within 'ref:path/to/file' expressions
1200+#    *) common --long-options
1201+#
1202+# To use these routines:
1203+#
1204+#    1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
1205+#    2) Add the following line to your .bashrc/.zshrc:
1206+#        source ~/.git-completion.sh
1207+#    3) Consider changing your PS1 to also show the current branch,
1208+#       see git-prompt.sh for details.
1209+
1210+if [[ -n ${ZSH_VERSION-} ]]; then
1211+	autoload -U +X bashcompinit && bashcompinit
1212+fi
1213+
1214+case "$COMP_WORDBREAKS" in
1215+*:*) : great ;;
1216+*)   COMP_WORDBREAKS="$COMP_WORDBREAKS:"
1217+esac
1218+
1219+# __gitdir accepts 0 or 1 arguments (i.e., location)
1220+# returns location of .git repo
1221+__gitdir ()
1222+{
1223+	# Note: this function is duplicated in git-prompt.sh
1224+	# When updating it, make sure you update the other one to match.
1225+	if [ -z "${1-}" ]; then
1226+		if [ -n "${__git_dir-}" ]; then
1227+			echo "$__git_dir"
1228+		elif [ -n "${GIT_DIR-}" ]; then
1229+			test -d "${GIT_DIR-}" || return 1
1230+			echo "$GIT_DIR"
1231+		elif [ -d .git ]; then
1232+			echo .git
1233+		else
1234+			git rev-parse --git-dir 2>/dev/null
1235+		fi
1236+	elif [ -d "$1/.git" ]; then
1237+		echo "$1/.git"
1238+	else
1239+		echo "$1"
1240+	fi
1241+}
1242+
1243+__gitcomp_1 ()
1244+{
1245+	local c IFS=$' \t\n'
1246+	for c in $1; do
1247+		c="$c$2"
1248+		case $c in
1249+		--*=*|*.) ;;
1250+		*) c="$c " ;;
1251+		esac
1252+		printf '%s\n' "$c"
1253+	done
1254+}
1255+
1256+# The following function is based on code from:
1257+#
1258+#   bash_completion - programmable completion functions for bash 3.2+
1259+#
1260+#   Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
1261+#             © 2009-2010, Bash Completion Maintainers
1262+#                     <bash-completion-devel@lists.alioth.debian.org>
1263+#
1264+#   This program is free software; you can redistribute it and/or modify
1265+#   it under the terms of the GNU General Public License as published by
1266+#   the Free Software Foundation; either version 2, or (at your option)
1267+#   any later version.
1268+#
1269+#   This program is distributed in the hope that it will be useful,
1270+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
1271+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1272+#   GNU General Public License for more details.
1273+#
1274+#   You should have received a copy of the GNU General Public License
1275+#   along with this program; if not, write to the Free Software Foundation,
1276+#   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1277+#
1278+#   The latest version of this software can be obtained here:
1279+#
1280+#   http://bash-completion.alioth.debian.org/
1281+#
1282+#   RELEASE: 2.x
1283+
1284diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh
1285new file mode 100644
1286index 0000000000000000000000000000000000000000..bf20491ec33e467f6b9591d94a2e27bc9e3d93e9
1287--- /dev/null
1288+++ b/plugins/gitfast/git-prompt.sh
1289@@ -0,0 +1,290 @@
1290+# bash/zsh git prompt support
1291+#
1292+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
1293+# Distributed under the GNU General Public License, version 2.0.
1294+#
1295+# This script allows you to see the current branch in your prompt.
1296+#
1297+# To enable:
1298+#
1299+#    1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
1300+#    2) Add the following line to your .bashrc/.zshrc:
1301+#        source ~/.git-prompt.sh
1302+#    3) Change your PS1 to also show the current branch:
1303+#         Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
1304+#         ZSH:  PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
1305+#
1306+# The argument to __git_ps1 will be displayed only if you are currently
1307+# in a git repository.  The %s token will be the name of the current
1308+# branch.
1309+#
1310+# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
1311+# unstaged (*) and staged (+) changes will be shown next to the branch
1312+# name.  You can configure this per-repository with the
1313+# bash.showDirtyState variable, which defaults to true once
1314+# GIT_PS1_SHOWDIRTYSTATE is enabled.
1315+#
1316+# You can also see if currently something is stashed, by setting
1317+# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
1318+# then a '$' will be shown next to the branch name.
1319+#
1320+# If you would like to see if there're untracked files, then you can set
1321+# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
1322+# files, then a '%' will be shown next to the branch name.
1323+#
1324+# If you would like to see the difference between HEAD and its upstream,
1325+# set GIT_PS1_SHOWUPSTREAM="auto".  A "<" indicates you are behind, ">"
1326+# indicates you are ahead, "<>" indicates you have diverged and "="
1327+# indicates that there is no difference. You can further control
1328+# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
1329+# of values:
1330+#
1331+#     verbose       show number of commits ahead/behind (+/-) upstream
1332+#     legacy        don't use the '--count' option available in recent
1333+#                   versions of git-rev-list
1334+#     git           always compare HEAD to @{upstream}
1335+#     svn           always compare HEAD to your SVN upstream
1336+#
1337+# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
1338+# find one, or @{upstream} otherwise.  Once you have set
1339+# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
1340+# setting the bash.showUpstream config variable.
1341+
1342+# __gitdir accepts 0 or 1 arguments (i.e., location)
1343+# returns location of .git repo
1344+__gitdir ()
1345+{
1346+	# Note: this function is duplicated in git-completion.bash
1347+	# When updating it, make sure you update the other one to match.
1348+	if [ -z "${1-}" ]; then
1349+		if [ -n "${__git_dir-}" ]; then
1350+			echo "$__git_dir"
1351+		elif [ -n "${GIT_DIR-}" ]; then
1352+			test -d "${GIT_DIR-}" || return 1
1353+			echo "$GIT_DIR"
1354+		elif [ -d .git ]; then
1355+			echo .git
1356+		else
1357+			git rev-parse --git-dir 2>/dev/null
1358+		fi
1359+	elif [ -d "$1/.git" ]; then
1360+		echo "$1/.git"
1361+	else
1362+		echo "$1"
1363+	fi
1364+}
1365+
1366+# stores the divergence from upstream in $p
1367+# used by GIT_PS1_SHOWUPSTREAM
1368+__git_ps1_show_upstream ()
1369+{
1370+	local key value
1371+	local svn_remote svn_url_pattern count n
1372+	local upstream=git legacy="" verbose=""
1373+
1374+	svn_remote=()
1375+	# get some config options from git-config
1376+	local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
1377+	while read -r key value; do
1378+		case "$key" in
1379+		bash.showupstream)
1380+			GIT_PS1_SHOWUPSTREAM="$value"
1381+			if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
1382+				p=""
1383+				return
1384+			fi
1385+			;;
1386+		svn-remote.*.url)
1387+			svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
1388+			svn_url_pattern+="\\|$value"
1389diff --git a/plugins/gitfast/gitfast.plugin.zsh b/plugins/gitfast/gitfast.plugin.zsh
1390new file mode 100644
1391index 0000000000000000000000000000000000000000..7e50cf721cb33e5f090379cb43b2c53950a17902
1392--- /dev/null
1393+++ b/plugins/gitfast/gitfast.plugin.zsh
1394@@ -0,0 +1,7 @@
1395+dir=$(dirname $0)
1396+source $dir/../git/git.plugin.zsh
1397+source $dir/git-prompt.sh
1398+
1399+function git_prompt_info() {
1400+  __git_ps1 "${ZSH_THEME_GIT_PROMPT_PREFIX//\%/%%}%s${ZSH_THEME_GIT_PROMPT_SUFFIX//\%/%%}"
1401+}
1402diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
1403index 197e86a48743419f79cceb8f4d4ebdafca0a5972..598b059c18753f0f76002a2e93046f037c1c9e56 100644
1404--- a/plugins/github/github.plugin.zsh
1405+++ b/plugins/github/github.plugin.zsh
1406@@ -61,6 +61,7 @@ exist_gh() { # [DIRECTORY]
1407     cd "$1"
1408     name=$( git config user.name )
1409     ghuser=$( git config github.user )
1410+    repo=$1
1411 
1412     git remote add origin git@github.com:${ghuser}/${repo}.git
1413     git push -u origin master
1414diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
1415index dc899e2b2a3e07b6d36501b4b1b6f4f6211302db..a95c38647f9bde735428d46db379f331fcf62113 100644
1416--- a/plugins/heroku/_heroku
1417+++ b/plugins/heroku/_heroku
1418@@ -154,5 +154,6 @@ case "$words[1]" in
1419 _arguments \
1420   $_command_args \
1421   '(--app)--app[the app name]' \
1422+  '(--remote)--remote[the remote name]' \
1423   &&  return 0
1424 
1425diff --git a/plugins/history/history.plugin.zsh b/plugins/history/history.plugin.zsh
1426new file mode 100644
1427index 0000000000000000000000000000000000000000..0f4aa4b10720d359d48cbac77c86234bf26f56a3
1428--- /dev/null
1429+++ b/plugins/history/history.plugin.zsh
1430@@ -0,0 +1,8 @@
1431+alias h='history'
1432+
1433+function hs
1434+{
1435+    history | grep $*
1436+}
1437+
1438+alias hsi='hs -i'
1439diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
1440index 636e4619e37be6b64eea2ee1fed5d62bb0b8f98b..b91f93c9565620f53094880cef5bc0469ab3250f 100644
1441--- a/plugins/jira/jira.plugin.zsh
1442+++ b/plugins/jira/jira.plugin.zsh
1443@@ -1,20 +1,36 @@
1444 # To use: add a .jira-url file in the base of your project
1445+#         You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory
1446+#         .jira-url in the current directory takes precedence
1447+#
1448+# If you use Rapid Board, set:
1449+#JIRA_RAPID_BOARD="yes"
1450+# in you .zshrc
1451+#
1452 # Setup: cd to/my/project
1453 #        echo "https://name.jira.com" >> .jira-url
1454 # Usage: jira           # opens a new issue
1455 #        jira ABC-123   # Opens an existing issue
1456 open_jira_issue () {
1457-  if [ ! -f .jira-url ]; then
1458-    echo "There is no .jira-url file in the current directory..."
1459-    return 0;
1460+  if [ -f .jira-url ]; then
1461+    jira_url=$(cat .jira-url)
1462+  elif [ -f ~/.jira-url ]; then
1463+    jira_url=$(cat ~/.jira-url)
1464+  elif [[ "x$JIRA_URL" != "x" ]]; then
1465+    jira_url=$JIRA_URL
1466   else
1467-    jira_url=$(cat .jira-url);
1468-    if [ -z "$1" ]; then
1469-      echo "Opening new issue";
1470-      `open $jira_url/secure/CreateIssue!default.jspa`;
1471+    echo "JIRA url is not specified anywhere."
1472+    return 0
1473+  fi
1474+
1475+  if [ -z "$1" ]; then
1476+    echo "Opening new issue"
1477+    `open $jira_url/secure/CreateIssue!default.jspa`
1478+  else
1479+    echo "Opening issue #$1"
1480+    if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then
1481+      `open $jira_url/issues/$1`
1482     else
1483-      echo "Opening issue #$1";
1484-      `open $jira_url/issues/$1`;
1485+      `open $jira_url/browse/$1`
1486     fi
1487   fi
1488 }
1489diff --git a/plugins/knife/_knife b/plugins/knife/_knife
1490index 8453af5be60abb5412a28010dc500f7fb1512cc9..dec49125786e5dd40b04d092f540cc07e2ce57b3 100644
1491--- a/plugins/knife/_knife
1492+++ b/plugins/knife/_knife
1493@@ -170,7 +170,11 @@ _chef_environments_remote() {
1494 
1495 # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
1496 _chef_cookbooks_local() {
1497- (for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
1498+ local knife_rb="$HOME/.chef/knife.rb"
1499+ if [ -f ./.chef/knife.rb ]; then
1500+  knife_rb="./.chef/knife.rb"
1501+ fi
1502+ (for i in $( grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
1503 }
1504 
1505 # This function extracts the available cookbook versions on the chef server
1506diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
1507new file mode 100644
1508index 0000000000000000000000000000000000000000..190bc279d505cc9c985023f10a12ee694dbd3067
1509--- /dev/null
1510+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
1511@@ -0,0 +1,24 @@
1512+#!/usr/bin/env zsh
1513+# Keeps track of the last used working directory and automatically jumps
1514+# into it for new shells.
1515+
1516+# Flag indicating if we've previously jumped to last directory.
1517+typeset -g ZSH_LAST_WORKING_DIRECTORY
1518+mkdir -p "$ZSH/cache"
1519+local cache_file="$ZSH/cache/last-working-dir"
1520+
1521+# Updates the last directory once directory is changed.
1522+function chpwd() {
1523+	echo "$PWD" > "$cache_file"
1524+}
1525+
1526+# Changes directory to the last working directory.
1527+function lwd() {
1528+	[[ ! -r "$cache_file" ]] || cd `cat "$cache_file"`
1529+}
1530+
1531+# Automatically jump to last working directory unless this isn't the first time
1532+# this plugin has been loaded.
1533+if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then
1534+	lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true
1535+fi
1536diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
1537index 697f98d664f92b71ab9bed127cda0e42e5726d7c..ae065c12f8066f2197af9f24b879c0101e519cb5 100644
1538--- a/plugins/lol/lol.plugin.zsh
1539+++ b/plugins/lol/lol.plugin.zsh
1540@@ -5,6 +5,7 @@ alias wtf='dmesg'
1541 alias onoz='cat /var/log/errors.log'
1542 alias rtfm='man'
1543 
1544+alias :3='echo'
1545 alias visible='echo'
1546 alias invisible='cat'
1547 alias moar='more'
1548diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
1549index caf0d9efc81196a73e9b8592fd3a0a3b0f46ed17..a3a6ff8b65e42b49b9e59e5cb56c8b49f9563456 100644
1550--- a/plugins/mercurial/mercurial.plugin.zsh
1551+++ b/plugins/mercurial/mercurial.plugin.zsh
1552@@ -12,3 +12,9 @@ alias hgp='hg push'
1553 alias hgs='hg status'
1554 # this is the 'git commit --amend' equivalent
1555 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
1556+
1557+function hg_current_branch() {
1558+  if [ -d .hg ]; then
1559+    echo hg:$(hg branch)
1560+  fi
1561+}
1562diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
1563index e8af2f49d5d2f87daeae99b23d59fecdc7b44d26..da29b4f0abaf50ffa5c315d1ebcfdf032a21b0ae 100644
1564--- a/plugins/mvn/mvn.plugin.zsh
1565+++ b/plugins/mvn/mvn.plugin.zsh
1566@@ -1,6 +1,170 @@
1567+# mvn-color based on https://gist.github.com/1027800
1568+export BOLD=`tput bold`
1569+export UNDERLINE_ON=`tput smul`
1570+export UNDERLINE_OFF=`tput rmul`
1571+export TEXT_BLACK=`tput setaf 0`
1572+export TEXT_RED=`tput setaf 1`
1573+export TEXT_GREEN=`tput setaf 2`
1574+export TEXT_YELLOW=`tput setaf 3`
1575+export TEXT_BLUE=`tput setaf 4`
1576+export TEXT_MAGENTA=`tput setaf 5`
1577+export TEXT_CYAN=`tput setaf 6`
1578+export TEXT_WHITE=`tput setaf 7`
1579+export BACKGROUND_BLACK=`tput setab 0`
1580+export BACKGROUND_RED=`tput setab 1`
1581+export BACKGROUND_GREEN=`tput setab 2`
1582+export BACKGROUND_YELLOW=`tput setab 3`
1583+export BACKGROUND_BLUE=`tput setab 4`
1584+export BACKGROUND_MAGENTA=`tput setab 5`
1585+export BACKGROUND_CYAN=`tput setab 6`
1586+export BACKGROUND_WHITE=`tput setab 7`
1587+export RESET_FORMATTING=`tput sgr0`
1588+
1589+ 
1590+# Wrapper function for Maven's mvn command.
1591+mvn-color()
1592+{
1593+  # Filter mvn output using sed
1594+  mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \
1595+               -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \
1596+               -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
1597+               -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \
1598+               -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \
1599diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
1600index 519bc18da425f86f2a5fd433cad5075d79a1075a..3bbed6f04c5a165465b63b7c64f24153585645f5 100644
1601--- a/plugins/node/node.plugin.zsh
1602+++ b/plugins/node/node.plugin.zsh
1603@@ -1,5 +1,5 @@
1604 # Open the node api for your current version to the optional section.
1605 # TODO: Make the section part easier to use.
1606 function node-docs {
1607-	open "http://nodejs.org/docs/$(node --version)/api/all.html#$1"
1608+	open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
1609 }
1610diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
1611index 682bb2667bc2cec79c6edd5870d4d42c871844f2..f278d4f8d2107a682f0ca3da92812f8a99f2ceaf 100644
1612--- a/plugins/osx/osx.plugin.zsh
1613+++ b/plugins/osx/osx.plugin.zsh
1614@@ -2,10 +2,9 @@
1615 #          FILE:  osx.plugin.zsh
1616 #   DESCRIPTION:  oh-my-zsh plugin file.
1617 #        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
1618-#       VERSION:  1.0.1
1619+#       VERSION:  1.1.0
1620 # ------------------------------------------------------------------------------
1621 
1622-
1623 function tab() {
1624   local command="cd \\\"$PWD\\\""
1625   (( $# > 0 )) && command="${command}; $*"
1626@@ -35,9 +34,67 @@ EOF
1627           launch session "Default Session"
1628           set current_session to current session
1629           tell current_session
1630-            write text "${command}"
1631+            write text "${command}; clear;"
1632+          end tell
1633+        end tell
1634+      end tell
1635+EOF
1636+  }
1637+}
1638+
1639+function vsplit_tab() {
1640+  local command="cd \\\"$PWD\\\""
1641+  (( $# > 0 )) && command="${command}; $*"
1642+
1643+  the_app=$(
1644+    osascript 2>/dev/null <<EOF
1645+      tell application "System Events"
1646+        name of first item of (every process whose frontmost is true)
1647+      end tell
1648+EOF
1649+  )
1650+
1651+  [[ "$the_app" == 'iTerm' ]] && {
1652+    osascript 2>/dev/null <<EOF
1653+      tell application "iTerm" to activate
1654+
1655+      tell application "System Events"
1656+        tell process "iTerm"
1657+          tell menu item "Split Vertically With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
1658+            click
1659+          end tell
1660+        end tell
1661+        keystroke "${command}; clear;"
1662+        keystroke return
1663+      end tell
1664+EOF
1665+  }
1666+}
1667+
1668+function split_tab() {
1669+  local command="cd \\\"$PWD\\\""
1670+  (( $# > 0 )) && command="${command}; $*"
1671+
1672+  the_app=$(
1673+    osascript 2>/dev/null <<EOF
1674+      tell application "System Events"
1675+        name of first item of (every process whose frontmost is true)
1676+      end tell
1677+EOF
1678+  )
1679+
1680+  [[ "$the_app" == 'iTerm' ]] && {
1681+    osascript 2>/dev/null <<EOF
1682+      tell application "iTerm" to activate
1683+
1684+      tell application "System Events"
1685+        tell process "iTerm"
1686+          tell menu item "Split Horizontally With Current Profile" of menu "Shell" of menu bar item "Shell" of menu bar 1
1687+            click
1688           end tell
1689         end tell
1690+        keystroke "${command}; clear;"
1691+        keystroke return
1692       end tell
1693 EOF
1694   }
1695diff --git a/plugins/pass/_pass b/plugins/pass/_pass
1696new file mode 100644
1697index 0000000000000000000000000000000000000000..f6c1a6c4bd36ebe5fd6e347412e730578cc73000
1698--- /dev/null
1699+++ b/plugins/pass/_pass
1700@@ -0,0 +1,119 @@
1701+#compdef pass
1702+#autoload
1703+
1704+# Copyright (C) 2012:
1705+#    Johan Venant <jvenant@invicem.pro>
1706+#    Brian Mattern <rephorm@rephorm.com>
1707+#    Jason A. Donenfeld <Jason@zx2c4.com>.
1708+#    Santiago Borrazás <sanbor@gmail.com>
1709+# All Rights Reserved.
1710+# This file is licensed under the GPLv2+. Please see COPYING for more information.
1711+
1712+
1713+_pass () {
1714+	local cmd
1715+	if (( CURRENT > 2)); then
1716+		cmd=${words[2]}
1717+		# Set the context for the subcommand.
1718+		curcontext="${curcontext%:*:*}:pass-$cmd"
1719+		# Narrow the range of words we are looking at to exclude `pass'
1720+		(( CURRENT-- ))
1721+		shift words
1722+		# Run the completion for the subcommand
1723+		case "${cmd}" in
1724+			init)
1725+				_arguments : \
1726+					"-r[re-encrypt existing passwords]" \
1727+					"--reencrypt[re-encrypt existing passwords]"
1728+				_pass_complete_keys
1729+				;;
1730+			ls|list|edit)
1731+				_pass_complete_entries_with_subdirs
1732+				;;
1733+			insert)
1734+				_arguments : \
1735+					"-e[echo password to console]" \
1736+					"--echo[echo password to console]" \
1737+					"-m[multiline]" \
1738+					"--multiline[multiline]"
1739+				_pass_complete_entries_with_subdirs
1740+				;;
1741+			generate)
1742+				_arguments : \
1743+					"-n[don't include symbols in password]" \
1744+					"--no-symbols[don't include symbols in password]" \
1745+					"-c[copy password to the clipboard]" \
1746+					"--clip[copy password to the clipboard]"
1747+				_pass_complete_entries_with_subdirs
1748+				;;
1749+			rm)
1750+				_arguments : \
1751+					"-f[force deletion]" \
1752+					"--force[force deletion]" \
1753+					"-r[recursively delete]" \
1754+					"--recursive[recursively delete]"
1755+					_pass_complete_entries_with_subdirs
1756+				;;
1757+			git)
1758+				local -a subcommands
1759+				subcommands=(
1760+					"init:Initialize git repository"
1761+					"push:Push to remote repository"
1762+					"pull:Pull from remote repository"
1763+					"config:Show git config"
1764+					"log:Show git log"
1765+					"reflog:Show git reflog"
1766+				)
1767+				_describe -t commands 'pass git' subcommands
1768+				;;
1769+			show|*)
1770+				_pass_cmd_show
1771+				;;
1772+		esac
1773+	else
1774+		local -a subcommands
1775+		subcommands=(
1776+			"init:Initialize new password storage"
1777+			"ls:List passwords"
1778+			"show:Decrypt and print a password"
1779+			"insert:Insert a new password"
1780+			"generate:Generate a new password using pwgen"
1781+			"edit:Edit a password with \$EDITOR"
1782+			"rm:Remove the password"
1783+			"git:Call git on the password store"
1784+			"version:Output version information"
1785+			"help:Output help message"
1786+		)
1787+		_describe -t commands 'pass' subcommands
1788+		_arguments : \
1789+			"--version[Output version information]" \
1790+			"--help[Output help message]"
1791+		_pass_cmd_show
1792+	fi
1793+}
1794+
1795+_pass_cmd_show () {
1796+	_arguments : \
1797+		"-c[put it on the clipboard]" \
1798+		"--clip[put it on the clipboard]"
1799+	_pass_complete_entries
1800diff --git a/plugins/per-directory-history/per-directory-history.plugin.zsh b/plugins/per-directory-history/per-directory-history.plugin.zsh
1801index 22383b8b96cf7ff31738fe4ebf3d9a8f28223e13..61e8b5a62753d7d4af5772115203d32acff1e743 100644
1802--- a/plugins/per-directory-history/per-directory-history.plugin.zsh
1803+++ b/plugins/per-directory-history/per-directory-history.plugin.zsh
1804@@ -65,12 +65,13 @@
1805 function per-directory-history-toggle-history() {
1806   if [[ $_per_directory_history_is_global == true ]]; then
1807     _per-directory-history-set-directory-history
1808-    echo "using local history\n"
1809+    print "\nusing local history\n"
1810   else
1811     _per-directory-history-set-global-history
1812-    echo "using global history\n"
1813+    print "\nusing global history\n"
1814   fi
1815-  zle reset-prompt
1816+  zle .push-line
1817+  zle .accept-line
1818 }
1819 
1820 autoload per-directory-history-toggle-history
1821diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh
1822index 8be3cd86311c68930a7a187a77d345cccb67430b..852c8b919ed77a45d68b0a57535b9b8995a8f8dd 100644
1823--- a/plugins/python/python.plugin.zsh
1824+++ b/plugins/python/python.plugin.zsh
1825@@ -1,8 +1,12 @@
1826 # Find python file
1827 alias pyfind='find . -name "*.py"'
1828 
1829-# Remove python compiled byte-code
1830-alias pyclean='find . -type f -name "*.py[co]" -delete'
1831+# Remove python compiled byte-code in either current directory or in a
1832+# list of specified directories
1833+function pyclean() {
1834+    ZSH_PYCLEAN_PLACES=${*:-'.'}
1835+    find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
1836+}
1837 
1838 # Grep among .py files
1839 alias pygrep='grep --include="*.py"'
1840diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
1841index 4aa7a05d6db43ff6a824cf90553564e9fa9572ec..d3849b4f49c08bcfcbea6f1c2088ca5e5fe4b904 100644
1842--- a/plugins/rails/rails.plugin.zsh
1843+++ b/plugins/rails/rails.plugin.zsh
1844@@ -5,6 +5,8 @@ alias sp='ruby script/plugin'
1845 alias sr='ruby script/runner'
1846 alias ssp='ruby script/spec'
1847 alias rdbm='rake db:migrate'
1848+alias rdbtp='rake db:test:prepare'
1849+alias migrate='rake db:migrate && rake db:test:prepare'
1850 alias sc='ruby script/console'
1851 alias sd='ruby script/server --debugger'
1852 alias devlog='tail -f log/development.log'
1853diff --git a/plugins/rsync/rsync.plugin.zsh b/plugins/rsync/rsync.plugin.zsh
1854new file mode 100644
1855index 0000000000000000000000000000000000000000..33a31a5c10eb81fc17b8d6688dea1185844b892a
1856--- /dev/null
1857+++ b/plugins/rsync/rsync.plugin.zsh
1858@@ -0,0 +1,4 @@
1859+alias rsync-copy="rsync -av --progress -h"
1860+alias rsync-move="rsync -av --progress -h --remove-source-files"
1861+alias rsync-update="rsync -avu --progress -h"
1862+alias rsync-synchronize="rsync -avu --delete --progress -h"
1863diff --git a/plugins/rvm/_rvm b/plugins/rvm/_rvm
1864deleted file mode 100644
1865index bba5304a032647ca5ce34165b2ac71ceff2db5f8..0000000000000000000000000000000000000000
1866--- a/plugins/rvm/_rvm
1867+++ /dev/null
1868@@ -1,147 +0,0 @@
1869-#compdef rvm
1870-
1871-local curcontext="$curcontext" state line cmds ret=1
1872-
1873-_arguments -C \
1874-	'(- 1 *)'{-v,--version}'[display version information]' \
1875-	'(-l|--level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \
1876-	'(--prefix)--prefix[path for all rvm files (~/.rvm/), with trailing slash!]:path:_files' \
1877-	'(--bin)--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \
1878-	'(--source)--source[src directory to use (~/.rvm/src/)]:path:_files' \
1879-	'(--archives)--archives[directory for downladed files (~/.rvm/archives/)]:path:_files' \
1880-	'-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \
1881-	'-e[Execute code from the command line]:code' \
1882-	'(-G)-G[root gem path to use]:path:_files' \
1883-	'(--gems)--gems[Used to set the gems_flag, use with remove to remove gems]' \
1884-	'(--archive)--archive[Used to set the archive_flag, use with remove to remove archive]' \
1885-	'(--patch)--patch[With MRI Rubies you may specify one or more full paths to patches]' \
1886-	'(-C|--configure)'{-C,--configure}'=[custom configure options]' \
1887-	'(--nice)--nice[process niceness (for slow computers, default 0)]:number' \
1888-	'(--ree)--ree-options[Options passed directly to ree ./installer on the command line]:options' \
1889-	'(--head)--head[with update, updates rvm to git head version]' \
1890-	'(--rubygems)--rubygems[with update, updates rubygems for selected ruby]' \
1891-	'(--default)--default[with ruby select, sets a default ruby for new shells]' \
1892-	'(--debug)--debug[Toggle debug mode on for very verbose output]' \
1893-	'(--trace)--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \
1894-	'(--force)--force[Force install, removes old install & source before install]' \
1895-	'(--summary)--summary[Used with rubydo to print out a summary of the commands run]' \
1896-	'(--latest)--latest[with gemset --dump skips version strings for latest gem]' \
1897-	'(--gems)--gems[with uninstall/remove removes gems with the interpreter]' \
1898-	'(--docs)--docs[with install, attempt to generate ri after installation]' \
1899-	'(--reconfigure)--reconfigure[Force ./configure on install even if Makefile already exists]' \
1900-	'1: :->cmds' \
1901-	'*: :->args' && ret=0
1902-
1903-case $state in
1904-	cmds)
1905-		cmds=( 
1906-            "version:show the rvm version installed in rvm_path"
1907-            "use:setup current shell to use a specific ruby version"
1908-            "reload:reload rvm source itself (useful after changing rvm source)"
1909-            "implode:(seppuku) removes the rvm installation completely. This means everything in $rvm_path (~/.rvm)."
1910-            "update:upgrades rvm to the latest version."
1911-            "reset:remove current and stored default & system settings."
1912-            "info :show the *current* environment information for current ruby"
1913-            "current:print the *current* ruby version and the name of any gemset being used."
1914-            "debug:show info plus additional information for common issues"
1915-            "install:install one or many ruby versions"
1916-            "uninstall:uninstall one or many ruby versions, leaves their sources"
1917-            "remove:uninstall one or many ruby versions and remove their sources"
1918-            "migrate:Lets you migrate all gemsets from one ruby to another."
1919-            "upgrade:Lets you upgrade from one version of a ruby to another, including migrating your gemsets semi-automatically."
1920-            "wrapper:generates a set of wrapper executables for a given ruby with the specified ruby and gemset combination. Used under the hood for passenger support and the like."
1921-            "cleanup:Lets you remove stale source folders / archives and other miscellaneous data associated with rvm."
1922-            "repair:Lets you repair parts of your environment e.g. wrappers, env files and and similar files (e.g. general maintenance)."
1923-            "snapshot:Lets your backup / restore an rvm installation in a lightweight manner."
1924-            "disk-usage:Tells you how much disk space rvm install is using."
1925-            "tools:Provides general information about the ruby environment, primarily useful when scripting rvm."
1926-            "docs:Tools to make installing ri and rdoc documentation easier."
1927-            "rvmrc:Tools related to managing rvmrc trust and loading."
1928-            "exec:runs an arbitrary command as a set operation."
1929-            "ruby:runs a named ruby file against specified and/or all rubies"
1930-            "gem:runs a gem command using selected ruby's 'gem'"
1931-            "rake:runs a rake task against specified and/or all rubies"
1932-            "tests:runs 'rake test' across selected ruby versions"
1933-            "specs:runs 'rake spec' across selected ruby versions"
1934-            "monitor:Monitor cwd for testing, run rake {spec,test} on changes."
1935-            "gemset:gemsets: http://rvm.beginrescueend.com/gemsets/"
1936-            "rubygems:Switches the installed version of rubygems for the current ruby."
1937-            "gemdir:display the path to the current gem directory (GEM_HOME)."
1938-            "srcdir:display the path to rvm source directory (may be yanked)"
1939-            "fetch:Performs an archive / src fetch only of the selected ruby."
1940-            "list:show currently installed rubies, interactive output."
1941-            "package:Install a dependency package {readline,iconv,zlib,openssl}"
1942-            "notes:Display notes, with operating system specifics."
1943-            "export:Temporarily set an environment variable in the current shell."
1944-            "unexport:Undo changes made to the environment by 'rvm export'."
1945-        )
1946-		_describe -t commands 'rvm command' cmds && ret=0
1947-		;;
1948-	args)
1949-		case $line[1] in
1950-			(use|uninstall|remove|list)
1951-				_values -S , 'rubies' $(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') default system && ret=0
1952-				;;
1953-			(install|fetch)
1954-				_values -S , 'rubies' $(rvm list known_strings) && ret=0
1955-				;;
1956-			gemset)
1957-				if (( CURRENT == 3 )); then
1958-					_values 'gemset_commands' \
1959-                        'import' \
1960-                        'export' \
1961-                        'create' \
1962-                        'copy' \
1963-                        'rename' \
1964-                        'empty' \
1965-                        'delete' \
1966-                        'name' \
1967-                        'dir' \
1968diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
1969index 604c0071393b07f0edcc6dbd80a4c6b0d290e7cd..1ab800b0f9c9ee12a63a823b6a4660e5bfa23618 100644
1970--- a/plugins/rvm/rvm.plugin.zsh
1971+++ b/plugins/rvm/rvm.plugin.zsh
1972@@ -1,8 +1,10 @@
1973+fpath=($rvm_path/scripts/zsh/Completion $fpath)
1974+
1975 alias rubies='rvm list rubies'
1976 alias gemsets='rvm gemset list'
1977 
1978 local ruby18='ruby-1.8.7-p334'
1979-local ruby19='ruby-1.9.2-p180'
1980+local ruby19='ruby-1.9.3-p194'
1981 
1982 function rb18 {
1983 	if [ -z "$1" ]; then
1984@@ -42,3 +44,8 @@ function gems {
1985 		-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
1986 		-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
1987 }
1988+
1989+function _rvm_completion {
1990+  source $rvm_path"/scripts/zsh/Completion/_rvm"
1991+}
1992+compdef _rvm_completion rvm
1993diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh
1994index 98178e807cce8d2f9363c0dda5d53bbc8466456d..7009e7a91bcdf1294353af7e9394b2ef97feedeb 100644
1995--- a/plugins/screen/screen.plugin.zsh
1996+++ b/plugins/screen/screen.plugin.zsh
1997@@ -1,6 +1,6 @@
1998 # if using GNU screen, let the zsh tell screen what the title and hardstatus
1999 # of the tab window should be.
2000-if [[ $TERM == "screen" ]]; then
2001+if [[ "$TERM" == screen* ]]; then
2002   if [[ $_GET_PATH == '' ]]; then
2003     _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^\/home\//~/;s/^~$USER/~/"'
2004   fi