6952105bfe1fd4121fd355dc5f8ec5e03de5541c

Author
Pavol Juhas <pavol.juhas@gmail.com>
Committer
Pavol Juhas <pavol.juhas@gmail.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/MIT-LICENSE.txt b/MIT-LICENSE.txt
   2index f6edab65be3f5703ec53770faf794d29a9aa1cd6..6eb8aab34f66de325a336c327b9abb1b476e6ad3 100644
   3--- a/MIT-LICENSE.txt
   4+++ b/MIT-LICENSE.txt
   5@@ -1,6 +1,6 @@
   6 The MIT License
   7 
   8-Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
   9+Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
  10 
  11 Permission is hereby granted, free of charge, to any person obtaining a copy
  12 of this software and associated documentation files (the "Software"), to deal
  13diff --git a/README.textile b/README.textile
  14index 81056948611083793e95c6e021f65f460c99ee9f..c808fb5d706fb5e8760cba4b1c45ed14583e44bd 100644
  15--- a/README.textile
  16+++ b/README.textile
  17@@ -14,15 +14,25 @@ You can install this via the command line with either `curl` or `wget`.
  18 
  19 h4. via `curl`
  20 
  21-@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
  22+@curl -L http://install.ohmyz.sh | sh@
  23 
  24 h4. via `wget`
  25 
  26-@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
  27+@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
  28 
  29-h3. The manual way
  30+h4. Optional: change the install directory
  31+
  32+The default location is `~/.oh-my-zsh` (hidden in your home directory).
  33+
  34+You can change the install directory with the ZSH environment variable, either
  35+by running `export ZSH=/your/path` before installing, or setting it before the
  36+end of the install pipeline like this:
  37+
  38+@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
  39 
  40 
  41+h3. The manual way
  42+
  43 1. Clone the repository
  44 
  45   @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
  46@@ -35,7 +45,6 @@ h3. The manual way
  47 
  48   @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
  49 
  50-
  51 4. Set zsh as your default shell:
  52 
  53   @chsh -s /bin/zsh@
  54@@ -46,6 +55,8 @@ h3. Problems?
  55 
  56 You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
  57 
  58+If you installed manually or changed the install location, check ZSH in ~/.zshrc
  59+
  60 h2. Usage
  61 
  62 * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
  63diff --git a/lib/aliases.zsh b/lib/aliases.zsh
  64index b279bf85566ef4ce489d8c4f97b624ccf92dc41f..3044c966099cd8b1ac397859d5ad98af08309e3b 100644
  65--- a/lib/aliases.zsh
  66+++ b/lib/aliases.zsh
  67@@ -27,9 +27,9 @@ else
  68 fi
  69 # List direcory contents
  70 alias lsa='ls -lah'
  71-alias l='ls -la'
  72-alias ll='ls -l'
  73-alias la='ls -lA'
  74+alias l='ls -lah'
  75+alias ll='ls -lh'
  76+alias la='ls -lAh'
  77 alias sl=ls # often screw this up
  78 
  79 alias afind='ack-grep -il'
  80diff --git a/lib/completion.zsh b/lib/completion.zsh
  81index e0cdcf626bfaf6250818f983e2bc954ec2fb6f53..c54249c527b04b4c51ef014f2d9cdeddcf7ee252 100644
  82--- a/lib/completion.zsh
  83+++ b/lib/completion.zsh
  84@@ -31,35 +31,20 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm
  85 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
  86 cdpath=(.)
  87 
  88-# use /etc/hosts and known_hosts for hostname completion
  89-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
  90-[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  91-[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
  92-[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
  93-hosts=(
  94-  "$_ssh_config[@]"
  95-  "$_global_ssh_hosts[@]"
  96-  "$_ssh_hosts[@]"
  97-  "$_etc_hosts[@]"
  98-  "$HOST"
  99-  localhost
 100-)
 101-zstyle ':completion:*:hosts' hosts $hosts
 102-zstyle ':completion:*' users off
 103-
 104 # Use caching so that commands like apt and dpkg complete are useable
 105 zstyle ':completion::complete:*' use-cache 1
 106 zstyle ':completion::complete:*' cache-path $ZSH/cache/
 107 
 108 # Don't complete uninteresting users
 109 zstyle ':completion:*:*:*:users' ignored-patterns \
 110-        adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
 111-        dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
 112-        hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
 113-        mailman mailnull mldonkey mysql nagios \
 114-        named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
 115-        operator pcap postfix postgres privoxy pulse pvm quagga radvd \
 116-        rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
 117+        adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
 118+        clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
 119+        gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
 120+        ldap lp mail mailman mailnull man messagebus  mldonkey mysql nagios \
 121+        named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
 122+        operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
 123+        rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
 124+        usbmux uucp vcsa wwwrun xfs
 125 
 126 # ... unless we really want to.
 127 zstyle '*' single-ignored show
 128diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
 129index 49f80c8f34e22b2338ead858028a55485bb8f823..94f1842f37b5f38a5c6387ec6aae243af0820e34 100644
 130--- a/lib/key-bindings.zsh
 131+++ b/lib/key-bindings.zsh
 132@@ -1,34 +1,43 @@
 133-# TODO: Explain what some of this does..
 134-
 135-bindkey -e
 136-bindkey '\ew' kill-region
 137-bindkey -s '\el' "ls\n"
 138-bindkey '^r' history-incremental-search-backward
 139-bindkey "^[[5~" up-line-or-history
 140-bindkey "^[[6~" down-line-or-history
 141-
 142-# make search up and down work, so partially type and hit up/down to find relevant stuff
 143-bindkey '^[[A' up-line-or-search
 144-bindkey '^[[B' down-line-or-search
 145-
 146-bindkey "^[[H" beginning-of-line
 147-bindkey "^[[1~" beginning-of-line
 148-bindkey "^[OH" beginning-of-line
 149-bindkey "^[[F"  end-of-line
 150-bindkey "^[[4~" end-of-line
 151-bindkey "^[OF" end-of-line
 152-bindkey ' ' magic-space    # also do history expansion on space
 153-
 154-bindkey "^[[1;5C" forward-word
 155-bindkey "^[[1;5D" backward-word
 156-
 157-bindkey '^[[Z' reverse-menu-complete
 158-
 159-# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
 160-bindkey '^?' backward-delete-char
 161-bindkey "^[[3~" delete-char
 162-bindkey "^[3;5~" delete-char
 163-bindkey "\e[3~" delete-char
 164+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
 165+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
 166+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
 167+
 168+# Make sure that the terminal is in application mode when zle is active, since
 169+# only then values from $terminfo are valid
 170+if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
 171+  function zle-line-init() {
 172+    echoti smkx
 173+  }
 174+  function zle-line-finish() {
 175+    echoti rmkx
 176+  }
 177+  zle -N zle-line-init
 178+  zle -N zle-line-finish
 179+fi
 180+
 181+bindkey -e                                          # Use emacs key bindings
 182+
 183+bindkey '\ew' kill-region                           # [Esc-w] - Kill from the cursor to the mark
 184+bindkey -s '\el' 'ls\n'                             # [Esc-l] - run command: ls
 185+bindkey '^r' history-incremental-search-backward    # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
 186+bindkey "${terminfo[kpp]}" up-line-or-history       # [PageUp] - Up a line of history
 187+bindkey "${terminfo[knp]}" down-line-or-history     # [PageDown] - Down a line of history
 188+
 189+bindkey "${terminfo[kcuu1]}" up-line-or-search      # start typing + [Up-Arrow] - fuzzy find history forward
 190+bindkey "${terminfo[kcud1]}" down-line-or-search    # start typing + [Down-Arrow] - fuzzy find history backward
 191+
 192+bindkey "${terminfo[khome]}" beginning-of-line      # [Home] - Go to beginning of line
 193+bindkey "${terminfo[kend]}"  end-of-line            # [End] - Go to end of line
 194+
 195+bindkey ' ' magic-space                             # [Space] - do history expansion
 196+
 197+bindkey '^[[1;5C' forward-word                      # [Ctrl-RightArrow] - move forward one word
 198+bindkey '^[[1;5D' backward-word                     # [Ctrl-LeftArrow] - move backward one word
 199+
 200+bindkey "${terminfo[kcbt]}" reverse-menu-complete   # [Shift-Tab] - move through the completion menu backwards
 201+
 202+bindkey '^?' backward-delete-char                   # [Backspace] - delete backward
 203+bindkey "${terminfo[kdch1]}" delete-char            # [Delete] - delete forward
 204 
 205 # Edit the current command line in $EDITOR
 206 autoload -U edit-command-line
 207diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
 208new file mode 100644
 209index 0000000000000000000000000000000000000000..335c02a3d03867efa8674d778189d82a377896c6
 210--- /dev/null
 211+++ b/lib/prompt_info_functions.zsh
 212@@ -0,0 +1,33 @@
 213+# *_prompt_info functions for usage in your prompt
 214+#
 215+# Plugin creators, please add your *_prompt_info function to the list
 216+# of dummy implementations to help theme creators not receiving errors
 217+# without the need of implementing conditional clauses.
 218+#
 219+# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
 220+# git_prompt_info, bzr_prompt_info and nvm_prompt_info
 221+
 222+# Dummy implementations that return false to prevent command_not_found
 223+# errors with themes, that implement these functions
 224+# Real implementations will be used when the respective plugins are loaded
 225+function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
 226+  rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
 227+  virtualenv_prompt_info {
 228+  return 1
 229+}
 230+
 231+# oh-my-zsh supports an rvm prompt by default
 232+# get the name of the rvm ruby version
 233+function rvm_prompt_info() {
 234+  [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
 235+  local rvm_prompt
 236+  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
 237+  [[ "${rvm_prompt}x" == "x" ]] && return 1
 238+  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 239+}
 240+
 241+# use this to enable users to see their ruby version, no matter which
 242+# version management system they use
 243+function ruby_prompt_info() {
 244+  echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
 245+}
 246diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh
 247deleted file mode 100644
 248index a8b6c323ccae4f9bbe3f4955e258b88463b14e60..0000000000000000000000000000000000000000
 249--- a/lib/rbenv.zsh
 250+++ /dev/null
 251@@ -1,2 +0,0 @@
 252-# using the rbenv plugin will override this with a real implementation
 253-function rbenv_prompt_info() {}
 254diff --git a/lib/rvm.zsh b/lib/rvm.zsh
 255deleted file mode 100644
 256index e8744e61e373799201c3d55f4777f47be8728135..0000000000000000000000000000000000000000
 257--- a/lib/rvm.zsh
 258+++ /dev/null
 259@@ -1,8 +0,0 @@
 260-# get the name of the ruby version
 261-function rvm_prompt_info() {
 262-  [ -f $HOME/.rvm/bin/rvm-prompt ] || return
 263-  local rvm_prompt
 264-  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
 265-  [[ "${rvm_prompt}x" == "x" ]] && return
 266-  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 267-}
 268diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 269index 80319e1a86966b4a763c9b6a4209607a99b7a4b1..5f2fe63d422f6b0df580092fe8c51f0d67ed9fe6 100644
 270--- a/lib/termsupport.zsh
 271+++ b/lib/termsupport.zsh
 272@@ -27,9 +27,8 @@ function omz_termsupport_preexec {
 273   emulate -L zsh
 274   setopt extended_glob
 275   local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 276-  local LINE="${2:gs/$/\\$}"
 277-  LINE="${LINE:gs/%/%%}"
 278-  title "$CMD" "%100>...>$LINE%<<"
 279+  local LINE="${2:gs/%/%%}"
 280+  title '$CMD' '%100>...>$LINE%<<'
 281 }
 282 
 283 autoload -U add-zsh-hook
 284diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh
 285new file mode 100644
 286index 0000000000000000000000000000000000000000..048fd75219fd48d3e4d0b6d0caf29d091c350d68
 287--- /dev/null
 288+++ b/plugins/atom/atom.plugin.zsh
 289@@ -0,0 +1,4 @@
 290+#
 291+# Your guess is as good as mine. Let's just assume that we will need this...
 292+#   - For more info visit... http://atom.io/
 293+#
 294diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 295new file mode 100644
 296index 0000000000000000000000000000000000000000..3f7fb199581c399916ceae46ff60ef3c3edd7485
 297--- /dev/null
 298+++ b/plugins/aws/aws.plugin.zsh
 299@@ -0,0 +1,17 @@
 300+export AWS_HOME=~/.aws
 301+
 302+function agp {
 303+  echo $AWS_DEFAULT_PROFILE
 304+  
 305+}
 306+function asp {
 307+  export AWS_DEFAULT_PROFILE=$1
 308+    export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
 309+    
 310+}
 311+function aws_profiles {
 312+  reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
 313+}
 314+
 315+compctl -K aws_profiles asp
 316+source `which aws_zsh_completer.sh`
 317diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
 318index 16ad3e6510a6937f528fb120740bc4efcfd592d5..b16a75c5b1cb07466b83673c32e29183dbe7a684 100644
 319--- a/plugins/battery/battery.plugin.zsh
 320+++ b/plugins/battery/battery.plugin.zsh
 321@@ -17,12 +17,16 @@ if [[ $(uname) == "Darwin" ]] ; then
 322     integer i=$(((currentcapacity/maxcapacity) * 100))
 323     echo $i
 324   }
 325+
 326+  function plugged_in() {
 327+    [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
 328+  }
 329   
 330   function battery_pct_remaining() {
 331-    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
 332-      battery_pct
 333-    else
 334+    if plugged_in ; then
 335       echo "External Power"
 336+    else
 337+      battery_pct
 338     fi
 339   }
 340 
 341@@ -30,7 +34,11 @@ if [[ $(uname) == "Darwin" ]] ; then
 342   	local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
 343     if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
 344       timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
 345-      echo "~$((timeremaining / 60)):$((timeremaining % 60))"
 346+      if [ $timeremaining -gt 720 ] ; then
 347+        echo "::"
 348+      else
 349+        echo "~$((timeremaining / 60)):$((timeremaining % 60))"
 350+      fi
 351     else
 352       echo "∞"
 353     fi
 354@@ -58,9 +66,19 @@ if [[ $(uname) == "Darwin" ]] ; then
 355 
 356 elif [[ $(uname) == "Linux"  ]] ; then
 357 
 358+  function battery_is_charging() {
 359+    ! [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
 360+  }
 361+
 362+  function battery_pct() {
 363+    echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" 
 364+  }
 365+
 366   function battery_pct_remaining() {
 367-    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
 368-      echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" 
 369+    if [ ! $(battery_is_charging) ] ; then
 370+      battery_pct
 371+    else
 372+      echo "External Power"
 373     fi
 374   }
 375 
 376@@ -86,15 +104,6 @@ elif [[ $(uname) == "Linux"  ]] ; then
 377     fi
 378   }
 379   
 380-  function battery_pct() {
 381-    # todo for on linux
 382-  }
 383-  
 384-  function battery_is_charging() {
 385-    # todo on linux
 386-	false
 387-  }
 388-
 389 else
 390   # Empty functions so we don't cause errors in prompts
 391   function battery_pct_remaining() {
 392diff --git a/plugins/brew/_brew b/plugins/brew/_brew
 393index a25caf40c11c9b236d5ce535a9d681b6fe362fa9..9eb3bb557c261e27d853c68e5a396e5ad4bc0596 100644
 394--- a/plugins/brew/_brew
 395+++ b/plugins/brew/_brew
 396@@ -11,10 +11,25 @@ _brew_installed_formulae() {
 397   installed_formulae=(`brew list`)
 398 }
 399 
 400+_brew_installed_taps() {
 401+  installed_taps=(`brew tap`)
 402+}
 403+
 404+_brew_outdated_formulae() {
 405+  outdated_formulae=(`brew outdated`)
 406+}
 407+
 408+_brew_running_services() {
 409+  running_services=(`brew services list | awk '{print $1}'`)
 410+}
 411+
 412 local -a _1st_arguments
 413 _1st_arguments=(
 414+  'audit:check formulae for Homebrew coding style'
 415+  'bundle:look for a Brewfile and run each line as a brew command'
 416   'cat:display formula file for a formula'
 417   'cleanup:uninstall unused and old versions of packages'
 418+  'commands:show a list of commands'
 419   'create:create a new formula'
 420   'deps:list dependencies and dependants of a formula'
 421   'doctor:audits your installation for common issues'
 422@@ -22,26 +37,38 @@ _1st_arguments=(
 423   'home:visit the homepage of a formula or the brew project'
 424   'info:information about a formula'
 425   'install:install a formula'
 426+  'reinstall:install a formula anew; re-using its current options'
 427   'link:link a formula'
 428   'list:list files in a formula or not-installed formulae'
 429   'log:git commit log for a formula'
 430   'missing:check all installed formuale for missing dependencies.'
 431-  'options:display install options specific to formula.'
 432-  'outdated:list formulas for which a newer version is available'
 433+  'outdated:list formulae for which a newer version is available'
 434+  'pin:pin specified formulae'
 435   'prune:remove dead links'
 436-  'reinstall:reinstall a formula'
 437   'remove:remove a formula'
 438   'search:search for a formula (/regex/ or string)'
 439   'server:start a local web app that lets you browse formulae (requires Sinatra)'
 440+  'services:small wrapper around `launchctl` for supported formulae'
 441+  'tap:tap a new formula repository from GitHub, or list existing taps'
 442   'unlink:unlink a formula'
 443+  'unpin:unpin specified formulae'
 444+  'untap:remove a tapped repository'
 445   'update:freshen up links'
 446   'upgrade:upgrade outdated formulae'
 447-  'uses:show formulas which depend on a formula'
 448-  'versions:show all available formula versions'
 449+  'uses:show formulae which depend on a formula'
 450+)
 451+
 452+local -a _service_arguments
 453+_service_arguments=(
 454+  'cleanup:get rid of stale services and unused plists'
 455+  'list:list all services managed by `brew services`'
 456+  'restart:gracefully restart selected service'
 457+  'start:start selected service'
 458+  'stop:stop selected service'
 459 )
 460 
 461 local expl
 462-local -a formulae installed_formulae
 463+local -a formulae installed_formulae installed_taps outdated_formulae running_services
 464 
 465 _arguments \
 466   '(-v)-v[verbose]' \
 467@@ -60,24 +87,41 @@ if (( CURRENT == 1 )); then
 468 fi
 469 
 470 case "$words[1]" in
 471-  search|-S)
 472-    _arguments \
 473-      '(--macports)--macports[search the macports repository]' \
 474-      '(--fink)--fink[search the fink repository]' ;;
 475+  install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
 476+    _brew_all_formulae
 477+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
 478   list|ls)
 479     _arguments \
 480       '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
 481+      '(--pinned)--pinned[list all versions of pinned formulae]' \
 482       '(--versions)--versions[list all installed versions of a formula]' \
 483-      '1: :->forms' &&  return 0
 484+      '1: :->forms' && return 0
 485 
 486       if [[ "$state" == forms ]]; then
 487         _brew_installed_formulae
 488         _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
 489       fi ;;
 490-  install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
 491-    _brew_all_formulae
 492-    _wanted formulae expl 'all formulae' compadd -a formulae ;;
 493-  reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
 494+  remove|rm|uninstall|unlink|cleanup|link|ln|pin|unpin)
 495     _brew_installed_formulae
 496diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 497index 9dfed61a46b0f0bf93f84ae172b6e0704d75fdd8..df30ed7c7063578745d2409d8f826c548182d8f9 100644
 498--- a/plugins/bundler/bundler.plugin.zsh
 499+++ b/plugins/bundler/bundler.plugin.zsh
 500@@ -6,7 +6,7 @@ alias bu="bundle update"
 501 
 502 # The following is based on https://github.com/gma/bundler-exec
 503 
 504-bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
 505+bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife mailcatcher middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma)
 506 
 507 # Remove $UNBUNDLED_COMMANDS from the bundled_commands list
 508 for cmd in $UNBUNDLED_COMMANDS; do
 509diff --git a/plugins/cabal/cabal.plugin.zsh b/plugins/cabal/cabal.plugin.zsh
 510index 8d3c64587155a75a48055fa28d649159d328a874..9f76add7a30a791add54a4b5af864b4d18172262 100644
 511--- a/plugins/cabal/cabal.plugin.zsh
 512+++ b/plugins/cabal/cabal.plugin.zsh
 513@@ -1,3 +1,14 @@
 514+function cabal_sandbox_info() {
 515+    cabal_files=(*.cabal(N))
 516+    if [ $#cabal_files -gt 0 ]; then
 517+        if [ -f cabal.sandbox.config ]; then
 518+            echo "%{$fg[green]%}sandboxed%{$reset_color%}"
 519+        else
 520+            echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
 521+        fi
 522+    fi
 523+}
 524+
 525 function _cabal_commands() {
 526     local ret=1 state
 527     _arguments ':subcommand:->subcommand' && ret=0
 528diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
 529new file mode 100644
 530index 0000000000000000000000000000000000000000..cb92f5986bed461891798be5019ee45b3b53c3d2
 531--- /dev/null
 532+++ b/plugins/catimg/catimg.plugin.zsh
 533@@ -0,0 +1,17 @@
 534+################################################################################
 535+# catimg script by Eduardo San Martin Morote aka Posva                         #
 536+# http://posva.net                                                             #
 537+#                                                                              #
 538+# Ouput the content of an image to the stdout using the 256 colors of the      #
 539+# terminal.                                                                    #
 540+# Github: https://github.com/posva/catimg                                      #
 541+################################################################################
 542+
 543+
 544+function catimg() {
 545+  if [[ -x  `which convert` ]]; then
 546+    zsh $ZSH/plugins/catimg/catimg.sh $@
 547+  else
 548+    echo "catimg need convert (ImageMagick) to work)"
 549+  fi
 550+}
 551diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
 552new file mode 100755
 553index 0000000000000000000000000000000000000000..cd0f2e3335e537083ed6e1211c8e96d3e2a4d0e4
 554--- /dev/null
 555+++ b/plugins/catimg/catimg.sh
 556@@ -0,0 +1,88 @@
 557+################################################################################
 558+# catimg script by Eduardo San Martin Morote aka Posva                         #
 559+# http://posva.net                                                             #
 560+#                                                                              #
 561+# Ouput the content of an image to the stdout using the 256 colors of the      #
 562+# terminal.                                                                    #
 563+# Github: https://github.com/posva/catimg                                      #
 564+################################################################################
 565+
 566+function help() {
 567+  echo "Usage catimg [-h] [-w width] [-c char] img"
 568+  echo "By default char is \"  \" and w is the terminal width"
 569+}
 570+
 571+# VARIABLES
 572+COLOR_FILE=$(dirname $0)/colors.png
 573+CHAR="  "
 574+
 575+WIDTH=""
 576+IMG=""
 577+
 578+while getopts qw:c:h opt; do
 579+  case "$opt" in
 580+    w) WIDTH="$OPTARG" ;;
 581+    c) CHAR="$OPTARG" ;;
 582+    h) help; exit ;;
 583+    *) help ; exit 1;;
 584+    esac
 585+  done
 586+
 587+while [ "$1" ]; do
 588+  IMG="$1"
 589+  shift
 590+done
 591+
 592+if [ "$IMG" = "" -o ! -f "$IMG" ]; then
 593+  help
 594+  exit 1
 595+fi
 596+
 597+if [ ! "$WIDTH" ]; then
 598+  COLS=$(expr $(tput cols) "/" $(echo -n "$CHAR" | wc -c))
 599+else
 600+  COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
 601+fi
 602+WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
 603+if [ "$WIDTH" -gt "$COLS" ]; then
 604+  WIDTH=$COLS
 605+fi
 606+
 607+REMAP=""
 608+if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
 609+  REMAP="-remap $COLOR_FILE"
 610+else
 611+  echo "The version of convert is too old, don't expect good results :(" >&2
 612+  #convert "$IMG" -colors 256 PNG8:tmp.png
 613+  #IMG="tmp.png"
 614+fi
 615+
 616+# Display the image
 617+I=0
 618+convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
 619+sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
 620+while read R G B f; do
 621+  if [ ! "$R" = "NO" ]; then
 622+    if [ "$R" -eq "$G" -a "$G" -eq "$B" ]; then
 623+      ((
 624+      I++,
 625+      IDX = 232 + R * 23 / 255
 626+      ))
 627+    else
 628+      ((
 629+      I++,
 630+      IDX = 16
 631+      + R * 5 / 255 * 36
 632+      + G * 5 / 255 * 6
 633+      + B * 5 / 255
 634+      ))
 635+    fi
 636+    #echo "$R,$G,$B: $IDX"
 637+    echo -ne "\e[48;5;${IDX}m${CHAR}"
 638+  else
 639+    (( I++ ))
 640+    echo -ne "\e[0m${CHAR}"
 641+  fi
 642+  # New lines
 643+  (( $I % $WIDTH )) || echo -e "\e[0m"
 644+done
 645diff --git a/plugins/catimg/colors.png b/plugins/catimg/colors.png
 646new file mode 100644
 647index 0000000000000000000000000000000000000000..5f2c8126bc0d8911a9de5d3ffbd4e37372b41671
 648Binary files /dev/null and b/plugins/catimg/colors.png differ
 649diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
 650index 1e15487ba4768d72b0edfbc3deb4496de888278e..28dfb82a5c53e210a8874e81b3f9ab36c16d7c94 100644
 651--- a/plugins/debian/debian.plugin.zsh
 652+++ b/plugins/debian/debian.plugin.zsh
 653@@ -217,3 +217,11 @@ kerndeb () {
 654         "$revision" kernel_image kernel_headers
 655 }
 656 
 657+# List packages by size
 658+function apt-list-packages {
 659+    dpkg-query -W --showformat='${Installed-Size} ${Package} ${Status}\n' | \
 660+    grep -v deinstall | \
 661+    sort -n | \
 662+    awk '{print $1" "$2}'
 663+}
 664+
 665diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh
 666new file mode 100644
 667index 0000000000000000000000000000000000000000..504d7ec14b3817631b2aff8d36fd8a6c8d227c24
 668--- /dev/null
 669+++ b/plugins/dirhistory/dirhistory.plugin.zsh
 670@@ -0,0 +1,132 @@
 671+## 
 672+#   Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories 
 673+#   that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT.
 674+# 
 675+
 676+dirhistory_past=(`pwd`)
 677+dirhistory_future=()
 678+export dirhistory_past
 679+export dirhistory_future
 680+
 681+export DIRHISTORY_SIZE=30
 682+
 683+# Pop the last element of dirhistory_past. 
 684+# Pass the name of the variable to return the result in. 
 685+# Returns the element if the array was not empty,
 686+# otherwise returns empty string.
 687+function pop_past() {
 688+  eval "$1='$dirhistory_past[$#dirhistory_past]'"
 689+  if [[ $#dirhistory_past -gt 0 ]]; then
 690+    dirhistory_past[$#dirhistory_past]=()
 691+  fi
 692+}
 693+
 694+function pop_future() {
 695+  eval "$1='$dirhistory_future[$#dirhistory_future]'"
 696+  if [[ $#dirhistory_future -gt 0 ]]; then
 697+    dirhistory_future[$#dirhistory_future]=()
 698+  fi
 699+}
 700+
 701+# Push a new element onto the end of dirhistory_past. If the size of the array 
 702+# is >= DIRHISTORY_SIZE, the array is shifted
 703+function push_past() {
 704+  if [[ $#dirhistory_past -ge $DIRHISTORY_SIZE ]]; then
 705+    shift dirhistory_past
 706+  fi
 707+  if [[ $#dirhistory_past -eq 0 || $dirhistory_past[$#dirhistory_past] != "$1" ]]; then
 708+    dirhistory_past+=($1)
 709+  fi
 710+}
 711+
 712+function push_future() {
 713+  if [[ $#dirhistory_future -ge $DIRHISTORY_SIZE ]]; then
 714+    shift dirhistory_future
 715+  fi
 716+  if [[ $#dirhistory_future -eq 0 || $dirhistory_futuret[$#dirhistory_future] != "$1" ]]; then
 717+    dirhistory_future+=($1)
 718+  fi
 719+}
 720+
 721+# Called by zsh when directory changes
 722+function chpwd() {
 723+  push_past `pwd`
 724+  # If DIRHISTORY_CD is not set...
 725+  if [[ -z "${DIRHISTORY_CD+x}" ]]; then
 726+    # ... clear future.
 727+    dirhistory_future=()
 728+  fi
 729+}
 730+
 731+function dirhistory_cd(){
 732+  DIRHISTORY_CD="1"
 733+  cd $1
 734+  unset DIRHISTORY_CD
 735+}
 736+
 737+# Move backward in directory history
 738+function dirhistory_back() {
 739+  local cw=""
 740+  local d=""
 741+  # Last element in dirhistory_past is the cwd.
 742+
 743+  pop_past cw 
 744+  if [[ "" == "$cw" ]]; then
 745+    # Someone overwrote our variable. Recover it.
 746+    dirhistory_past=(`pwd`)
 747+    return
 748+  fi
 749+
 750+  pop_past d
 751+  if [[ "" != "$d" ]]; then
 752+    dirhistory_cd $d
 753+    push_future $cw
 754+  else
 755+    push_past $cw
 756+  fi
 757+}
 758+
 759+
 760+# Move forward in directory history
 761+function dirhistory_forward() {
 762+  local d=""
 763+
 764+  pop_future d
 765+  if [[ "" != "$d" ]]; then
 766+    dirhistory_cd $d
 767+    push_past $d
 768+  fi
 769+}
 770diff --git a/plugins/docker/_docker b/plugins/docker/_docker
 771index f13f876cf9c97af4ed7d8598fba3325f60ac6cca..12eee7a1537e7cde16f086dbcbc4f72940a715e6 100644
 772--- a/plugins/docker/_docker
 773+++ b/plugins/docker/_docker
 774@@ -111,7 +111,7 @@ __ps() {
 775         '-beforeId="[Show only container created before Id, include non-running ones.]' \
 776         '-l[Show only the latest created container, include non-running ones.]' \
 777         '-n=[Show n last created containers, include non-running ones.]' \
 778-        '-notrurrrrnc[Dont truncate output]' \
 779+        '-notrunc[Dont truncate output]' \
 780         '-q[Only display numeric IDs]' \
 781         '-s[Display sizes]' \
 782         '-sinceId="[Show only containers created since Id, include non-running ones.]'
 783diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
 784new file mode 100644
 785index 0000000000000000000000000000000000000000..a3f0085a826ba7817e47bc46f814fb931bd9011e
 786--- /dev/null
 787+++ b/plugins/emacs/emacs.plugin.zsh
 788@@ -0,0 +1,56 @@
 789+# Emacs 23 daemon capability is a killing feature.
 790+# One emacs process handles all your frames whether
 791+# you use a frame opened in a terminal via a ssh connection or X frames
 792+# opened on the same host.
 793+
 794+# Benefits are multiple
 795+# - You don't have the cost of starting Emacs all the time anymore
 796+# - Opening a file is as fast as Emacs does not have anything else to do.
 797+# - You can share opened buffered across opened frames.
 798+# - Configuration changes made at runtime are applied to all frames.
 799+
 800+
 801+if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
 802+    export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh"
 803+
 804+    # set EDITOR if not already defined.
 805+    export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}"
 806+
 807+    alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait"
 808+    alias e=emacs
 809+
 810+    # same than M-x eval but from outside Emacs.
 811+    alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
 812+    # create a new X frame
 813+    alias eframe='emacsclient --alternate-editor "" --create-frame'
 814+
 815+    # to code all night long
 816+    alias emasc=emacs
 817+    alias emcas=emacs
 818+
 819+    # Write to standard output the path to the file
 820+    # opened in the current buffer.
 821+    function efile {
 822+        local cmd="(buffer-file-name (window-buffer))"
 823+        "$EMACS_PLUGIN_LAUNCHER" --eval "$cmd" | tr -d \"
 824+    }
 825+
 826+    # Write to standard output the directory of the file
 827+    # opened in the the current buffer
 828+    function ecd {
 829+        local cmd="(let ((buf-name (buffer-file-name (window-buffer))))
 830+                     (if buf-name (file-name-directory buf-name)))"
 831+
 832+        local dir="$($EMACS_PLUGIN_LAUNCHER --eval $cmd | tr -d \")"
 833+        if [ -n "$dir" ] ;then
 834+            echo "$dir"
 835+        else
 836+            echo "can not deduce current buffer filename." >/dev/stderr
 837+            return 1
 838+        fi
 839+    }
 840+fi
 841+
 842+## Local Variables:
 843+## mode: sh
 844+## End:
 845diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
 846new file mode 100755
 847index 0000000000000000000000000000000000000000..38d419813f8e21d37feb6f032ee250abdc4bf748
 848--- /dev/null
 849+++ b/plugins/emacs/emacsclient.sh
 850@@ -0,0 +1,12 @@
 851+#!/bin/sh
 852+
 853+# get list of available X windows.
 854+x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
 855+
 856+if [ -z "$x" ] ;then
 857+    # Create one if there is no X window yet.
 858+    emacsclient --alternate-editor "" --create-frame "$@"
 859+else
 860+    # prevent creating another X frame if there is at least one present.
 861+    emacsclient --alternate-editor "" "$@"
 862+fi
 863diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
 864new file mode 100644
 865index 0000000000000000000000000000000000000000..938f5c993fe084fe77aa36410c6147583ca9c7e4
 866--- /dev/null
 867+++ b/plugins/gem/gem.plugin.zsh
 868@@ -0,0 +1,7 @@
 869+alias gemb="gem build *.gemspec"
 870+alias gemp="gem push *.gem"
 871+
 872+# gemy GEM 0.0.0 = gem yank GEM -v 0.0.0
 873+function gemy {
 874+	gem yank $1 -v $2
 875+}
 876diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
 877index ee6fab9bd64a2201d47a66767fb4a40988f4aa87..ef894bff248e37b9175ee4002dc244dafc2cea68 100644
 878--- a/plugins/git-prompt/gitstatus.py
 879+++ b/plugins/git-prompt/gitstatus.py
 880@@ -1,20 +1,30 @@
 881 #!/usr/bin/env python
 882 # -*- coding: UTF-8 -*-
 883+from subprocess import Popen, PIPE
 884+import re
 885 
 886 # change those symbols to whatever you prefer
 887-symbols = {'ahead of': '↑', 'behind': '↓', 'staged':'♦', 'changed':'‣', 'untracked':'…', 'clean':'⚡', 'unmerged':'≠', 'sha1':':'}
 888-
 889-from subprocess import Popen, PIPE
 890+symbols = {
 891+    'ahead of': '↑',
 892+    'behind': '↓',
 893+    'staged': '♦',
 894+    'changed': '‣',
 895+    'untracked': '…',
 896+    'clean': '⚡',
 897+    'unmerged': '≠',
 898+    'sha1': ':'
 899+}
 900 
 901-output,error = Popen(['git','status'], stdout=PIPE, stderr=PIPE).communicate()
 902+output, error = Popen(
 903+    ['git', 'status'], stdout=PIPE, stderr=PIPE).communicate()
 904 
 905 if error:
 906-	import sys
 907-	sys.exit(0)
 908+    import sys
 909+    sys.exit(0)
 910 lines = output.splitlines()
 911 
 912-import re
 913-behead_re = re.compile(r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
 914+behead_re = re.compile(
 915+    r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
 916 diverge_re = re.compile(r"^# and have (\d+) and (\d+) different")
 917 
 918 status = ''
 919@@ -23,46 +33,50 @@ changed = re.compile(r'^# Changed but not updated:$', re.MULTILINE)
 920 untracked = re.compile(r'^# Untracked files:$', re.MULTILINE)
 921 unmerged = re.compile(r'^# Unmerged paths:$', re.MULTILINE)
 922 
 923+
 924 def execute(*command):
 925-	out, err = Popen(stdout=PIPE, stderr=PIPE, *command).communicate()
 926-	if not err:
 927-		nb = len(out.splitlines())
 928-	else:
 929-		nb = '?'
 930-	return nb
 931+    out, err = Popen(stdout=PIPE, stderr=PIPE, *command).communicate()
 932+    if not err:
 933+        nb = len(out.splitlines())
 934+    else:
 935+        nb = '?'
 936+    return nb
 937 
 938 if staged.search(output):
 939-	nb = execute(['git','diff','--staged','--name-only','--diff-filter=ACDMRT'])
 940-	status += '%s%s' % (symbols['staged'], nb)
 941+    nb = execute(
 942+        ['git', 'diff', '--staged', '--name-only', '--diff-filter=ACDMRT'])
 943+    status += '%s%s' % (symbols['staged'], nb)
 944 if unmerged.search(output):
 945-	nb = execute(['git','diff', '--staged','--name-only', '--diff-filter=U'])
 946-	status += '%s%s' % (symbols['unmerged'], nb)
 947+    nb = execute(['git', 'diff', '--staged', '--name-only', '--diff-filter=U'])
 948+    status += '%s%s' % (symbols['unmerged'], nb)
 949 if changed.search(output):
 950-	nb = execute(['git','diff','--name-only', '--diff-filter=ACDMRT'])
 951-	status += '%s%s' % (symbols['changed'], nb)
 952+    nb = execute(['git', 'diff', '--name-only', '--diff-filter=ACDMRT'])
 953+    status += '%s%s' % (symbols['changed'], nb)
 954 if untracked.search(output):
 955-## 		nb = len(Popen(['git','ls-files','--others','--exclude-standard'],stdout=PIPE).communicate()[0].splitlines())
 956-## 		status += "%s" % (symbols['untracked']*(nb//3 + 1), )
 957-	status += symbols['untracked']
 958+    status += symbols['untracked']
 959 if status == '':
 960-	status = symbols['clean']
 961+    status = symbols['clean']
 962 
 963 remote = ''
 964 
 965 bline = lines[0]
 966 if bline.find('Not currently on any branch') != -1:
 967-	branch = symbols['sha1']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1]
 968+    branch = symbols['sha1'] + Popen([
 969+        'git',
 970+        'rev-parse',
 971+        '--short',
 972+        'HEAD'], stdout=PIPE).communicate()[0][:-1]
 973 else:
 974-	branch = bline.split(' ')[3]
 975-	bstatusline = lines[1]
 976-	match = behead_re.match(bstatusline)
 977-	if match:
 978-		remote = symbols[match.groups()[0]]
 979-		remote += match.groups()[2]
 980diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 981index 1285a32476b763b64d98a29b79a5388bf50fa8cf..2b5983f33922a7728634e1f308dd9b2be64161d8 100644
 982--- a/plugins/git/git.plugin.zsh
 983+++ b/plugins/git/git.plugin.zsh
 984@@ -62,8 +62,10 @@ alias glgg='git log --graph --max-count=10'
 985 compdef _git glgg=git-log
 986 alias glgga='git log --graph --decorate --all'
 987 compdef _git glgga=git-log
 988-alias glo='git log --oneline'
 989+alias glo='git log --oneline --decorate --color'
 990 compdef _git glo=git-log
 991+alias glog='git log --oneline --decorate --color --graph'
 992+compdef _git glog=git-log
 993 alias gss='git status -s'
 994 compdef _git gss=git-status
 995 alias ga='git add'
 996diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git
 997index cf8116d4770c5924eaa647763d2bfae3dc14bacf..fac5e711ebbbd074366d89848165e0f9dbc36c36 100644
 998--- a/plugins/gitfast/_git
 999+++ b/plugins/gitfast/_git
1000@@ -2,18 +2,19 @@
1001 
1002 # zsh completion wrapper for git
1003 #
1004-# You need git's bash completion script installed somewhere, by default on the
1005-# same directory as this script.
1006+# Copyright (c) 2012-2013 Felipe Contreras <felipe.contreras@gmail.com>
1007 #
1008-# If your script is on ~/.git-completion.sh instead, you can configure it on
1009-# your ~/.zshrc:
1010+# You need git's bash completion script installed somewhere, by default it
1011+# would be the location bash-completion uses.
1012+#
1013+# If your script is somewhere else, you can configure it on your ~/.zshrc:
1014 #
1015 #  zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
1016 #
1017-# The recommended way to install this script is to copy to
1018-# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file:
1019+# The recommended way to install this script is to copy to '~/.zsh/_git', and
1020+# then add the following to your ~/.zshrc file:
1021 #
1022-#  fpath=(~/.zsh/completion $fpath)
1023+#  fpath=(~/.zsh $fpath)
1024 
1025 complete ()
1026 {
1027@@ -21,8 +22,23 @@ complete ()
1028 	return 0
1029 }
1030 
1031+zstyle -T ':completion:*:*:git:*' tag-order && \
1032+	zstyle ':completion:*:*:git:*' tag-order 'common-commands'
1033+
1034 zstyle -s ":completion:*:*:git:*" script script
1035-test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
1036+if [ -z "$script" ]; then
1037+	local -a locations
1038+	local e
1039+	locations=(
1040+		'/etc/bash_completion.d/git' # fedora, old debian
1041+		'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
1042+		'/usr/share/bash-completion/git' # gentoo
1043+		$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
1044+		)
1045+	for e in $locations; do
1046+		test -f $e && script="$e" && break
1047+	done
1048+fi
1049 ZSH_VERSION='' . "$script"
1050 
1051 __gitcomp ()
1052@@ -69,18 +85,131 @@ __gitcomp_file ()
1053 	compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
1054 }
1055 
1056+__git_zsh_bash_func ()
1057+{
1058+	emulate -L ksh
1059+
1060+	local command=$1
1061+
1062+	local completion_func="_git_${command//-/_}"
1063+	declare -f $completion_func >/dev/null && $completion_func && return
1064+
1065+	local expansion=$(__git_aliased_command "$command")
1066+	if [ -n "$expansion" ]; then
1067+		completion_func="_git_${expansion//-/_}"
1068+		declare -f $completion_func >/dev/null && $completion_func
1069+	fi
1070+}
1071+
1072+__git_zsh_cmd_common ()
1073+{
1074+	local -a list
1075+	list=(
1076+	add:'add file contents to the index'
1077+	bisect:'find by binary search the change that introduced a bug'
1078+	branch:'list, create, or delete branches'
1079+	checkout:'checkout a branch or paths to the working tree'
1080+	clone:'clone a repository into a new directory'
1081+	commit:'record changes to the repository'
1082+	diff:'show changes between commits, commit and working tree, etc'
1083+	fetch:'download objects and refs from another repository'
1084+	grep:'print lines matching a pattern'
1085+	init:'create an empty Git repository or reinitialize an existing one'
1086+	log:'show commit logs'
1087+	merge:'join two or more development histories together'
1088+	mv:'move or rename a file, a directory, or a symlink'
1089+	pull:'fetch from and merge with another repository or a local branch'
1090+	push:'update remote refs along with associated objects'
1091+	rebase:'forward-port local commits to the updated upstream head'
1092+	reset:'reset current HEAD to the specified state'
1093+	rm:'remove files from the working tree and from the index'
1094+	show:'show various types of objects'
1095+	status:'show the working tree status'
1096+	tag:'create, list, delete or verify a tag object signed with GPG')
1097+	_describe -t common-commands 'common commands' list && _ret=0
1098+}
1099+
1100diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash
1101index 93eba467502282db2697e1cf6c93a6909d35ee5c..5da920ecd9ec1b64760db863d266fdc9c47502de 100644
1102--- a/plugins/gitfast/git-completion.bash
1103+++ b/plugins/gitfast/git-completion.bash
1104@@ -33,8 +33,6 @@ esac
1105 # returns location of .git repo
1106 __gitdir ()
1107 {
1108-	# Note: this function is duplicated in git-prompt.sh
1109-	# When updating it, make sure you update the other one to match.
1110 	if [ -z "${1-}" ]; then
1111 		if [ -n "${__git_dir-}" ]; then
1112 			echo "$__git_dir"
1113@@ -53,19 +51,6 @@ __gitdir ()
1114 	fi
1115 }
1116 
1117-__gitcomp_1 ()
1118-{
1119-	local c IFS=$' \t\n'
1120-	for c in $1; do
1121-		c="$c$2"
1122-		case $c in
1123-		--*=*|*.) ;;
1124-		*) c="$c " ;;
1125-		esac
1126-		printf '%s\n' "$c"
1127-	done
1128-}
1129-
1130 # The following function is based on code from:
1131 #
1132 #   bash_completion - programmable completion functions for bash 3.2+
1133@@ -195,8 +180,18 @@ _get_comp_words_by_ref ()
1134 }
1135 fi
1136 
1137-# Generates completion reply with compgen, appending a space to possible
1138-# completion words, if necessary.
1139+__gitcompadd ()
1140+{
1141+	local i=0
1142+	for x in $1; do
1143+		if [[ "$x" == "$3"* ]]; then
1144+			COMPREPLY[i++]="$2$x$4"
1145+		fi
1146+	done
1147+}
1148+
1149+# Generates completion reply, appending a space to possible completion words,
1150+# if necessary.
1151 # It accepts 1 to 4 arguments:
1152 # 1: List of possible completion words.
1153 # 2: A prefix to be added to each possible completion word (optional).
1154@@ -208,19 +203,25 @@ __gitcomp ()
1155 
1156 	case "$cur_" in
1157 	--*=)
1158-		COMPREPLY=()
1159 		;;
1160 	*)
1161-		local IFS=$'\n'
1162-		COMPREPLY=($(compgen -P "${2-}" \
1163-			-W "$(__gitcomp_1 "${1-}" "${4-}")" \
1164-			-- "$cur_"))
1165+		local c i=0 IFS=$' \t\n'
1166+		for c in $1; do
1167+			c="$c${4-}"
1168+			if [[ $c == "$cur_"* ]]; then
1169+				case $c in
1170+				--*=*|*.) ;;
1171+				*) c="$c " ;;
1172+				esac
1173+				COMPREPLY[i++]="${2-}$c"
1174+			fi
1175+		done
1176 		;;
1177 	esac
1178 }
1179 
1180-# Generates completion reply with compgen from newline-separated possible
1181-# completion words by appending a space to all of them.
1182+# Generates completion reply from newline-separated possible completion words
1183+# by appending a space to all of them.
1184 # It accepts 1 to 4 arguments:
1185 # 1: List of possible completion words, separated by a single newline.
1186 # 2: A prefix to be added to each possible completion word (optional).
1187@@ -231,7 +232,7 @@ __gitcomp ()
1188 __gitcomp_nl ()
1189 {
1190 	local IFS=$'\n'
1191-	COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
1192+	__gitcompadd "$1" "${2-}" "${3-$cur}" "${4- }"
1193 }
1194 
1195 # Generates completion reply with compgen from newline-separated possible
1196@@ -249,106 +250,50 @@ __gitcomp_file ()
1197 	# since tilde expansion is not applied.
1198 	# This means that COMPREPLY will be empty and Bash default
1199 	# completion will be used.
1200-	COMPREPLY=($(compgen -P "${2-}" -W "$1" -- "${3-$cur}"))
1201-
1202-	# Tell Bash that compspec generates filenames.
1203-	compopt -o filenames 2>/dev/null
1204diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh
1205index 65f8368f1a7c010e2ac3dbad73043ebc2035cee6..a81ef5a482d48b114a81e242109e2f0dec0839ed 100644
1206--- a/plugins/gitfast/git-prompt.sh
1207+++ b/plugins/gitfast/git-prompt.sh
1208@@ -3,7 +3,7 @@
1209 # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
1210 # Distributed under the GNU General Public License, version 2.0.
1211 #
1212-# This script allows you to see the current branch in your prompt.
1213+# This script allows you to see repository status in your prompt.
1214 #
1215 # To enable:
1216 #
1217@@ -13,23 +13,27 @@
1218 #    3a) Change your PS1 to call __git_ps1 as
1219 #        command-substitution:
1220 #        Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
1221-#        ZSH:  PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
1222+#        ZSH:  setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
1223 #        the optional argument will be used as format string.
1224-#    3b) Alternatively, if you are using bash, __git_ps1 can be
1225-#        used for PROMPT_COMMAND with two parameters, <pre> and
1226-#        <post>, which are strings you would put in $PS1 before
1227-#        and after the status string generated by the git-prompt
1228-#        machinery.  e.g.
1229-#           PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
1230-#        will show username, at-sign, host, colon, cwd, then
1231-#        various status string, followed by dollar and SP, as
1232-#        your prompt.
1233+#    3b) Alternatively, for a slightly faster prompt, __git_ps1 can
1234+#        be used for PROMPT_COMMAND in Bash or for precmd() in Zsh
1235+#        with two parameters, <pre> and <post>, which are strings
1236+#        you would put in $PS1 before and after the status string
1237+#        generated by the git-prompt machinery.  e.g.
1238+#        Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
1239+#          will show username, at-sign, host, colon, cwd, then
1240+#          various status string, followed by dollar and SP, as
1241+#          your prompt.
1242+#        ZSH:  precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
1243+#          will show username, pipe, then various status string,
1244+#          followed by colon, cwd, dollar and SP, as your prompt.
1245 #        Optionally, you can supply a third argument with a printf
1246 #        format string to finetune the output of the branch status
1247 #
1248-# The argument to __git_ps1 will be displayed only if you are currently
1249-# in a git repository.  The %s token will be the name of the current
1250-# branch.
1251+# The repository status will be displayed only if you are currently in a
1252+# git repository. The %s token is the placeholder for the shown status.
1253+#
1254+# The prompt status always includes the current branch name.
1255 #
1256 # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
1257 # unstaged (*) and staged (+) changes will be shown next to the branch
1258@@ -77,31 +81,8 @@
1259 #
1260 # If you would like a colored hint about the current dirty state, set
1261 # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
1262-# the colored output of "git status -sb".
1263-
1264-# __gitdir accepts 0 or 1 arguments (i.e., location)
1265-# returns location of .git repo
1266-__gitdir ()
1267-{
1268-	# Note: this function is duplicated in git-completion.bash
1269-	# When updating it, make sure you update the other one to match.
1270-	if [ -z "${1-}" ]; then
1271-		if [ -n "${__git_dir-}" ]; then
1272-			echo "$__git_dir"
1273-		elif [ -n "${GIT_DIR-}" ]; then
1274-			test -d "${GIT_DIR-}" || return 1
1275-			echo "$GIT_DIR"
1276-		elif [ -d .git ]; then
1277-			echo .git
1278-		else
1279-			git rev-parse --git-dir 2>/dev/null
1280-		fi
1281-	elif [ -d "$1/.git" ]; then
1282-		echo "$1/.git"
1283-	else
1284-		echo "$1"
1285-	fi
1286-}
1287+# the colored output of "git status -sb" and are available only when
1288+# using __git_ps1 for PROMPT_COMMAND or precmd.
1289 
1290 # stores the divergence from upstream in $p
1291 # used by GIT_PS1_SHOWUPSTREAM
1292@@ -124,7 +105,7 @@ __git_ps1_show_upstream ()
1293 			fi
1294 			;;
1295 		svn-remote.*.url)
1296-			svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
1297+			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
1298 			svn_url_pattern+="\\|$value"
1299 			upstream=svn+git # default upstream is SVN if available, else git
1300 			;;
1301@@ -146,10 +127,11 @@ __git_ps1_show_upstream ()
1302 	svn*)
1303 		# get the upstream from the "git-svn-id: ..." in a commit message
1304 		# (git-svn uses essentially the same procedure internally)
1305-		local svn_upstream=($(git log --first-parent -1 \
1306+		local -a svn_upstream
1307+		svn_upstream=($(git log --first-parent -1 \
1308diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
1309index 66a10cfdb14ca966a6d9a948a58487d63bbed69a..25b1a1e1b42b6bbb25e7273ddf527035c9b31e74 100644
1310--- a/plugins/github/github.plugin.zsh
1311+++ b/plugins/github/github.plugin.zsh
1312@@ -84,5 +84,14 @@ exist_gh() { # [DIRECTORY]
1313     git push -u origin master
1314 }
1315 
1316+# git.io "GitHub URL"
1317+#
1318+# Shorten GitHub url, example:
1319+#   https://github.com/nvogel/dotzsh    >   http://git.io/8nU25w  
1320+# source: https://github.com/nvogel/dotzsh
1321+# documentation: https://github.com/blog/985-git-io-github-url-shortener
1322+#
1323+git.io() {curl -i -s http://git.io -F "url=$1" | grep "Location" | cut -f 2 -d " "}
1324+
1325 # End Functions #############################################################
1326 
1327diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh
1328index 332497cec05298aae79ea6ec24ef9d37a0afb8ac..be037d87a6603bb5fc5a93442615e56d1d0d4165 100644
1329--- a/plugins/gitignore/gitignore.plugin.zsh
1330+++ b/plugins/gitignore/gitignore.plugin.zsh
1331@@ -1,7 +1,7 @@
1332-function gi() { curl http://gitignore.io/api/$@ ;}
1333+function gi() { curl http://www.gitignore.io/api/$@ ;}
1334 
1335 _gitignireio_get_command_list() {
1336-  curl -s http://gitignore.io/api/list | tr "," "\n"
1337+  curl -s http://www.gitignore.io/api/list | tr "," "\n"
1338 }
1339 
1340 _gitignireio () {
1341@@ -9,4 +9,4 @@ _gitignireio () {
1342   compadd -S '' `_gitignireio_get_command_list`
1343 }
1344 
1345-compdef _gitignireio gi
1346+compdef _gitignireio gi
1347diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
1348deleted file mode 100644
1349index 23afa96569e18d426125cd48921786e59a1faa2c..0000000000000000000000000000000000000000
1350--- a/plugins/go/go.plugin.zsh
1351+++ /dev/null
1352@@ -1,151 +0,0 @@
1353-# install in /etc/zsh/zshrc or your personal .zshrc
1354-
1355-# gc
1356-prefixes=(5 6 8)
1357-for p in $prefixes; do
1358-	compctl -g "*.${p}" ${p}l
1359-	compctl -g "*.go" ${p}g
1360-done
1361-
1362-# standard go tools
1363-compctl -g "*.go" gofmt
1364-
1365-# gccgo
1366-compctl -g "*.go" gccgo
1367-
1368-# go tool
1369-__go_tool_complete() {
1370-  typeset -a commands build_flags
1371-  commands+=(
1372-    'build[compile packages and dependencies]'
1373-    'clean[remove object files]'
1374-    'doc[run godoc on package sources]'
1375-    'fix[run go tool fix on packages]'
1376-    'fmt[run gofmt on package sources]'
1377-    'get[download and install packages and dependencies]'
1378-    'help[display help]'
1379-    'install[compile and install packages and dependencies]'
1380-    'list[list packages]'
1381-    'run[compile and run Go program]'
1382-    'test[test packages]'
1383-    'tool[run specified go tool]'
1384-    'version[print Go version]'
1385-    'vet[run go tool vet on packages]'
1386-  )
1387-  if (( CURRENT == 2 )); then
1388-    # explain go commands
1389-    _values 'go tool commands' ${commands[@]}
1390-    return
1391-  fi
1392-  build_flags=(
1393-    '-a[force reinstallation of packages that are already up-to-date]'
1394-    '-n[print the commands but do not run them]'
1395-    "-p[number of parallel builds]:number"
1396-    '-x[print the commands]'
1397-    "-work[print temporary directory name and keep it]"
1398-    "-gcflags[flags for 5g/6g/8g]:flags"
1399-    "-ldflags[flags for 5l/6l/8l]:flags"
1400-    "-gccgoflags[flags for gccgo]:flags"
1401-  )
1402-  __go_list() {
1403-      local expl importpaths
1404-      declare -a importpaths
1405-      importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
1406-      _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
1407-  }
1408-  case ${words[2]} in
1409-  clean|doc)
1410-      _arguments -s -w : '*:importpaths:__go_list'
1411-      ;;
1412-  fix|fmt|list|vet)
1413-      _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
1414-      ;;
1415-  install)
1416-      _arguments -s -w : ${build_flags[@]} \
1417-        "-v[show package names]" \
1418-	'*:importpaths:__go_list'
1419-      ;;
1420-  get)
1421-      _arguments -s -w : \
1422-        ${build_flags[@]}
1423-      ;;
1424-  build)
1425-      _arguments -s -w : \
1426-        ${build_flags[@]} \
1427-        "-v[show package names]" \
1428-        "-o[output file]:file:_files" \
1429-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1430-      ;;
1431-  test)
1432-      _arguments -s -w : \
1433-        ${build_flags[@]} \
1434-        "-c[do not run, compile the test binary]" \
1435-        "-i[do not run, install dependencies]" \
1436-        "-v[print test output]" \
1437-        "-x[print the commands]" \
1438-        "-short[use short mode]" \
1439-        "-parallel[number of parallel tests]:number" \
1440-        "-cpu[values of GOMAXPROCS to use]:number list" \
1441-        "-run[run tests and examples matching regexp]:regexp" \
1442-        "-bench[run benchmarks matching regexp]:regexp" \
1443-        "-benchtime[run each benchmark during n seconds]:duration" \
1444-        "-timeout[kill test after that duration]:duration" \
1445-        "-cpuprofile[write CPU profile to file]:file:_files" \
1446-        "-memprofile[write heap profile to file]:file:_files" \
1447-        "-memprofilerate[set heap profiling rate]:number" \
1448-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1449-      ;;
1450-  help)
1451-      _values "${commands[@]}" \
1452diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
1453new file mode 120000
1454index 0000000000000000000000000000000000000000..cf943e2e1a98ae9f350f674a322b624e8ad7b1a4
1455--- /dev/null
1456+++ b/plugins/go/go.plugin.zsh
1457@@ -0,0 +1 @@
1458+../golang/golang.plugin.zsh
1459diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
1460index e60c4afe48e0b44cac537422229f8f32943a0349..18bcaaff284dc0e9dff48627826e09f461744682 100644
1461--- a/plugins/golang/golang.plugin.zsh
1462+++ b/plugins/golang/golang.plugin.zsh
1463@@ -1,9 +1,10 @@
1464-# From : http://golang.org/misc/zsh/go?m=text
1465+# install in /etc/zsh/zshrc or your personal .zshrc
1466+
1467 # gc
1468 prefixes=(5 6 8)
1469 for p in $prefixes; do
1470-    compctl -g "*.${p}" ${p}l
1471-    compctl -g "*.go" ${p}g
1472+	compctl -g "*.${p}" ${p}l
1473+	compctl -g "*.go" ${p}g
1474 done
1475 
1476 # standard go tools
1477@@ -19,6 +20,7 @@ __go_tool_complete() {
1478     'build[compile packages and dependencies]'
1479     'clean[remove object files]'
1480     'doc[run godoc on package sources]'
1481+    'env[print Go environment information]'
1482     'fix[run go tool fix on packages]'
1483     'fmt[run gofmt on package sources]'
1484     'get[download and install packages and dependencies]'
1485@@ -39,12 +41,17 @@ __go_tool_complete() {
1486   build_flags=(
1487     '-a[force reinstallation of packages that are already up-to-date]'
1488     '-n[print the commands but do not run them]'
1489-    "-p[number of parallel builds]:number"
1490+    '-p[number of parallel builds]:number'
1491+    '-race[enable data race detection]'
1492     '-x[print the commands]'
1493-    "-work[print temporary directory name and keep it]"
1494-    "-gcflags[flags for 5g/6g/8g]:flags"
1495-    "-ldflags[flags for 5l/6l/8l]:flags"
1496-    "-gccgoflags[flags for gccgo]:flags"
1497+    '-work[print temporary directory name and keep it]'
1498+    '-ccflags[flags for 5c/6c/8c]:flags'
1499+    '-gcflags[flags for 5g/6g/8g]:flags'
1500+    '-ldflags[flags for 5l/6l/8l]:flags'
1501+    '-gccgoflags[flags for gccgo]:flags'
1502+    '-compiler[name of compiler to use]:name'
1503+    '-installsuffix[suffix to add to package directory]:suffix'
1504+    '-tags[list of build tags to consider satisfied]:tags'
1505   )
1506   __go_list() {
1507       local expl importpaths
1508@@ -62,7 +69,7 @@ __go_tool_complete() {
1509   install)
1510       _arguments -s -w : ${build_flags[@]} \
1511         "-v[show package names]" \
1512-    '*:importpaths:__go_list'
1513+        '*:importpaths:__go_list'
1514       ;;
1515   get)
1516       _arguments -s -w : \
1517@@ -87,7 +94,10 @@ __go_tool_complete() {
1518         "-cpu[values of GOMAXPROCS to use]:number list" \
1519         "-run[run tests and examples matching regexp]:regexp" \
1520         "-bench[run benchmarks matching regexp]:regexp" \
1521-        "-benchtime[run each benchmark during n seconds]:duration" \
1522+        "-benchmem[print memory allocation stats]" \
1523+        "-benchtime[run each benchmark until taking this long]:duration" \
1524+        "-blockprofile[write goroutine blocking profile to file]:file" \
1525+        "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \
1526         "-timeout[kill test after that duration]:duration" \
1527         "-cpuprofile[write CPU profile to file]:file:_files" \
1528         "-memprofile[write heap profile to file]:file:_files" \
1529@@ -97,7 +107,7 @@ __go_tool_complete() {
1530   help)
1531       _values "${commands[@]}" \
1532         'gopath[GOPATH environment variable]' \
1533-        'importpath[description of import paths]' \
1534+        'packages[description of package lists]' \
1535         'remote[remote import path syntax]' \
1536         'testflag[description of testing flags]' \
1537         'testfunc[description of testing functions]'
1538@@ -147,4 +157,4 @@ __go_tool_complete() {
1539   esac
1540 }
1541 
1542-compdef __go_tool_complete go
1543+compdef __go_tool_complete go
1544diff --git a/plugins/iwhois/iwhois.plugin.zsh b/plugins/iwhois/iwhois.plugin.zsh
1545new file mode 100644
1546index 0000000000000000000000000000000000000000..38790bf28ad0ce2c5e33d5b1ee10be158ffeb73a
1547--- /dev/null
1548+++ b/plugins/iwhois/iwhois.plugin.zsh
1549@@ -0,0 +1,8 @@
1550+# provide a whois command with a more accurate and up to date list of whois
1551+# servers using CNAMES via whois.geek.nz
1552+
1553+function iwhois() {
1554+    resolver="whois.geek.nz"
1555+    tld=`echo ${@: -1} | awk -F "." '{print $NF}'`
1556+    whois -h ${tld}.${resolver} "$@" ;
1557+}
1558diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
1559index ae065c12f8066f2197af9f24b879c0101e519cb5..1b32ec2e436d2e2f69e983cfde0b3452371c5450 100644
1560--- a/plugins/lol/lol.plugin.zsh
1561+++ b/plugins/lol/lol.plugin.zsh
1562@@ -36,3 +36,15 @@ alias nomnom='killall'
1563 alias byes='exit'
1564 alias cya='reboot'
1565 alias kthxbai='halt'
1566+
1567+alias pwned='ssh'
1568+
1569+alias hackzor='git init'
1570+alias rulz='git push'
1571+alias bringz='git pull'
1572+alias chicken='git add'
1573+alias oanward='git commit -m'
1574+alias ooanward='git commit -am'
1575+alias letcat='git checkout'
1576+alias violenz='git rebase'
1577+
1578diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
1579index d2db89d045018ab33b116f33d18573213b4bde64..2e99a12fbdc3b484f93ab186387896b8337c7ceb 100644
1580--- a/plugins/mercurial/mercurial.plugin.zsh
1581+++ b/plugins/mercurial/mercurial.plugin.zsh
1582@@ -13,7 +13,7 @@ alias hglr='hg pull --rebase'
1583 alias hgo='hg outgoing'
1584 alias hgp='hg push'
1585 alias hgs='hg status'
1586-alias hgsl='log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
1587+alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
1588 # this is the 'git commit --amend' equivalent
1589 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
1590 
1591diff --git a/plugins/meteor/_meteor b/plugins/meteor/_meteor
1592new file mode 100644
1593index 0000000000000000000000000000000000000000..cd7fc304f3219d324fcabe4eb7308219cffbd797
1594--- /dev/null
1595+++ b/plugins/meteor/_meteor
1596@@ -0,0 +1,48 @@
1597+#compdef meteor
1598+#autoload
1599+
1600+# Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
1601+# Original author: Dimitri JORGE (https://github.com/jorge-d)
1602+
1603+_meteor_all_packages() {
1604+  packages=(`meteor list | cut -d" " -f1`)
1605+}
1606+_meteor_installed_packages() {
1607+  installed_packages=(`meteor list --using`)
1608+}
1609+
1610+local -a _1st_arguments
1611+_1st_arguments=(
1612+  'run:[Default] Run this project in local development mode'
1613+  'create:Create a new project'
1614+  'update:Upgrade this project to the latest version of Meteor'
1615+  'add:Add a package to this project'
1616+  'remove:Remove a package from this project'
1617+  'list:List available packages'
1618+  'help:Display Meteor help'
1619+  'bundle:Pack this project up into a tarball'
1620+  'mongo:Connect to the Mongo database for the specified site'
1621+  'deploy:Deploy this project to Meteor'
1622+  'logs:Show logs for specified site'
1623+  'reset:Reset the project state. Erases the local database.'
1624+  'test-packages:Test one or more packages'
1625+)
1626+
1627+local expl
1628+local -a packages installed_packages
1629+
1630+if (( CURRENT == 2 )); then
1631+  _describe -t commands "meteor subcommand" _1st_arguments
1632+  return
1633+fi
1634+
1635+case "$words[2]" in
1636+    help)
1637+      _describe -t commands "meteor subcommand" _1st_arguments ;;
1638+    remove)
1639+      _meteor_installed_packages
1640+      _wanted installed_packages expl 'installed packages' compadd -a installed_packages ;;
1641+    add)
1642+      _meteor_all_packages
1643+      _wanted packages expl 'all packages' compadd -a packages ;;
1644+esac
1645diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
1646index 0c914190762be679ca6e429ac5428ed210b8876c..ed79685344f8cb527c51f2d926b1397d046cf4c6 100644
1647--- a/plugins/mvn/mvn.plugin.zsh
1648+++ b/plugins/mvn/mvn.plugin.zsh
1649@@ -52,6 +52,11 @@ alias mvnc='mvn clean'
1650 alias mvncom='mvn compile'
1651 alias mvnt='mvn test'
1652 alias mvnag='mvn archetype:generate'
1653+alias mvn-updates='mvn versions:display-dependency-updates'
1654+alias mvntc7='mvn tomcat7:run' 
1655+alias mvntc='mvn tomcat:run'
1656+alias mvnjetty='mvn jetty:run'
1657+
1658 
1659 function listMavenCompletions { 
1660      reply=(
1661diff --git a/plugins/pip/_pip b/plugins/pip/_pip
1662index 967da48cad713ffd9bb15bb34968626dd0c072bd..7c1238db7a8f65b97974512e719f9f9b778a907e 100644
1663--- a/plugins/pip/_pip
1664+++ b/plugins/pip/_pip
1665@@ -20,6 +20,7 @@ _1st_arguments=(
1666   'bundle:create pybundles (archives containing multiple packages)'
1667   'freeze:output all currently installed packages (exact versions) to stdout'
1668   'help:show available commands'
1669+  'show:show information about installed packages'
1670   'install:install packages'
1671   'search:search PyPI'
1672   'uninstall:uninstall packages'
1673@@ -76,4 +77,7 @@ case "$words[1]" in
1674   uninstall)
1675     _pip_installed
1676     _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
1677+  show)
1678+    _pip_installed
1679+    _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
1680 esac
1681diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
1682index 23d15a9a1f028086413b660fa3e72d661e2dc932..fb46cdcf0710612900cc298118f96afebddac5da 100644
1683--- a/plugins/rails/rails.plugin.zsh
1684+++ b/plugins/rails/rails.plugin.zsh
1685@@ -1,10 +1,10 @@
1686 function _rails_command () {
1687-  if [ -e "script/server" ]; then
1688-    ruby script/$@
1689+  if [ -e "bin/rails" ]; then
1690+    bin/rails $@
1691   elif [ -e "script/rails" ]; then
1692     ruby script/rails $@
1693-  elif [ -e "bin/rails" ]; then
1694-    bin/rails $@
1695+  elif [ -e "script/server" ]; then
1696+    ruby script/$@
1697   else
1698     rails $@
1699   fi
1700@@ -51,6 +51,7 @@ alias rds='rake db:seed'
1701 alias rdd='rake db:drop'
1702 alias rdtc='rake db:test:clone'
1703 alias rdtp='rake db:test:prepare'
1704+alias rdmtc='rake db:migrate db:test:clone'
1705 
1706 alias rlc='rake log:clear'
1707 alias rn='rake notes'
1708diff --git a/plugins/rake/rake.plugin.zsh b/plugins/rake/rake.plugin.zsh
1709index 16b933c14c104dc953bed61dbe31ff1570cd0904..121150017fc765e342311c28ba108e63c4f2d719 100644
1710--- a/plugins/rake/rake.plugin.zsh
1711+++ b/plugins/rake/rake.plugin.zsh
1712@@ -1,3 +1,7 @@
1713+# Thank you Jim for everything you contributed to the Ruby and open source community 
1714+# over the years. We will miss you dearly.
1715+alias jimweirich="rake"  
1716+
1717 alias rake="noglob rake" # allows square brackts for rake task invocation
1718 alias brake='noglob bundle exec rake' # execute the bundled rake gem
1719 alias srake='noglob sudo rake' # noglob must come before sudo
1720diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
1721index 78f76c3a3882328b91df2a6e895ec74374906824..57ae2ca1fad7a1e76fad8aa4c598d25bfad0869b 100644
1722--- a/plugins/rbenv/rbenv.plugin.zsh
1723+++ b/plugins/rbenv/rbenv.plugin.zsh
1724@@ -10,12 +10,18 @@ FOUND_RBENV=0
1725 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
1726 if _homebrew-installed && _rbenv-from-homebrew-installed ; then
1727     rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
1728+    if [[ $RBENV_ROOT = '' ]]; then 
1729+      RBENV_ROOT="$HOME/.rbenv"
1730+    fi
1731 fi
1732 
1733 for rbenvdir in "${rbenvdirs[@]}" ; do
1734   if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
1735     FOUND_RBENV=1
1736-    export RBENV_ROOT=$rbenvdir
1737+    if [[ $RBENV_ROOT = '' ]]; then
1738+      RBENV_ROOT=$rbenvdir
1739+    fi
1740+    export RBENV_ROOT
1741     export PATH=${rbenvdir}/bin:$PATH
1742     eval "$(rbenv init --no-rehash - zsh)"
1743 
1744diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
1745index a1e64ad0f119fdd627ae8f9a82d41d987d82bb34..2fb8d54624dcfa86b49e53817a7168699ec01bd0 100644
1746--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
1747+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
1748@@ -27,7 +27,7 @@
1749 #   Florent Thoumie and Jonas Pfenniger
1750 #
1751 
1752-local _plugin__ssh_env=$HOME/.ssh/environment-$HOST
1753+local _plugin__ssh_env
1754 local _plugin__forwarding
1755 
1756 function _plugin__start_agent()
1757@@ -42,12 +42,20 @@ function _plugin__start_agent()
1758   . ${_plugin__ssh_env} > /dev/null
1759 
1760   # load identies
1761-  zstyle -a :omz:plugins:ssh-agent identities identities 
1762+  zstyle -a :omz:plugins:ssh-agent identities identities
1763   echo starting ssh-agent...
1764 
1765   /usr/bin/ssh-add $HOME/.ssh/${^identities}
1766 }
1767 
1768+# Get the filename to store/lookup the environment from
1769+if (( $+commands[scutil] )); then
1770+  # It's OS X!
1771+  _plugin__ssh_env="$HOME/.ssh/environment-$(scutil --get ComputerName)"
1772+else
1773+  _plugin__ssh_env="$HOME/.ssh/environment-$HOST"
1774+fi
1775+
1776 # test if agent-forwarding is enabled
1777 zstyle -b :omz:plugins:ssh-agent agent-forwarding _plugin__forwarding
1778 if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then
1779diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
1780index 5662791839d77cdaa1c162ae4f45a98b3c4db554..a2042343a478cc84f91ab8b2c98c7d2204b4d5c7 100755
1781--- a/plugins/sublime/sublime.plugin.zsh
1782+++ b/plugins/sublime/sublime.plugin.zsh
1783@@ -1,25 +1,32 @@
1784 # Sublime Text 2 Aliases
1785 
1786-local _sublime_darwin_paths > /dev/null 2>&1
1787-_sublime_darwin_paths=(
1788-    "/usr/local/bin/subl"
1789-    "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1790-    "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1791-    "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1792-    "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1793-    "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1794-    "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1795-)
1796-
1797 if [[ $('uname') == 'Linux' ]]; then
1798-    if [ -f '/usr/bin/sublime_text' ]; then
1799-        st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
1800-    else
1801-        st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
1802-    fi
1803-    alias st=st_run
1804+    local _sublime_linux_paths > /dev/null 2>&1
1805+    _sublime_linux_paths=(
1806+        "$HOME/bin/sublime_text"
1807+        "/opt/sublime_text/sublime_text"
1808+        "/usr/bin/sublime_text"
1809+        "/usr/local/bin/sublime_text"
1810+    )
1811+    for _sublime_path in $_sublime_linux_paths; do
1812+        if [[ -a $_sublime_path ]]; then
1813+            st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
1814+            alias st=st_run
1815+            break
1816+        fi
1817+    done
1818 
1819 elif  [[ $('uname') == 'Darwin' ]]; then
1820+    local _sublime_darwin_paths > /dev/null 2>&1
1821+    _sublime_darwin_paths=(
1822+        "/usr/local/bin/subl"
1823+        "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1824+        "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1825+        "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1826+        "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1827+        "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1828+        "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1829+    )
1830 
1831     for _sublime_path in $_sublime_darwin_paths; do
1832         if [[ -a $_sublime_path ]]; then
1833diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
1834new file mode 100644
1835index 0000000000000000000000000000000000000000..ea19bcea07f2d71e04a2ad49e5e4811ab4953ea3
1836--- /dev/null
1837+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
1838@@ -0,0 +1,73 @@
1839+# vim:ft=zsh ts=2 sw=2 sts=2 et
1840+#
1841+# Faster alternative to the current SVN plugin implementation.
1842+#
1843+# Works with svn 1.6, 1.7, 1.8.
1844+# Use `svn_prompt_info` method to enquire the svn data.
1845+# It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
1846+# It displays the current status of the local files (added, deleted, modified, replaced, or else...)
1847+#
1848+# Use as a drop-in replacement of the svn plugin not as complementary plugin
1849+
1850+function svn_prompt_info() {
1851+  local info
1852+  info=$(svn info 2>&1) || return 1; # capture stdout and stderr
1853+  local repo_need_upgrade=$(svn_repo_need_upgrade $info)
1854+
1855+  if [[ -n $repo_need_upgrade ]]; then
1856+    printf '%s%s%s%s%s%s%s\n' \
1857+      $ZSH_PROMPT_BASE_COLOR \
1858+      $ZSH_THEME_SVN_PROMPT_PREFIX \
1859+      $ZSH_PROMPT_BASE_COLOR \
1860+      $repo_need_upgrade \
1861+      $ZSH_PROMPT_BASE_COLOR \
1862+      $ZSH_THEME_SVN_PROMPT_SUFFIX \
1863+      $ZSH_PROMPT_BASE_COLOR
1864+  else
1865+    printf '%s%s%s %s%s:%s%s%s%s%s' \
1866+      $ZSH_PROMPT_BASE_COLOR \
1867+      $ZSH_THEME_SVN_PROMPT_PREFIX \
1868+      \
1869+      "$(svn_status_info $info)" \
1870+      $ZSH_PROMPT_BASE_COLOR \
1871+      \
1872+      $ZSH_THEME_BRANCH_NAME_COLOR \
1873+      $(svn_current_branch_name $info) \
1874+      $ZSH_PROMPT_BASE_COLOR \
1875+      \
1876+      $(svn_current_revision $info) \
1877+      $ZSH_PROMPT_BASE_COLOR \
1878+      \
1879+      $ZSH_THEME_SVN_PROMPT_SUFFIX \
1880+      $ZSH_PROMPT_BASE_COLOR
1881+  fi
1882+}
1883+
1884+function svn_repo_need_upgrade() {
1885+  grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
1886+    echo "E155036: upgrade repo with svn upgrade"
1887+}
1888+
1889+function svn_current_branch_name() {
1890+  grep '^URL:' <<< "${1:-$(svn info 2> /dev/null)}" | egrep -o '(tags|branches)/[^/]+|trunk'	
1891+}
1892+
1893+function svn_repo_root_name() {
1894+  grep '^Repository\ Root:' <<< "${1:-$(svn info 2> /dev/null)}" | sed 's#.*/##'
1895+}
1896+
1897+function svn_current_revision() {
1898+  echo "${1:-$(svn info 2> /dev/null)}" | sed -n 's/Revision: //p'
1899+}
1900+
1901+function svn_status_info() {
1902+  local svn_status_string="$ZSH_THEME_SVN_PROMPT_CLEAN"
1903+  local svn_status="$(svn status 2> /dev/null)";
1904+  if grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
1905+  if grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"; fi
1906+  if grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
1907+  if grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"; fi
1908+  if grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
1909+  if grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DIRTY:-'!'}"; fi
1910+  echo $svn_status_string
1911+}
1912diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
1913index 4f008ba4e219d986f9c5515c209ffec68da2a68e..ef6da5bd3cb6e6447e59c224fc8a158ecc1ac590 100644
1914--- a/plugins/svn/svn.plugin.zsh
1915+++ b/plugins/svn/svn.plugin.zsh
1916@@ -9,7 +9,7 @@ function svn_prompt_info() {
1917       _DISPLAY=$(svn_get_repo_name)
1918     fi
1919     echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
1920-$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$ZSH_PROMPT_BASE_COLOR"
1921+$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$(svn_dirty_pwd)$ZSH_PROMPT_BASE_COLOR"
1922     unset _DISPLAY
1923   fi
1924 }
1925@@ -74,3 +74,22 @@ function svn_dirty_choose() {
1926 function svn_dirty() {
1927   svn_dirty_choose $ZSH_THEME_SVN_PROMPT_DIRTY $ZSH_THEME_SVN_PROMPT_CLEAN
1928 }
1929+
1930+function svn_dirty_choose_pwd () {
1931+  if in_svn; then
1932+    root=`pwd`
1933+    if $(svn status $root 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'); then
1934+      # Grep exits with 0 when "One or more lines were selected", return "dirty".
1935+      echo $1
1936+    else
1937+      # Otherwise, no lines were found, or an error occurred. Return clean.
1938+      echo $2
1939+    fi
1940+  fi
1941+}
1942+
1943+function svn_dirty_pwd () {
1944+  svn_dirty_choose_pwd $ZSH_THEME_SVN_PROMPT_DIRTY_PWD $ZSH_THEME_SVN_PROMPT_CLEAN_PWD
1945+}
1946+
1947+
1948diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh
1949index 9505644356e0146cbdb8dbd1e422de9bc156ab36..29df63520684f00cdb86adfea6c5785a816d6c9d 100644
1950--- a/plugins/wd/_wd.sh
1951+++ b/plugins/wd/_wd.sh
1952@@ -1,48 +1,68 @@
1953-#compdef wd.sh
1954-
1955-zstyle ":completion:*:descriptions" format "%B%d%b"
1956-
1957-CONFIG=$HOME/.warprc
1958-
1959-local -a main_commands
1960-main_commands=(
1961-    add:'Adds the current working directory to your warp points'
1962-    #add'\!':'Overwrites existing warp point' # TODO: Fix
1963-    rm:'Removes the given warp point'
1964-    ls:'Outputs all stored warp points'
1965-    show:'Outputs warp points to current directory'
1966-)
1967-
1968-local -a points
1969-while read line
1970-do
1971-    points+=$(awk "{ gsub(/\/Users\/$USER|\/home\/$USER/,\"~\"); print }" <<< $line)
1972-done < $CONFIG
1973-
1974-_wd()
1975-{
1976-    # init variables
1977-    local curcontext="$curcontext" state line
1978-    typeset -A opt_args
1979-
1980-    # init state
1981-    _arguments \
1982-        '1: :->command' \
1983-        '2: :->argument'
1984-
1985-    case $state in
1986-        command)
1987-            compadd "$@" add rm ls show
1988-            _describe -t warp-points 'Warp points:' points && ret=0
1989-            ;;
1990-        argument)
1991-            case $words[2] in
1992-                rm|add!)
1993-                    _describe -t warp-points 'warp points' points && ret=0
1994-                    ;;
1995-                *)
1996-            esac
1997-    esac
1998+#compdef wd
1999+
2000+zstyle ':completion:*:descriptions' format '%B%d%b'
2001+zstyle ':completion::complete:wd:*:commands' group-name commands
2002+zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
2003+zstyle ':completion::complete:wd::' list-grouped
2004+
2005+# Call `_wd()` when when trying to complete the command `wd`
2006+
2007+zmodload zsh/mapfile
2008+function _wd() {
2009+  local ret=1
2010+  local CONFIG=$HOME/.warprc
2011+
2012+  # Stolen from
2013+  # http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands
2014+
2015+  # local curcontext="$curcontext" state line
2016+  # typeset -A opt_args
2017+
2018+  local -a commands
2019+  local -a warp_points
2020+  warp_points=( "${(f)mapfile[$CONFIG]}" )
2021+  # LIST="${mapfile[$FNAME]}" # Not required unless stuff uses it
2022+
2023+  commands=(
2024+    'add:Adds the current working directory to your warp points'
2025+    'add!:Overwrites existing warp point'
2026+    'rm:Removes the given warp point'
2027+    'ls:Outputs all stored warp points'
2028+    'show:Outputs all warp points that point to the current directory'
2029+    'help:Show this extremely helpful text'
2030+    '..:Go back to last directory'
2031+  )
2032+
2033+  _arguments -C \
2034+    '1: :->first_arg' \
2035+    '2: :->second_arg' && ret=0
2036+
2037+  case $state in
2038+    first_arg)
2039+      _describe -t warp_points "Warp points" warp_points && ret=0
2040+      _describe -t commands "Commands" commands && ret=0
2041+      ;;
2042+    second_arg)
2043+      case $words[2] in
2044+        add\!|rm)
2045+          _describe -t points "Warp points" warp_points && ret=0
2046+          ;;
2047+        add)
2048+          _message 'Write the name of your warp point' && ret=0
2049+          ;;
2050+      esac
2051+      ;;
2052diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh
2053index bbec4a7154a58572d74e389251ee1d4747c1aa5a..9800335fc6584ea2ffaed1d81b766c5095a68e18 100755
2054--- a/plugins/wd/wd.plugin.zsh
2055+++ b/plugins/wd/wd.plugin.zsh
2056@@ -6,4 +6,6 @@
2057 #
2058 # @github.com/mfaerevaag/wd
2059 
2060-alias wd='. $ZSH/plugins/wd/wd.sh'
2061+wd() {
2062+    . $ZSH/plugins/wd/wd.sh
2063+}
2064diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
2065index 744f58bc2039a5e1c6054a5ad0aab77fa2aa165f..96a3426fc500115d28bb6282ec673922b63e5503 100755
2066--- a/plugins/wd/wd.sh
2067+++ b/plugins/wd/wd.sh
2068@@ -50,12 +50,12 @@ wd_warp()
2069             wd_print_msg $YELLOW "Warping to current directory?"
2070         else
2071             (( n = $#1 - 1 ))
2072-            wd_print_msg $BLUE "Warping..."
2073+            #wd_print_msg $BLUE "Warping..."
2074             cd -$n > /dev/null
2075         fi
2076     elif [[ ${points[$1]} != "" ]]
2077     then
2078-        wd_print_msg $BLUE "Warping..."
2079+        #wd_print_msg $BLUE "Warping..."
2080         cd ${points[$1]}
2081     else
2082         wd_print_msg $RED "Unkown warp point '$1'"
2083@@ -64,16 +64,16 @@ wd_warp()
2084 
2085 wd_add()
2086 {
2087-    if [[ $1 =~ "^\.+$" ]]
2088+    if [[ $2 =~ "^\.+$" || $2 =~ "^\s*$" ]]
2089     then
2090-        wd_print_msg $RED "Illeagal warp point (see README)."
2091-    elif [[ ${points[$1]} == "" ]] || $2
2092+        wd_print_msg $RED "Illegal warp point (see README)."
2093+    elif [[ ${points[$2]} == "" ]] || $1
2094     then
2095-        wd_remove $1 > /dev/null
2096-        print "$1:$PWD" >> $CONFIG
2097+        wd_remove $2 > /dev/null
2098+        print "$2:$PWD" >> $CONFIG
2099         wd_print_msg $GREEN "Warp point added"
2100     else
2101-        wd_print_msg $YELLOW "Warp point '$1' alredy exists. Use 'add!' to overwrite."
2102+        wd_print_msg $YELLOW "Warp point '$2' already exists. Use 'add!' to overwrite."
2103     fi
2104 }
2105 
2106@@ -83,7 +83,9 @@ wd_remove()
2107     then
2108         if wd_tmp=`sed "/^$1:/d" $CONFIG`
2109         then
2110-            echo $wd_tmp > $CONFIG
2111+            # `>!` forces overwrite
2112+            # we need this if people use `setopt NO_CLOBBER`
2113+            echo $wd_tmp >! $CONFIG
2114             wd_print_msg $GREEN "Warp point removed"
2115         else
2116             wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!"
2117@@ -131,9 +133,9 @@ wd_print_usage()
2118     print "\nCommands:"
2119     print "\t add \t Adds the current working directory to your warp points"
2120     print "\t add! \t Overwrites existing warp point"
2121-    print "\t remove  Removes the given warp point"
2122+    print "\t rm \t  Removes the given warp point"
2123     print "\t show \t Outputs warp points to current directory"
2124-    print "\t list \t Outputs all stored warp points"
2125+    print "\t ls \t Outputs all stored warp points"
2126     print "\t help \t Show this extremely helpful text"
2127 }
2128 
2129@@ -141,7 +143,7 @@ wd_print_usage()
2130 ## run
2131 
2132 # get opts
2133-args=`getopt -o a:r:lhs -l add:,remove:,list,help,show -- $*`
2134+args=`getopt -o a:r:lhs -l add:,rm:,ls,help,show -- $*`
2135 
2136 # check if no arguments were given
2137 if [[ $? -ne 0 || $#* -eq 0 ]]
2138@@ -161,49 +163,40 @@ else
2139 
2140     for i
2141     do
2142-		    case "$i"
2143-		        in
2144-			      -a|--add|add)
2145-                wd_add $2 false
2146-				        shift
2147-                shift
2148+        case "$i"
2149+            in
2150+            -a|--add|add)
2151+                wd_add false $2
2152                 break
2153                 ;;
2154             -a!|--add!|add!)
2155-                wd_add $2 true
2156-				        shift
2157-                shift
2158+                wd_add true $2
2159                 break
2160                 ;;
2161-			      -r|--remove|rm)
2162-				        wd_remove $2
2163-                shift
2164-				        shift
2165+            -r|--remove|rm)
2166+                wd_remove $2
2167                 break