772bc51c3a2372592c400e0d4e159a0128989ba2

Author
James Smith <james@loopj.com>
Committer
James Smith <james@loopj.com>
Date

Message

Merge

Diff

This diff is truncated to protect this page.

   1diff --git a/.gitignore b/.gitignore
   2index 2e8db7341894fdf0940c0c37995e93e1b3b0d9fa..51a5ee6c396f012ae162d0d63006d4d8e765b92f 100644
   3--- a/.gitignore
   4+++ b/.gitignore
   5@@ -4,5 +4,6 @@ projects.zsh
   6 custom/*
   7 !custom/example
   8 !custom/example.zsh
   9-cache
  10 *.swp
  11+!custom/example.zshcache
  12+cache/
  13diff --git a/README.textile b/README.textile
  14index 2dbfbe5a658d8bba2d387bbab272e189ab9e8fca..a38e2d7cf83748f562590b4eb9383a827bc8d16f 100644
  15--- a/README.textile
  16+++ b/README.textile
  17@@ -1,5 +1,6 @@
  18 A handful of functions, auto-complete helpers, and stuff that makes you shout...
  19 
  20+
  21 bq. "OH MY ZSHELL!"
  22 
  23 h2. Setup
  24@@ -8,6 +9,14 @@ h2. Setup
  25 
  26 h3. The automatic installer... (do you trust me?)
  27 
  28+You can install this via the command line with either `curl` or `wget`.
  29+
  30+h4. via `curl`
  31+
  32+@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
  33+
  34+h4. via `wget`
  35+
  36 @wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
  37 
  38 h3. The manual way
  39@@ -48,7 +57,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
  40 h3. Customization
  41 
  42 If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
  43-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
  44+If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
  45 If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
  46 
  47 
  48@@ -60,9 +69,13 @@ h2. Help out!
  49 
  50 I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
  51 
  52-h3. Send us your theme!
  53+h3. (Don't) Send us your theme! (for now)
  54+
  55+-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
  56+
  57+We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there. 
  58+
  59 
  60-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
  61 
  62 h2. Contributors
  63 
  64diff --git a/lib/completion.zsh b/lib/completion.zsh
  65index fdd0a8536cd4825235d0f4fddd217f0f398ea86b..f31e101d5d2c9ad441af6468b8327b0c675997c8 100644
  66--- a/lib/completion.zsh
  67+++ b/lib/completion.zsh
  68@@ -32,19 +32,21 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
  69 cdpath=(.)
  70 
  71 # use /etc/hosts and known_hosts for hostname completion
  72+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  73 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
  74 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
  75 hosts=(
  76+  "$_global_ssh_hosts[@]"
  77   "$_ssh_hosts[@]"
  78   "$_etc_hosts[@]"
  79-  `hostname`
  80+  "$HOST"
  81   localhost
  82 )
  83 zstyle ':completion:*:hosts' hosts $hosts
  84 
  85 # Use caching so that commands like apt and dpkg complete are useable
  86 zstyle ':completion::complete:*' use-cache 1
  87-zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
  88+zstyle ':completion::complete:*' cache-path $ZSH/cache/
  89 
  90 # Don't complete uninteresting users
  91 zstyle ':completion:*:*:*:users' ignored-patterns \
  92@@ -59,3 +61,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
  93 # ... unless we really want to.
  94 zstyle '*' single-ignored show
  95 
  96+if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
  97+  expand-or-complete-with-dots() {
  98+    echo -n "\e[31m......\e[0m"
  99+    zle expand-or-complete
 100+    zle redisplay
 101+  }
 102+  zle -N expand-or-complete-with-dots
 103+  bindkey "^I" expand-or-complete-with-dots
 104+fi
 105diff --git a/lib/directories.zsh b/lib/directories.zsh
 106index bb114f61531a2086ebf16d9266d519dba592c0be..a787db9ebda2664163bebd1a42ce4727801eef61 100644
 107--- a/lib/directories.zsh
 108+++ b/lib/directories.zsh
 109@@ -36,9 +36,9 @@ cd () {
 110 
 111 alias md='mkdir -p'
 112 alias rd=rmdir
 113-alias d='dirs -v'
 114+alias d='dirs -v | head -10'
 115 
 116 # mkdir & cd to it
 117 function mcd() { 
 118   mkdir -p "$1" && cd "$1"; 
 119-}
 120+}
 121diff --git a/lib/functions.zsh b/lib/functions.zsh
 122index ef7cc6383038b7e6f9a02c857f13ea498ba5a8fe..d2dcadd0cb4d7235c8876556eb863140c315df12 100644
 123--- a/lib/functions.zsh
 124+++ b/lib/functions.zsh
 125@@ -3,11 +3,11 @@ function zsh_stats() {
 126 }
 127 
 128 function uninstall_oh_my_zsh() {
 129-  /bin/sh $ZSH/tools/uninstall.sh
 130+  /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
 131 }
 132 
 133 function upgrade_oh_my_zsh() {
 134-  /bin/sh $ZSH/tools/upgrade.sh
 135+  /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
 136 }
 137 
 138 function take() {
 139diff --git a/lib/git.zsh b/lib/git.zsh
 140index 010cb2a1c8c3c5fcb909b564a0154d3ad8f4c1d0..258b1df8f477c588ddfd28a0ad80580757021a67 100644
 141--- a/lib/git.zsh
 142+++ b/lib/git.zsh
 143@@ -4,9 +4,14 @@ function git_prompt_info() {
 144   echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
 145 }
 146 
 147+
 148 # Checks if working tree is dirty
 149 parse_git_dirty() {
 150-  if [[ -n $(git status -s 2> /dev/null) ]]; then
 151+  local SUBMODULE_SYNTAX=''
 152+  if [[ $POST_1_7_2_GIT -gt 0 ]]; then
 153+        SUBMODULE_SYNTAX="--ignore-submodules=dirty"
 154+  fi
 155+  if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
 156     echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
 157   else
 158     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
 159@@ -82,3 +87,29 @@ git_prompt_status() {
 160   fi
 161   echo $STATUS
 162 }
 163+
 164+#compare the provided version of git to the version installed and on path
 165+#prints 1 if input version <= installed version
 166+#prints -1 otherwise 
 167+function git_compare_version() {
 168+  local INPUT_GIT_VERSION=$1;
 169+  local INSTALLED_GIT_VERSION
 170+  INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
 171+  INSTALLED_GIT_VERSION=($(git --version));
 172+  INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
 173+
 174+  for i in {1..3}; do
 175+    if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
 176+      echo -1
 177+      return 0
 178+    fi
 179+  done
 180+  echo 1
 181+}
 182+
 183+#this is unlikely to change so make it all statically assigned
 184+POST_1_7_2_GIT=$(git_compare_version "1.7.2")
 185+#clean up the namespace slightly by removing the checker function
 186+unset -f git_compare_version
 187+
 188+
 189diff --git a/lib/history.zsh b/lib/history.zsh
 190index ca6f57079aef8e953154aa176159c8635e333228..876936b87888a60d1fc7ece2cdfa8dcdd6d9d8c8 100644
 191--- a/lib/history.zsh
 192+++ b/lib/history.zsh
 193@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history
 194 HISTSIZE=10000
 195 SAVEHIST=10000
 196 
 197-setopt hist_ignore_dups # ignore duplication command history list
 198-setopt share_history # share command history data
 199-
 200-setopt hist_verify
 201-setopt inc_append_history
 202+setopt append_history
 203 setopt extended_history
 204 setopt hist_expire_dups_first
 205+setopt hist_ignore_dups # ignore duplication command history list
 206 setopt hist_ignore_space
 207-
 208-setopt SHARE_HISTORY
 209-setopt APPEND_HISTORY
 210+setopt hist_verify
 211+setopt inc_append_history
 212+setopt share_history # share command history data
 213diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
 214index 9c2dda35a2aa9f2dbb0b4c644bc80142549c3172..5f499f3e8a56fcfcf24df504994dc3859670f53a 100644
 215--- a/lib/key-bindings.zsh
 216+++ b/lib/key-bindings.zsh
 217@@ -3,7 +3,6 @@
 218 bindkey -e
 219 bindkey '\ew' kill-region
 220 bindkey -s '\el' "ls\n"
 221-bindkey -s '\e.' "..\n"
 222 bindkey '^r' history-incremental-search-backward
 223 bindkey "^[[5~" up-line-or-history
 224 bindkey "^[[6~" down-line-or-history
 225@@ -14,10 +13,15 @@ bindkey '^[[B' down-line-or-search
 226 
 227 bindkey "^[[H" beginning-of-line
 228 bindkey "^[[1~" beginning-of-line
 229+bindkey "^[OH" beginning-of-line
 230 bindkey "^[[F"  end-of-line
 231 bindkey "^[[4~" end-of-line
 232+bindkey "^[OF" end-of-line
 233 bindkey ' ' magic-space    # also do history expansion on space
 234 
 235+bindkey "^[[1;5C" forward-word
 236+bindkey "^[[1;5D" backward-word
 237+
 238 bindkey '^[[Z' reverse-menu-complete
 239 
 240 # Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
 241diff --git a/lib/misc.zsh b/lib/misc.zsh
 242index 88732e664e1fc4ec3c5cb8e8e04ccc2ba9761dba..0f7e7e9254959f01d6186c16f147764e9645e8b2 100644
 243--- a/lib/misc.zsh
 244+++ b/lib/misc.zsh
 245@@ -9,5 +9,5 @@ bindkey "^[m" copy-prev-shell-word
 246 setopt long_list_jobs
 247 
 248 ## pager
 249-export PAGER=less
 250+export PAGER="less -R"
 251 export LC_CTYPE=$LANG
 252diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 253index 22e7f372fffdb1da78ffd3852130340a5d9aa448..e26fef6d30d8a3f46e1fa4862c20626815743891 100644
 254--- a/lib/termsupport.zsh
 255+++ b/lib/termsupport.zsh
 256@@ -3,8 +3,10 @@
 257 #Fully support screen, iterm, and probably most modern xterm and rxvt
 258 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 259 function title {
 260-  [ "$DISABLE_AUTO_TITLE" != "true" ] || return
 261-  if [[ "$TERM" == screen* ]]; then 
 262+  if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
 263+    return
 264+  fi
 265+  if [[ "$TERM" == screen* ]]; then
 266     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
 267   elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
 268     print -Pn "\e]2;$2:q\a" #set window name
 269@@ -16,14 +18,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
 270 ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
 271 
 272 #Appears when you have the prompt
 273-function precmd {
 274+function omz_termsupport_precmd {
 275   title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
 276 }
 277 
 278 #Appears at the beginning of (and during) of command execution
 279-function preexec {
 280+function omz_termsupport_preexec {
 281   emulate -L zsh
 282   setopt extended_glob
 283   local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 284   title "$CMD" "%100>...>$2%<<"
 285 }
 286+
 287+autoload -U add-zsh-hook
 288+add-zsh-hook precmd  omz_termsupport_precmd
 289+add-zsh-hook preexec omz_termsupport_preexec
 290diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 291index c4522491bc083f1cade6207432a4f4e62c6d009c..ddef1ad6cf280b2c4ce53af32a77f8e493bab7fc 100644
 292--- a/oh-my-zsh.sh
 293+++ b/oh-my-zsh.sh
 294@@ -1,7 +1,7 @@
 295 # Check for updates on initial load...
 296 if [ "$DISABLE_AUTO_UPDATE" != "true" ]
 297 then
 298-  /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
 299+  /usr/bin/env ZSH=$ZSH zsh $ZSH/tools/check_for_upgrade.sh
 300 fi
 301 
 302 # Initializes Oh My Zsh
 303@@ -13,25 +13,45 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
 304 # TIP: Add files you don't want in git to .gitignore
 305 for config_file ($ZSH/lib/*.zsh) source $config_file
 306 
 307-# Add all defined plugins to fpath
 308-plugin=${plugin:=()}
 309-for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
 310+# Set ZSH_CUSTOM to the path where your custom config files
 311+# and plugins exists, or else we will use the default custom/
 312+if [[ -z "$ZSH_CUSTOM" ]]; then
 313+    ZSH_CUSTOM="$ZSH/custom"
 314+fi
 315+
 316+
 317+is_plugin() {
 318+  local base_dir=$1
 319+  local name=$2
 320+  test -f $base_dir/plugins/$name/$name.plugin.zsh \
 321+    || test -f $base_dir/plugins/$name/_$name
 322+}
 323+# Add all defined plugins to fpath. This must be done
 324+# before running compinit.
 325+for plugin ($plugins); do
 326+  if is_plugin $ZSH_CUSTOM $plugin; then
 327+    fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
 328+  elif is_plugin $ZSH $plugin; then
 329+    fpath=($ZSH/plugins/$plugin $fpath)
 330+  fi
 331+done
 332 
 333 # Load and run compinit
 334 autoload -U compinit
 335 compinit -i
 336 
 337+
 338 # Load all of the plugins that were defined in ~/.zshrc
 339 for plugin ($plugins); do
 340-  if [ -f $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh ]; then
 341-    source $ZSH/custom/plugins/$plugin/$plugin.plugin.zsh
 342+  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
 343+    source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
 344   elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
 345     source $ZSH/plugins/$plugin/$plugin.plugin.zsh
 346   fi
 347 done
 348 
 349 # Load all of your custom configurations from custom/
 350-for config_file ($ZSH/custom/*.zsh) source $config_file
 351+for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
 352 
 353 # Load the theme
 354 if [ "$ZSH_THEME" = "random" ]
 355@@ -45,7 +65,11 @@ then
 356 else
 357   if [ ! "$ZSH_THEME" = ""  ]
 358   then
 359-    source "$ZSH/themes/$ZSH_THEME.zsh-theme"
 360+    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]
 361+    then
 362+      source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
 363+    else
 364+      source "$ZSH/themes/$ZSH_THEME.zsh-theme"
 365+    fi
 366   fi
 367 fi
 368-
 369diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
 370index b5e519036229b856c7a92854130d7fccaf848957..294dc5354cce12627ab52e0d0d69f45ec9859131 100644
 371--- a/plugins/archlinux/archlinux.plugin.zsh
 372+++ b/plugins/archlinux/archlinux.plugin.zsh
 373@@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then
 374   alias yaconf='yaourt -C'        # Fix all configuration files with vimdiff
 375   # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
 376   alias yaupg='yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
 377+  alias yasu='yaourt --sucre'      # Same as yaupg, but without confirmation
 378   alias yain='yaourt -S'           # Install specific package(s) from the repositories
 379   alias yains='yaourt -U'          # Install specific package not from the repositories but from a file 
 380   alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
 381diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
 382index da0a1276572dc655cc82eedc762e2996dac8b0b6..6f0edb062ac60bba4abc7b5fe84962ba286f8dee 100644
 383--- a/plugins/autojump/autojump.plugin.zsh
 384+++ b/plugins/autojump/autojump.plugin.zsh
 385@@ -1,3 +1,9 @@
 386-if [ -f `brew --prefix`/etc/autojump ]; then
 387-  . `brew --prefix`/etc/autojump
 388+if [ $commands[autojump] ]; then # check if autojump is installed
 389+  if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
 390+    . /usr/share/autojump/autojump.zsh
 391+  elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
 392+    . /etc/profile.d/autojump.zsh
 393+  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
 394+    . `brew --prefix`/etc/autojump
 395+  fi
 396 fi
 397diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
 398new file mode 100644
 399index 0000000000000000000000000000000000000000..bc75c5cf9ad01bd58ef29c4d83782ce5a849baff
 400--- /dev/null
 401+++ b/plugins/battery/battery.plugin.zsh
 402@@ -0,0 +1,20 @@
 403+if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
 404+  function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
 405+  function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
 406+  function battery_pct_prompt() {
 407+    b=$(battery_pct_remaining)
 408+    if [ $b -gt 50 ] ; then
 409+      color='green'
 410+    elif [ $b -gt 20 ] ; then
 411+      color='yellow'
 412+    else
 413+      color='red'
 414+    fi
 415+    echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
 416+  }
 417+else
 418+  error_msg='no battery'
 419+  function battery_pct_remaining() { echo $error_msg }
 420+  function battery_time_remaining() { echo $error_msg }
 421+  function battery_pct_prompt() { echo '' }
 422+fi
 423diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
 424new file mode 100644
 425index 0000000000000000000000000000000000000000..5d22cac9a3f1985cf6174e6b1e2b4c23c055828f
 426--- /dev/null
 427+++ b/plugins/bundler/_bundler
 428@@ -0,0 +1,82 @@
 429+#compdef bundle
 430+
 431+local curcontext="$curcontext" state line _gems _opts ret=1
 432+
 433+_arguments -C -A "-v" -A "--version" \
 434+	'(- 1 *)'{-v,--version}'[display version information]' \
 435+	'1: :->cmds' \
 436+	'*:: :->args' && ret=0
 437+
 438+case $state in
 439+	cmds)
 440+		_values "bundle command" \
 441+			"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
 442+			"update[Update dependencies to their latest versions]" \
 443+			"package[Package the .gem files required by your application]" \
 444+			"exec[Execute a script in the context of the current bundle]" \
 445+			"config[Specify and read configuration options for bundler]" \
 446+			"check[Determine whether the requirements for your application are installed]" \
 447+			"list[Show all of the gems in the current bundle]" \
 448+			"show[Show the source location of a particular gem in the bundle]" \
 449+			"console[Start an IRB session in the context of the current bundle]" \
 450+			"open[Open an installed gem in the editor]" \
 451+			"viz[Generate a visual representation of your dependencies]" \
 452+			"init[Generate a simple Gemfile, placed in the current directory]" \
 453+			"gem[Create a simple gem, suitable for development with bundler]" \
 454+			"help[Describe available tasks or one specific task]"
 455+		ret=0
 456+		;;
 457+	args)
 458+		case $line[1] in
 459+			help)
 460+				_values 'commands' \
 461+                    'install' \
 462+                    'update' \
 463+                    'package' \
 464+                    'exec' \
 465+                    'config' \
 466+                    'check' \
 467+                    'list' \
 468+                    'show' \
 469+                    'console' \
 470+                    'open' \
 471+                    'viz' \
 472+                    'init' \
 473+                    'gem' \
 474+                    'help' && ret=0
 475+				;;
 476+			install)
 477+				_arguments \
 478+					'(--no-color)--no-color[disable colorization in output]' \
 479+					'(--local)--local[do not attempt to connect to rubygems.org]' \
 480+					'(--quiet)--quiet[only output warnings and errors]' \
 481+					'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
 482+					'(--system)--system[install to the system location]' \
 483+					'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
 484+					'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
 485+					'(--path)--path=-[specify a different path than the system default]:path:_files' \
 486+					'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
 487+					'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
 488+				ret=0
 489+				;;
 490+			exec)
 491+				_normal && ret=0
 492+				;;
 493+			(open|show)
 494+				_gems=( $(bundle show 2> /dev/null | sed -e '/^  \*/!d; s/^  \* \([^ ]*\) .*/\1/') )
 495+				if [[ $_gems != "" ]]; then
 496+					_values 'gems' $_gems && ret=0
 497+				fi
 498+				;;
 499+			*)
 500+				_opts=(  $(bundle help $line[1] | sed -e '/^  \[-/!d; s/^  \[\(-[^=]*\)=.*/\1/') )
 501+				_opts+=( $(bundle help $line[1] | sed -e '/^  -/!d; s/^  \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
 502+				if [[ $_opts != "" ]]; then
 503+					_values 'options' $_opts && ret=0
 504+				fi
 505+				;;
 506+		esac
 507+		;;
 508+esac
 509+
 510+return ret
 511diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 512index f005700ff663c656a1c29cf167b5e1b759ab04e4..39b76ecdf9d8af6221430461b99c545bae2a804f 100644
 513--- a/plugins/bundler/bundler.plugin.zsh
 514+++ b/plugins/bundler/bundler.plugin.zsh
 515@@ -1,12 +1,12 @@
 516 alias be="bundle exec"
 517 alias bi="bundle install"
 518 alias bl="bundle list"
 519-alias bu="bundle update"
 520 alias bp="bundle package"
 521+alias bu="bundle update"
 522 
 523 # The following is based on https://github.com/gma/bundler-exec
 524 
 525-bundled_commands=(cap capify cucumber heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
 526+bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
 527 
 528 ## Functions
 529 
 530@@ -16,7 +16,7 @@ _bundler-installed() {
 531 
 532 _within-bundled-project() {
 533   local check_dir=$PWD
 534-  while [ "$(dirname $check_dir)" != "/" ]; do
 535+  while [ $check_dir != "/" ]; do
 536     [ -f "$check_dir/Gemfile" ] && return
 537     check_dir="$(dirname $check_dir)"
 538   done
 539@@ -33,5 +33,10 @@ _run-with-bundler() {
 540 
 541 ## Main program
 542 for cmd in $bundled_commands; do
 543-  alias $cmd="_run-with-bundler $cmd"
 544+  eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
 545+  alias $cmd=bundled_$cmd
 546+
 547+  if which _$cmd > /dev/null 2>&1; then
 548+        compdef _$cmd bundled_$cmd=$cmd
 549+  fi
 550 done
 551diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
 552index f968c71d582a35a9e175f0fc3a55d220f71d85fe..1d0d196ee194a15027e405b9f737fc96bbc67fea 100644
 553--- a/plugins/cake/cake.plugin.zsh
 554+++ b/plugins/cake/cake.plugin.zsh
 555@@ -1,18 +1,22 @@
 556 # Set this to 1 if you want to cache the tasks
 557-cache_task_list=1
 558+_cake_cache_task_list=1
 559 
 560 # Cache filename
 561-cache_file='.cake_task_cache'
 562+_cake_task_cache_file='.cake_task_cache'
 563+
 564+_cake_get_target_list () {
 565+	cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'
 566+}
 567 
 568 _cake_does_target_list_need_generating () {
 569 
 570-	if [ $cache_task_list -eq 0 ]; then
 571+	if [ ${_cake_cache_task_list} -eq 0 ]; then
 572 		return 1;
 573 	fi
 574 
 575-	if [ ! -f $cache_file ]; then return 0;
 576+	if [ ! -f ${_cake_task_cache_file} ]; then return 0;
 577 	else
 578-		accurate=$(stat -f%m $cache_file)
 579+		accurate=$(stat -f%m $_cake_task_cache_file)
 580 		changed=$(stat -f%m Cakefile)
 581 		return $(expr $accurate '>=' $changed)
 582 	fi
 583@@ -21,12 +25,12 @@ _cake_does_target_list_need_generating () {
 584 _cake () {
 585 	if [ -f Cakefile ]; then
 586 		if _cake_does_target_list_need_generating; then
 587-			cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file
 588-			compadd `cat $cache_file`
 589+			_cake_get_target_list > ${_cake_task_cache_file}
 590+			compadd `cat ${_cake_task_cache_file}`
 591 		else
 592-			compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
 593+			compadd `_cake_get_target_list`
 594 		fi
 595 	fi
 596 }
 597 
 598-compdef _cake cake
 599+compdef _cake cake
 600diff --git a/plugins/deb/deb.plugin.zsh b/plugins/deb/deb.plugin.zsh
 601deleted file mode 100644
 602index 1b35a064628625497cd67c2163c00d02a4c35cff..0000000000000000000000000000000000000000
 603--- a/plugins/deb/deb.plugin.zsh
 604+++ /dev/null
 605@@ -1,13 +0,0 @@
 606-# Aliases
 607-alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
 608-		--no-gui --disable-columns search"	# search package
 609-alias ad="sudo apt-get update"				# update packages lists
 610-alias au="sudo apt-get update && \
 611-		sudo apt-get dselect-upgrade"		# upgrade packages
 612-alias ai="sudo apt-get install"				# install package
 613-alias ar="sudo apt-get remove --purge && \
 614-		sudo apt-get autoremove --purge"	# remove package
 615-alias ap="apt-cache policy"				# apt policy
 616-alias av="apt-cache show"				# show package info
 617-alias acs="apt-cache search"                            # search package
 618-alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache
 619diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
 620index f8865a41210d3318525e867734cffd7cbe5bb7b2..39d3ef36a05280e9e285412afecba861278bd73c 100644
 621--- a/plugins/debian/debian.plugin.zsh
 622+++ b/plugins/debian/debian.plugin.zsh
 623@@ -1,53 +1,178 @@
 624-# https://github.com/dbbolton/
 625+# Authors:
 626+# https://github.com/AlexBio
 627+# https://github.com/dbb
 628 #
 629 # Debian-related zsh aliases and functions for zsh
 630 
 631+# Use aptitude if installed, or apt-get if not.
 632+# You can just set apt_pref='apt-get' to override it.
 633+if [[ -e $( which aptitude ) ]]; then
 634+    apt_pref='aptitude'
 635+else
 636+    apt_pref='apt-get'
 637+fi
 638+
 639+# Use sudo by default if it's installed
 640+if [[ -e $( which sudo ) ]]; then
 641+    use_sudo=1
 642+fi
 643 
 644 # Aliases ###################################################################
 645+# These are for more obscure uses of apt-get and aptitude that aren't covered
 646+# below.
 647+alias ag='apt-get'
 648+alias at='aptitude'
 649 
 650 # Some self-explanatory aliases
 651-alias afs='apt-file search --regexp'
 652+alias acs="apt-cache search"
 653 alias aps='aptitude search'
 654-alias apsrc='apt-get source'
 655-alias apv='apt-cache policy'
 656+alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
 657+		--no-gui --disable-columns search"	# search package
 658+
 659+# apt-file
 660+alias afs='apt-file search --regexp'
 661 
 662-alias apdg='su -c "aptitude update && aptitude safe-upgrade"'
 663-alias apud='su -c "aptitude update"'
 664-alias apug='su -c "aptitude safe-upgrade"'
 665 
 666+# These are apt-get only
 667+alias asrc='apt-get source'
 668+alias ap='apt-cache policy'
 669+
 670+# superuser operations ######################################################
 671+if [[ $use_sudo -eq 1 ]]; then
 672+# commands using sudo #######
 673+    alias aac='sudo $apt_pref autoclean'
 674+    alias abd='sudo $apt_pref build-dep'
 675+    alias ac='sudo $apt_pref clean'
 676+    alias ad='sudo $apt_pref update'
 677+    alias adg='sudo $apt_pref update && sudo $apt_pref upgrade'
 678+    alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
 679+    alias afu='sudo apt-file update'
 680+    alias ag='sudo $apt_pref upgrade'
 681+    alias ai='sudo $apt_pref install'
 682+    # Install all packages given on the command line while using only the first word of each line:
 683+    # acs ... | ail
 684+    alias ail="sed -e 's/  */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install'
 685+    alias ap='sudo $apt_pref purge'
 686+    alias ar='sudo $apt_pref remove'
 687+
 688+    # apt-get only
 689+    alias ads='sudo $apt_pref dselect-upgrade'
 690+
 691+    # Install all .deb files in the current directory.
 692+    # Warning: you will need to put the glob in single quotes if you use:
 693+    # glob_subst
 694+    alias di='sudo dpkg -i ./*.deb'
 695+
 696+    # Remove ALL kernel images and headers EXCEPT the one in use
 697+    alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
 698+        ?not(~n`uname -r`))'
 699+
 700+
 701+# commands using su #########
 702+else
 703+    alias aac='su -ls \'$apt_pref autoclean\' root'
 704+    abd() {
 705+        cmd="su -lc '$apt_pref build-dep $@' root"
 706+        print "$cmd"
 707+        eval "$cmd"
 708+    }
 709+    alias ac='su -ls \'$apt_pref clean\' root'
 710+    alias ad='su -lc \'$apt_pref update\' root'
 711+    alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root'
 712+    alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root'
 713+    alias afu='su -lc "apt-file update"'
 714+    alias ag='su -lc \'$apt_pref safe-upgrade\' root'
 715+    ai() {
 716+        cmd="su -lc 'aptitude -P install $@' root"
 717+        print "$cmd"
 718+        eval "$cmd"
 719+    }
 720+    ap() {
 721+        cmd="su -lc '$apt_pref -P purge $@' root"
 722+        print "$cmd"
 723diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh
 724new file mode 100644
 725index 0000000000000000000000000000000000000000..46a0ab268796c897de82a82c6108641446fb596c
 726--- /dev/null
 727+++ b/plugins/dircycle/dircycle.plugin.zsh
 728@@ -0,0 +1,10 @@
 729+##
 730+# dircycle plugin: enables cycling through the directory
 731+# stack using Ctrl+Shift+Left/Right
 732+
 733+eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
 734+zle -N insert-cycledleft
 735+bindkey "\e[1;6D" insert-cycledleft
 736+eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }"
 737+zle -N insert-cycledright
 738+bindkey "\e[1;6C" insert-cycledright
 739diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
 740index 6a2b289a2881abeeee97a47fb40dfffeb07c6077..0f6d9f435a5c318d6bd7674c4154d8ad9eb18184 100644
 741--- a/plugins/dirpersist/dirpersist.plugin.zsh
 742+++ b/plugins/dirpersist/dirpersist.plugin.zsh
 743@@ -12,7 +12,7 @@ dirpersistinstall () {
 744     if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
 745     else
 746         if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
 747-            echo "# Store dirs stack\n# See ~/.oh-my-zsh/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
 748+            echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
 749         else
 750             echo "If you don't want this message to appear, remove dirspersist from \$plugins"
 751         fi
 752diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
 753index 1d72a2f2c13f20d33ee63f5ec9918621bdb6827a..0bbd031fe01c257af863551e5be86e6a3ea023b5 100644
 754--- a/plugins/django/django.plugin.zsh
 755+++ b/plugins/django/django.plugin.zsh
 756@@ -220,3 +220,4 @@ _managepy() {
 757 
 758 compdef _managepy manage.py
 759 compdef _managepy django
 760+compdef _managepy django-manage
 761diff --git a/plugins/encode64/encode64.plugin.zsh b/plugins/encode64/encode64.plugin.zsh
 762new file mode 100644
 763index 0000000000000000000000000000000000000000..cfb7c6a18305c7b67507743b3b0977f4b4b3a047
 764--- /dev/null
 765+++ b/plugins/encode64/encode64.plugin.zsh
 766@@ -0,0 +1,2 @@
 767+encode64(){ echo -n $1 | base64 }
 768+decode64(){ echo -n $1 | base64 -D }
 769diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
 770index 8cc17f7d4be725da84afaf018cb8343e3048ad5d..5c125e98b06d1daa9dd18d2ad5054f5e86c3a27e 100644
 771--- a/plugins/extract/extract.plugin.zsh
 772+++ b/plugins/extract/extract.plugin.zsh
 773@@ -78,8 +78,3 @@ function extract() {
 774 
 775 alias x=extract
 776 
 777-# add extract completion function to path
 778-fpath=($ZSH/plugins/extract $fpath)
 779-autoload -U compinit
 780-compinit -i
 781-
 782diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh
 783new file mode 100644
 784index 0000000000000000000000000000000000000000..d42584f1a49b6236f2104fd8e54837e678a10a01
 785--- /dev/null
 786+++ b/plugins/fasd/fasd.plugin.zsh
 787@@ -0,0 +1,6 @@
 788+if [ $commands[fasd] ]; then # check if fasd is installed
 789+  eval "$(fasd --init auto)"
 790+  alias v='f -e vim'
 791+  alias o='a -e open'
 792+fi
 793+
 794diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
 795index 270bcbe389b79224d4725e45be39abb4c3823829..71b343884a5428660c92ce86ca63823d4337f8c7 100644
 796--- a/plugins/git-flow/git-flow.plugin.zsh
 797+++ b/plugins/git-flow/git-flow.plugin.zsh
 798@@ -110,6 +110,8 @@ __git-flow-release ()
 799 						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
 800 						-m'[Use the given tag message]'\
 801 						-p'[Push to $ORIGIN after performing finish]'\
 802+						-k'[Keep branch after performing finish]'\
 803+						-n"[Don't tag this release]"\
 804 						':version:__git_flow_version_list'
 805 				;;
 806 
 807@@ -162,6 +164,8 @@ __git-flow-hotfix ()
 808 						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
 809 						-m'[Use the given tag message]'\
 810 						-p'[Push to $ORIGIN after performing finish]'\
 811+						-k'[Keep branch after performing finish]'\
 812+						-n"[Don't tag this release]"\
 813 						':hotfix:__git_flow_hotfix_list'
 814 				;;
 815 
 816diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 817index 5132b639afebcf2c722f1a4b6d31a43dd517774e..d3d3f702a362c6ebe24109369da2e6d1a8652464 100644
 818--- a/plugins/git/git.plugin.zsh
 819+++ b/plugins/git/git.plugin.zsh
 820@@ -9,7 +9,7 @@ alias gup='git fetch && git rebase'
 821 compdef _git gup=git-fetch
 822 alias gp='git push'
 823 compdef _git gp=git-push
 824-gdv() { git-diff -w "$@" | view - }
 825+gdv() { git diff -w "$@" | view - }
 826 compdef _git gdv=git-diff
 827 alias gc='git commit -v'
 828 compdef _git gc=git-commit
 829@@ -17,6 +17,7 @@ alias gca='git commit -v -a'
 830 compdef _git gca=git-commit
 831 alias gco='git checkout'
 832 compdef _git gco=git-checkout
 833+alias gcm='git checkout master'
 834 alias gb='git branch'
 835 compdef _git gb=git-branch
 836 alias gba='git branch -a'
 837@@ -29,6 +30,14 @@ alias glg='git log --stat --max-count=5'
 838 compdef _git glg=git-log
 839 alias glgg='git log --graph --max-count=5'
 840 compdef _git glgg=git-log
 841+alias gss='git status -s'
 842+compdef _git gss=git-status
 843+alias ga='git add'
 844+compdef _git ga=git-add
 845+alias gm='git merge'
 846+compdef _git gm=git-merge
 847+alias grh='git reset HEAD'
 848+alias grhh='git reset HEAD --hard'
 849 
 850 # Git and svn mix
 851 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
 852@@ -45,6 +54,12 @@ function current_branch() {
 853   echo ${ref#refs/heads/}
 854 }
 855 
 856+function current_repository() {
 857+
 858+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
 859+  echo $(git remote -v | cut -d':' -f 2)
 860+}
 861+
 862 # these aliases take advantage of the previous function
 863 alias ggpull='git pull origin $(current_branch)'
 864 compdef ggpull=git
 865diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
 866index 1eb3381136818b82b1915cb5113d1877fc0907a5..197e86a48743419f79cceb8f4d4ebdafca0a5972 100644
 867--- a/plugins/github/github.plugin.zsh
 868+++ b/plugins/github/github.plugin.zsh
 869@@ -1,6 +1,70 @@
 870-# hub alias from defunkt
 871-# https://github.com/defunkt/hub
 872-if [ "$commands[(I)hub]" ]; then
 873+# Setup hub function for git, if it is available; http://github.com/defunkt/hub
 874+if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
 875     # eval `hub alias -s zsh`
 876-    function git(){hub "$@"}
 877+    function git(){
 878+        if ! (( $+_has_working_hub  )); then
 879+            hub --version &> /dev/null
 880+            _has_working_hub=$(($? == 0))
 881+        fi
 882+        if (( $_has_working_hub )) ; then
 883+            hub "$@"
 884+        else
 885+            command git "$@"
 886+        fi
 887+    }
 888 fi
 889+
 890+# Functions #################################################################
 891+
 892+# https://github.com/dbb 
 893+
 894+
 895+# empty_gh [NAME_OF_REPO]
 896+#
 897+# Use this when creating a new repo from scratch.
 898+empty_gh() { # [NAME_OF_REPO]
 899+    repo = $1
 900+    ghuser=$(  git config github.user )
 901+
 902+    mkdir "$repo"
 903+    cd "$repo"
 904+    git init
 905+    touch README
 906+    git add README
 907+    git commit -m 'Initial commit.'
 908+    git remote add origin git@github.com:${ghuser}/${repo}.git
 909+    git push -u origin master
 910+}
 911+
 912+# new_gh [DIRECTORY]
 913+#
 914+# Use this when you have a directory that is not yet set up for git.
 915+# This function will add all non-hidden files to git.
 916+new_gh() { # [DIRECTORY]
 917+    cd "$1"
 918+    ghuser=$( git config github.user )
 919+
 920+    git init
 921+    # add all non-dot files
 922+    print '.*'"\n"'*~' >> .gitignore
 923+    git add ^.*
 924+    git commit -m 'Initial commit.'
 925+    git remote add origin git@github.com:${ghuser}/${repo}.git
 926+    git push -u origin master
 927+}
 928+
 929+# exist_gh [DIRECTORY]
 930+#
 931+# Use this when you have a git repo that's ready to go and you want to add it
 932+# to your GitHub.
 933+exist_gh() { # [DIRECTORY]
 934+    cd "$1"
 935+    name=$( git config user.name )
 936+    ghuser=$( git config github.user )
 937+
 938+    git remote add origin git@github.com:${ghuser}/${repo}.git
 939+    git push -u origin master
 940+}
 941+
 942+# End Functions #############################################################
 943+
 944diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
 945new file mode 100644
 946index 0000000000000000000000000000000000000000..e59265d664fa6f0022c52d2791bcf78a84d2b793
 947--- /dev/null
 948+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
 949@@ -0,0 +1,80 @@
 950+# ------------------------------------------------------------------------------
 951+#          FILE:  gnu-utils.plugin.zsh
 952+#   DESCRIPTION:  oh-my-zsh plugin file.
 953+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
 954+#       VERSION:  1.0.0
 955+# ------------------------------------------------------------------------------
 956+
 957+
 958+if [[ -x "${commands[gwhoami]}" ]]; then 
 959+  __gnu_utils() {
 960+    emulate -L zsh
 961+    local gcmds
 962+    local gcmd
 963+    local cmd
 964+    local prefix
 965+
 966+    # coreutils 
 967+    gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
 968+    'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
 969+    'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
 970+    'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
 971+    'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
 972+    'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
 973+    'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
 974+    'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
 975+    'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort'
 976+    'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest'
 977+    'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname'
 978+    'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
 979+    'gwhoami' 'gyes')
 980+
 981+    # Not part of coreutils, installed separately.
 982+    gcmds+=('gsed' 'gtar' 'gtime')
 983+
 984+    for gcmd in "${gcmds[@]}"; do
 985+      #
 986+      # This method allows for builtin commands to be primary but it's
 987+      # lost if hash -r or rehash -f is executed. Thus, those two 
 988+      # functions have to be wrapped.
 989+      #
 990+      (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}
 991+
 992+      #
 993+      # This method generates wrapper functions.
 994+      # It will override shell builtins.
 995+      #
 996+      # (( ${+commands[$gcmd]} )) && \
 997+      # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
 998+
 999+      #
1000+      # This method is inflexible since the aliases are at risk of being
1001+      # overriden resulting in the BSD coreutils being called.
1002+      #
1003+      # (( ${+commands[$gcmd]} )) && \
1004+      # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
1005+    done
1006+
1007+    return 0
1008+  }
1009+  __gnu_utils;
1010+
1011+  function hash() {
1012+    if [[ "$*" =~ "-(r|f)" ]]; then
1013+      builtin hash "$@"
1014+      __gnu_utils
1015+    else
1016+      builtin hash "$@"
1017+    fi
1018+  }
1019+
1020+  function rehash() {
1021+    if [[ "$*" =~ "-f" ]]; then
1022+      builtin rehash "$@"
1023+      __gnu_utils
1024+    else
1025+      builtin rehash "$@"
1026+    fi
1027+  }
1028+fi
1029+
1030diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
1031new file mode 100644
1032index 0000000000000000000000000000000000000000..fc4c78c503c26ef2762cb1f84df3476670b1a84d
1033--- /dev/null
1034+++ b/plugins/gradle/gradle.plugin.zsh
1035@@ -0,0 +1,119 @@
1036+#!zsh
1037+##############################################################################
1038+# A descriptive listing of core Gradle commands 
1039+############################################################################
1040+function _gradle_core_commands() {
1041+    local ret=1 state
1042+    _arguments ':subcommand:->subcommand' && ret=0
1043+
1044+    case $state in
1045+      subcommand)
1046+        subcommands=(
1047+          "properties:Display all project properties"
1048+          "tasks:Calculate and display all tasks"
1049+          "dependencies:Calculate and display all dependencies"
1050+          "projects:Discover and display all sub-projects"
1051+          "build:Build the project"
1052+          "help:Display help"
1053+        )
1054+        _describe -t subcommands 'gradle subcommands' subcommands && ret=0
1055+    esac
1056+
1057+    return ret
1058+}
1059+
1060+function _gradle_arguments() {
1061+    _arguments -C \
1062+    '-a[Do not rebuild project dependencies]' \
1063+    '-h[Help]' \
1064+    '-D[System property]' \
1065+    '-d[Log at the debug level]' \
1066+    '--gui[Launches the Gradle GUI app]' \
1067+    '--stop[Stop the Gradle daemon]' \
1068+    '--daemon[Use the Gradle daemon]' \
1069+    '--no-daemon[Do not use the Gradle daemon]' \
1070+    '--no-opt[Do not perform any task optimization]' \
1071+    '-i[Log at the info level]' \
1072+    '-m[Dry run]' \
1073+    '-P[Set a project property]' \
1074+    '--profile[Profile the build time]' \
1075+    '-q[Log at the quiet level (only show errors)]' \
1076+    '-v[Print the Gradle version info]' \
1077+    '-x[Specify a task to be excluded]' \
1078+    '*::command:->command' \
1079+    && return 0
1080+}
1081+
1082+
1083+##############################################################################
1084+# Are we in a directory containing a build.gradle file?
1085+############################################################################
1086+function in_gradle() {
1087+    if [[ -f build.gradle ]]; then
1088+        echo 1
1089+    fi
1090+}
1091+
1092+############################################################################
1093+# Define the stat_cmd command based on platform behavior
1094+##########################################################################
1095+stat -f%m . > /dev/null 2>&1
1096+if [ "$?" = 0 ]; then
1097+	stat_cmd=(stat -f%m)
1098+else
1099+	stat_cmd=(stat -L --format=%Y)
1100+fi
1101+
1102+############################################################################## Examine the build.gradle file to see if its
1103+# timestamp has changed, and if so, regen
1104+# the .gradle_tasks cache file
1105+############################################################################
1106+_gradle_does_task_list_need_generating () {
1107+  if [ ! -f .gradletasknamecache ]; then return 0;
1108+  else
1109+    accurate=$($stat_cmd .gradletasknamecache)
1110+    changed=$($stat_cmd build.gradle)
1111+    return $(expr $accurate '>=' $changed)
1112+  fi
1113+}
1114+
1115+
1116+##############################################################################
1117+# Discover the gradle tasks by running "gradle tasks --all"
1118+############################################################################
1119+_gradle_tasks () {
1120+  if [ in_gradle ]; then
1121+    _gradle_arguments
1122+    if _gradle_does_task_list_need_generating; then
1123+     gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1124+    fi
1125+    compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache`
1126+  fi
1127+}
1128+
1129+_gradlew_tasks () {
1130+  if [ in_gradle ]; then
1131+    _gradle_arguments
1132+    if _gradle_does_task_list_need_generating; then
1133+     gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1134+    fi
1135diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh
1136new file mode 100755
1137index 0000000000000000000000000000000000000000..cc6f9c53b1da773c423873d25c1b66b490ee7038
1138--- /dev/null
1139+++ b/plugins/grails/grails.plugin.zsh
1140@@ -0,0 +1,54 @@
1141+_enumerateGrailsScripts() {
1142+    # Default directoryies
1143+    directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts)
1144+
1145+    # Check all of the plugins directories, if they exist
1146+    if [ -d plugins ]
1147+    then
1148+        directories+=(plugins/*/scripts)
1149+    fi
1150+    
1151+    # Enumerate all of the Groovy files
1152+    files=()
1153+    for dir in $directories;
1154+    do
1155+        if [ -d $dir ]
1156+        then
1157+            files+=($dir/[^_]*.groovy)
1158+        fi
1159+    done
1160+    
1161+    # Don't try to basename ()
1162+    if [ ${#files} -eq 0 ];
1163+    then
1164+        return
1165+    fi
1166+    
1167+    # - Strip the path
1168+    # - Remove all scripts with a leading '_'
1169+    # - PackagePlugin_.groovy -> PackagePlugin
1170+    # - PackagePlugin         -> Package-Plugin
1171+    # - Package-Plugin        -> package-plugin
1172+    basename $files                             \
1173+        | sed -E  -e 's/^_?([^_]+)_?.groovy/\1/'\
1174+                  -e 's/([a-z])([A-Z])/\1-\2/g' \
1175+        | tr "[:upper:]" "[:lower:]"            \
1176+        | sort                                  \
1177+        | uniq
1178+}
1179+ 
1180+_grails() {
1181+    if (( CURRENT == 2 )); then
1182+        scripts=( $(_enumerateGrailsScripts) )
1183+        
1184+        if [ ${#scripts} -ne 0 ];
1185+        then
1186+            _multi_parts / scripts
1187+            return
1188+        fi
1189+    fi
1190+    
1191+    _files
1192+}
1193+ 
1194+compdef _grails grails
1195diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
1196new file mode 100644
1197index 0000000000000000000000000000000000000000..dc899e2b2a3e07b6d36501b4b1b6f4f6211302db
1198--- /dev/null
1199+++ b/plugins/heroku/_heroku
1200@@ -0,0 +1,158 @@
1201+#compdef heroku
1202+
1203+# Heroku Autocomplete plugin for Oh-My-Zsh
1204+# Requires: The Heroku client gem (https://github.com/heroku/heroku)
1205+# Author: Ali B. (http://awhitebox.com)
1206+
1207+local -a _1st_arguments
1208+_1st_arguments=(
1209+  "account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
1210+  "addons":"list installed addons"
1211+  "addons\:list":"list all available addons"
1212+  "addons\:add":"install an addon"
1213+  "addons\:upgrade":"upgrade an existing addon"
1214+  "addons\:downgrade":"downgrade an existing addon"
1215+  "addons\:remove":"uninstall an addon"
1216+  "addons\:open":"open an addon's dashboard in your browser"
1217+  "apps":"list your apps"
1218+  "apps\:info":"show detailed app information"
1219+  "apps\:create":"create a new app"
1220+  "apps\:rename":"rename the app"
1221+  "apps\:open":"open the app in a web browser"
1222+  "apps\:destroy":"permanently destroy an app"
1223+  "auth\:login":"log in with your heroku credentials"
1224+  "auth\:logout":"clear local authentication credentials"
1225+  "config":"display the config vars for an app"
1226+  "config\:add":"add one or more config vars"
1227+  "config\:remove":"remove a config var"
1228+  "db\:push":"push local data up to your app"
1229+  "db\:pull":"pull heroku data down into your local database"
1230+  "domains":"list custom domains for an app"
1231+  "domains\:add":"add a custom domain to an app"
1232+  "domains\:remove":"remove a custom domain from an app"
1233+  "domains\:clear":"remove all custom domains from an app"
1234+  "help":"list available commands or display help for a specific command"
1235+  "keys":"display keys for the current user"
1236+  "keys\:add":"add a key for the current user"
1237+  "keys\:remove":"remove a key from the current user"
1238+  "keys\:clear":"remove all authentication keys from the current user"
1239+  "logs":"display recent log output"
1240+  "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
1241+  "logs\:drains":"manage syslog drains"
1242+  "maintenance\:on":"put the app into maintenance mode"
1243+  "maintenance\:off":"take the app out of maintenance mode"
1244+  "pg\:info":"display database information"
1245+  "pg\:ingress":"allow direct connections to the database from this IP for one minute"
1246+  "pg\:promote":"sets DATABASE as your DATABASE_URL"
1247+  "pg\:psql":"open a psql shell to the database"
1248+  "pg\:reset":"delete all data in DATABASE"
1249+  "pg\:unfollow":"stop a replica from following and make it a read/write database"
1250+  "pg\:wait":"monitor database creation, exit when complete"
1251+  "pgbackups":"list captured backups"
1252+  "pgbackups\:url":"get a temporary URL for a backup"
1253+  "pgbackups\:capture":"capture a backup from a database id"
1254+  "pgbackups\:restore":"restore a backup to a database"
1255+  "pgbackups\:destroy":"destroys a backup"
1256+  "plugins":"list installed plugins"
1257+  "plugins\:install":"install a plugin"
1258+  "plugins\:uninstall":"uninstall a plugin"
1259+  "ps\:dynos":"scale to QTY web processes"
1260+  "ps\:workers":"scale to QTY background processes"
1261+  "ps":"list processes for an app"
1262+  "ps\:restart":"restart an app process"
1263+  "ps\:scale":"scale processes by the given amount"
1264+  "releases":"list releases"
1265+  "releases\:info":"view detailed information for a release"
1266+  "rollback":"roll back to an older release"
1267+  "run":"run an attached process"
1268+  "run\:rake":"remotely execute a rake command"
1269+  "run\:console":"open a remote console session"
1270+  "sharing":"list collaborators on an app"
1271+  "sharing\:add":"add a collaborator to an app"
1272+  "sharing\:remove":"remove a collaborator from an app"
1273+  "sharing\:transfer":"transfer an app to a new owner"
1274+  "ssl":"list certificates for an app"
1275+  "ssl\:add":"add an ssl certificate to an app"
1276+  "ssl\:remove":"remove an ssl certificate from an app"
1277+  "ssl\:clear":"remove all ssl certificates from an app"
1278+  "stack":"show the list of available stacks"
1279+  "stack\:migrate":"prepare migration of this app to a new stack"
1280+  "version":"show heroku client version"
1281+)
1282+
1283+_arguments '*:: :->command'
1284+
1285+if (( CURRENT == 1 )); then
1286+  _describe -t commands "heroku command" _1st_arguments
1287+  return
1288+fi
1289+
1290+local -a _command_args
1291+case "$words[1]" in
1292+  apps:info)
1293+    _command_args=(
1294+      '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
1295+    )
1296+    ;;
1297+  apps:create)
1298+    _command_args=(
1299+      '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
1300diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh
1301new file mode 100644
1302index 0000000000000000000000000000000000000000..a9eef4029620dc3901399d0a4973feda73f4860f
1303--- /dev/null
1304+++ b/plugins/jake-node/jake-node.plugin.zsh
1305@@ -0,0 +1,14 @@
1306+#---oh-my-zsh plugin : task Autocomplete for Jake tool---
1307+# Jake : https://github.com/mde/jake
1308+# Warning : Jakefile should have the right case : Jakefile or jakefile
1309+# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10
1310+# Author : Alexandre Lacheze (@al3xstrat)
1311+# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh 
1312+
1313+function _jake () {
1314+  if [ -f Jakefile ]||[ -f jakefile ]; then
1315+    compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
1316+  fi
1317+}
1318+
1319+compdef _jake jake
1320diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh
1321new file mode 100755
1322index 0000000000000000000000000000000000000000..bb7975b1071c2966f68bbf354123982f8397db32
1323--- /dev/null
1324+++ b/plugins/jruby/jruby.plugin.zsh
1325@@ -0,0 +1,4 @@
1326+# Aliases
1327+alias jrspec='jruby --debug -S rspec --debug'
1328+alias jprofile='jruby --profile.api -S rspec'
1329+alias jexec='jruby -S'
1330diff --git a/plugins/knife/_knife b/plugins/knife/_knife
1331index 7f8c95ee5a470810785cb719828371a5e7463e6c..8453af5be60abb5412a28010dc500f7fb1512cc9 100644
1332--- a/plugins/knife/_knife
1333+++ b/plugins/knife/_knife
1334@@ -26,7 +26,7 @@ _knife() {
1335   
1336   case $state in
1337   knifecmd)
1338-    compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
1339+    compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
1340   ;;
1341   knifesubcmd)
1342     case $words[2] in
1343@@ -42,6 +42,9 @@ _knife() {
1344     cookbook)
1345       compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
1346     ;;
1347+  environment)
1348+      compadd -Q "$@" list create delete edit show "from file"
1349+      ;;
1350     node)
1351      compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
1352     ;;
1353@@ -138,27 +141,31 @@ _knife_options3() {
1354 
1355 # The chef_x_remote functions use knife to get a list of objects of type x on the server
1356 _chef_roles_remote() {
1357- (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1358+ (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1359 }
1360 
1361 _chef_clients_remote() {
1362- (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1363+ (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1364 }
1365 
1366 _chef_nodes_remote() {
1367- (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1368+ (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1369 }
1370 
1371 _chef_cookbooks_remote() {
1372- (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1373+ (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1374 }
1375 
1376 _chef_sitecookbooks_remote() {
1377- (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1378+ (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1379 }
1380 
1381 _chef_data_bags_remote() {
1382- (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1383+ (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
1384+}
1385+
1386+_chef_environments_remote() {
1387+  (knife environment list | awk '{print $1}')
1388 }
1389 
1390 # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
1391diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
1392index a7153bb570d559fc4cdabb7f88c9aba2db2d94a4..697f98d664f92b71ab9bed127cda0e42e5726d7c 100644
1393--- a/plugins/lol/lol.plugin.zsh
1394+++ b/plugins/lol/lol.plugin.zsh
1395@@ -8,19 +8,30 @@ alias rtfm='man'
1396 alias visible='echo'
1397 alias invisible='cat'
1398 alias moar='more'
1399+alias tldr='less'
1400+alias alwayz='tail -f'
1401 
1402 alias icanhas='mkdir'
1403+alias gimmeh='touch'
1404 alias donotwant='rm'
1405 alias dowant='cp'
1406 alias gtfo='mv'
1407+alias nowai='chmod'
1408 
1409 alias hai='cd'
1410+alias iz='ls'
1411 alias plz='pwd'
1412+alias ihasbucket='df -h'
1413 
1414 alias inur='locate'
1415+alias iminurbase='finger'
1416 
1417-alias nomz='ps -aux'
1418+alias btw='nice'
1419+alias obtw='nohup'
1420+
1421+alias nomz='ps aux'
1422 alias nomnom='killall'
1423 
1424+alias byes='exit'
1425 alias cya='reboot'
1426 alias kthxbai='halt'
1427diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
1428new file mode 100644
1429index 0000000000000000000000000000000000000000..caf0d9efc81196a73e9b8592fd3a0a3b0f46ed17
1430--- /dev/null
1431+++ b/plugins/mercurial/mercurial.plugin.zsh
1432@@ -0,0 +1,14 @@
1433+
1434+# Mercurial
1435+alias hgc='hg commit'
1436+alias hgb='hg branch'
1437+alias hgba='hg branches'
1438+alias hgco='hg checkout'
1439+alias hgd='hg diff'
1440+alias hged='hg diffmerge'
1441+# pull and update
1442+alias hgl='hg pull -u'
1443+alias hgp='hg push'
1444+alias hgs='hg status'
1445+# this is the 'git commit --amend' equivalent
1446+alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
1447diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
1448new file mode 100644
1449index 0000000000000000000000000000000000000000..e8af2f49d5d2f87daeae99b23d59fecdc7b44d26
1450--- /dev/null
1451+++ b/plugins/mvn/mvn.plugin.zsh
1452@@ -0,0 +1,6 @@
1453+function listMavenCompletions { 
1454+	 reply=(
1455diff --git a/plugins/npm/_npm b/plugins/npm/_npm
1456deleted file mode 100644
1457index 24b536188e08a12e9422fef49c16409b478d329c..0000000000000000000000000000000000000000
1458--- a/plugins/npm/_npm
1459+++ /dev/null
1460@@ -1,19 +0,0 @@
1461-#compdef npm
1462-
1463-# Node Package Manager 0.3.15 completion, letting npm do all the completion work
1464-
1465-_npm() {
1466-  compadd -- $(_npm_complete $words)
1467-}
1468-
1469-# We want to show all errors of any substance, but never the "npm (not )ok" one.
1470-# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.)
1471-_npm_complete() {
1472-  local ask_npm
1473-  ask_npm=(npm completion --color false --loglevel error -- $@)
1474-  { _call_program npm $ask_npm 2>&1 >&3 \
1475-  | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \
1476-  } 3>&1
1477-}
1478-
1479-_npm "$@"
1480diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
1481new file mode 100644
1482index 0000000000000000000000000000000000000000..c3eb91d313204a3ca5ca084e24327254ff8e6ffa
1483--- /dev/null
1484+++ b/plugins/npm/npm.plugin.zsh
1485@@ -0,0 +1 @@
1486+eval "$(npm completion 2>/dev/null)"
1487diff --git a/plugins/nyan/nyan.plugin.zsh b/plugins/nyan/nyan.plugin.zsh
1488new file mode 100644
1489index 0000000000000000000000000000000000000000..6321e5f5a02c05a691ec3a7f44e1f0416b50349c
1490--- /dev/null
1491+++ b/plugins/nyan/nyan.plugin.zsh
1492@@ -0,0 +1,5 @@
1493+if [[ -x `which nc` ]]; then
1494+  alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat
1495+fi
1496+
1497+
1498diff --git a/plugins/pip/_pip b/plugins/pip/_pip
1499index b58010173a5028b0dc0db651f042e56df861d497..df53ba5ce8ec788d3ff7da94a9936ffee94267db 100644
1500--- a/plugins/pip/_pip
1501+++ b/plugins/pip/_pip
1502@@ -3,30 +3,43 @@
1503 
1504 # pip zsh completion, based on homebrew completion
1505 
1506+_pip_all() {
1507+  # we cache the list of packages (originally from the macports plugin)
1508+  if (( ! $+piplist )); then
1509+    echo -n " (caching package index...)"
1510+	piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
1511+  fi
1512+}
1513+
1514 _pip_installed() {
1515-  installed_pkgs=(`pip freeze`)
1516+  installed_pkgs=(`pip freeze | cut -d '=' -f 1`)
1517 }
1518 
1519 local -a _1st_arguments
1520 _1st_arguments=(
1521-  'bundle:Create pybundles (archives containing multiple packages)'
1522-  'freeze:Output all currently installed packages (exact versions) to stdout'
1523-  'help:Show available commands'
1524-  'install:Install packages'
1525-  'search:Search PyPI'
1526-  'uninstall:Uninstall packages'
1527-  'unzip:Unzip individual packages'
1528-  'zip:Zip individual packages'
1529+  'bundle:create pybundles (archives containing multiple packages)'
1530+  'freeze:output all currently installed packages (exact versions) to stdout'
1531+  'help:show available commands'
1532+  'install:install packages'
1533+  'search:search PyPI'
1534+  'uninstall:uninstall packages'
1535+  'unzip:unzip individual packages'
1536+  'zip:zip individual packages'
1537 )
1538 
1539 local expl
1540-local -a pkgs installed_pkgs
1541+local -a all_pkgs installed_pkgs
1542 
1543 _arguments \
1544-  '(--version)--version[Show version number of program and exit]' \
1545-  '(-v --verbose)'{-v,--verbose}'[Give more output]' \
1546-  '(-q --quiet)'{-q,--quiet}'[Give less output]' \
1547-  '(-h --help)'{-h,--help}'[Show help]' \
1548+  '(--version)--version[show version number of program and exit]' \
1549+  '(-h --help)'{-h,--help}'[show help]' \
1550+  '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \
1551+  '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \
1552+  '(-v --verbose)'{-v,--verbose}'[give more output]' \
1553+  '(-q --quiet)'{-q,--quiet}'[give less output]' \
1554+  '(--log)--log[log file location]' \
1555+  '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \
1556+  '(--timeout)--timeout[socket timeout (default 15s)]' \
1557   '*:: :->subcmds' && return 0
1558 
1559 if (( CURRENT == 1 )); then
1560@@ -35,10 +48,25 @@ if (( CURRENT == 1 )); then
1561 fi
1562 
1563 case "$words[1]" in
1564-  list)
1565-      if [[ "$state" == forms ]]; then
1566-        _pip_installed
1567-        _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
1568+  search)
1569+    _arguments \
1570+      '(--index)--index[base URL of Python Package Index]' ;;
1571+  freeze)
1572+    _arguments \
1573+      '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;;
1574+  install)
1575+  	_arguments \
1576+      '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
1577+      '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
1578+      '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
1579+      '(--no-install)--no-install[only download packages]' \
1580+      '(--no-download)--no-download[only install downloaded packages]' \
1581+      '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
1582+      '1: :->packages' &&  return 0
1583+     
1584+      if [[ "$state" == packages ]]; then
1585+        _pip_all
1586+        _wanted piplist expl 'packages' compadd -a piplist
1587       fi ;;
1588   uninstall)
1589     _pip_installed
1590diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
1591index 6b2a6f2be0f3636c9026eb82a0405eebc79669b4..399a54cb02aae802afb95f72a343b35b1412f779 100644
1592--- a/plugins/pow/pow.plugin.zsh
1593+++ b/plugins/pow/pow.plugin.zsh
1594@@ -1,10 +1,66 @@
1595-# Thanks to Christopher Sexton
1596-# https://gist.github.com/965032
1597-function kapow {
1598-	touch ~/.pow/$1/tmp/restart.txt
1599-	if [ $? -eq 0 ]; then
1600-		echo "$fg[yellow]Pow restarting $1...$reset_color"
1601-	fi
1602+# Restart a rack app running under pow
1603+# http://pow.cx/
1604+#
1605+# Adds a kapow command that will restart an app
1606+#
1607+#   $ kapow myapp
1608+#
1609+# Supports command completion.
1610+#
1611+# If you are not already using completion you might need to enable it with
1612+# 
1613+#    autoload -U compinit compinit
1614+#
1615+# Changes:
1616+#
1617+# Defaults to the current application, and will walk up the tree to find 
1618+# a config.ru file and restart the corresponding app
1619+#
1620+# Will Detect if a app does not exist in pow and print a (slightly) helpful 
1621+# error message
1622+
1623+rack_root_detect(){
1624+  setopt chaselinks
1625+  local orgdir=$(pwd)
1626+  local basedir=$(pwd)
1627+
1628+  while [[ $basedir != '/' ]]; do
1629+    test -e "$basedir/config.ru" && break
1630+    builtin cd ".." 2>/dev/null
1631+    basedir="$(pwd)"
1632+  done
1633+
1634+  builtin cd $orgdir 2>/dev/null
1635+  [[ ${basedir} == "/" ]] && return 1
1636+  echo `basename $basedir | sed -E "s/.(com|net|org)//"`
1637 }
1638 
1639+kapow(){
1640+  local vhost=$1
1641+  [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
1642+  if [ ! -h ~/.pow/$vhost ]
1643+  then
1644+    echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first."
1645+    return 1
1646+  fi
1647+
1648+  [ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp
1649+  touch ~/.pow/$vhost/tmp/restart.txt;
1650+  [ $? -eq 0 ] &&  echo "pow: restarting $vhost.dev"
1651+}
1652 compctl -W ~/.pow -/ kapow
1653+
1654+powit(){
1655+	local basedir=$(pwd)
1656+  local vhost=$1
1657+  [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
1658+  if [ ! -h ~/.pow/$vhost ]
1659+	then
1660+		echo "pow: Symlinking your app with pow. ${vhost}"
1661+	  [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
1662+    return 1
1663+  fi
1664+}
1665+
1666+# View the standard out (puts) from any pow app
1667+alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
1668diff --git a/plugins/powder/_powder b/plugins/powder/_powder
1669new file mode 100644
1670index 0000000000000000000000000000000000000000..84e260a157153c77f62dda75fd3df88518a56d5d
1671--- /dev/null
1672+++ b/plugins/powder/_powder
1673@@ -0,0 +1,4 @@
1674+#compdef powder
1675+#autoload
1676+
1677+compadd `powder help | grep powder | cut -d " " -f 4`
1678diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh
1679new file mode 100644
1680index 0000000000000000000000000000000000000000..8be3cd86311c68930a7a187a77d345cccb67430b
1681--- /dev/null
1682+++ b/plugins/python/python.plugin.zsh
1683@@ -0,0 +1,8 @@
1684+# Find python file
1685+alias pyfind='find . -name "*.py"'
1686+
1687+# Remove python compiled byte-code
1688+alias pyclean='find . -type f -name "*.py[co]" -delete'
1689+
1690+# Grep among .py files
1691+alias pygrep='grep --include="*.py"'
1692diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
1693index ac8119e837611d4a19ea146a8e7c4242a8982922..4aa7a05d6db43ff6a824cf90553564e9fa9572ec 100644
1694--- a/plugins/rails/rails.plugin.zsh
1695+++ b/plugins/rails/rails.plugin.zsh
1696@@ -2,6 +2,7 @@ alias ss='thin --stats "/thin/stats" start'
1697 alias sg='ruby script/generate'
1698 alias sd='ruby script/destroy'
1699 alias sp='ruby script/plugin'
1700+alias sr='ruby script/runner'
1701 alias ssp='ruby script/spec'
1702 alias rdbm='rake db:migrate'
1703 alias sc='ruby script/console'
1704diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
1705index f4ee637e6b45522afdee404804b12edf0f1e992e..237d0594bf8964707cfa2935b8f09f26fb095646 100644
1706--- a/plugins/rails3/rails3.plugin.zsh
1707+++ b/plugins/rails3/rails3.plugin.zsh
1708@@ -13,7 +13,11 @@ alias rd='_rails_command destroy'
1709 alias rdb='_rails_command dbconsole'
1710 alias rdbm='rake db:migrate db:test:clone'
1711 alias rg='_rails_command generate'
1712+alias rgm='_rails_command generate migration'
1713 alias rp='_rails_command plugin'
1714+alias ru='_rails_command runner'
1715 alias rs='_rails_command server'
1716 alias rsd='_rails_command server --debugger'
1717 alias devlog='tail -f log/development.log'
1718+alias rdm='rake db:migrate'
1719+alias rdr='rake db:rollback'
1720diff --git a/plugins/rake/rake.plugin.zsh b/plugins/rake/rake.plugin.zsh
1721new file mode 100644
1722index 0000000000000000000000000000000000000000..16b933c14c104dc953bed61dbe31ff1570cd0904
1723--- /dev/null
1724+++ b/plugins/rake/rake.plugin.zsh
1725@@ -0,0 +1,6 @@
1726+alias rake="noglob rake" # allows square brackts for rake task invocation
1727+alias brake='noglob bundle exec rake' # execute the bundled rake gem
1728+alias srake='noglob sudo rake' # noglob must come before sudo
1729+alias sbrake='noglob sudo bundle exec rake' # altogether now ... 
1730+
1731+
1732diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
1733new file mode 100644
1734index 0000000000000000000000000000000000000000..d855c244552ebd6e2b418108c0d3cce1f8fa7202
1735--- /dev/null
1736+++ b/plugins/rbenv/rbenv.plugin.zsh
1737@@ -0,0 +1,57 @@
1738+_homebrew-installed() {
1739+  type brew &> /dev/null
1740+}
1741+
1742+_rbenv-from-homebrew-installed() {
1743+  brew --prefix rbenv &> /dev/null
1744+}
1745+
1746+FOUND_RBENV=0
1747+rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
1748+if _homebrew-installed && _rbenv-from-homebrew-installed ; then
1749+    rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
1750+fi
1751+
1752+for rbenvdir in "${rbenvdirs[@]}" ; do
1753+  if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
1754+    FOUND_RBENV=1
1755+    export RBENV_ROOT=$rbenvdir
1756+    export PATH=${rbenvdir}/bin:$PATH
1757+    eval "$(rbenv init - zsh)"
1758+
1759+    alias rubies="rbenv versions"
1760+    alias gemsets="rbenv gemset list"
1761+
1762+    function current_ruby() {
1763+      echo "$(rbenv version-name)"
1764+    }
1765+
1766+    function current_gemset() {
1767+      echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)"
1768+    }
1769+
1770+    function gems {
1771+      local rbenv_path=$(rbenv prefix)
1772+      gem list $@ | sed \
1773+        -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
1774+        -Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
1775+        -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
1776+        -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
1777+    }
1778+
1779+    function rbenv_prompt_info() {
1780+      if [[ -n $(current_gemset) ]] ; then
1781+        echo "$(current_ruby)@$(current_gemset)"
1782+      else
1783+        echo "$(current_ruby)"
1784+      fi
1785+    }
1786+  fi
1787+done
1788+unset rbenvdir
1789+
1790+if [ $FOUND_RBENV -eq 0 ] ; then
1791+  alias rubies='ruby -v'
1792+  function gemsets() { echo 'not supported' }
1793+  function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" }
1794+fi
1795diff --git a/plugins/rbfu/rbfu.plugin.zsh b/plugins/rbfu/rbfu.plugin.zsh
1796new file mode 100644
1797index 0000000000000000000000000000000000000000..0084852054d3c78856b24187a2e485d02b5e04c8
1798--- /dev/null
1799+++ b/plugins/rbfu/rbfu.plugin.zsh
1800@@ -0,0 +1,42 @@
1801+# Enables rbfu with --auto option, if available.
1802+#
1803+# Also provides a command to list all installed/available
1804+# rubies. To ensure compatibility with themes, creates the
1805+# rvm_prompt_info function to return the $RBFU_RUBY_VERSION
1806+# version.
1807+
1808+command -v rbfu &>/dev/null
1809+
1810+if [[ $? -eq 0 ]]; then
1811+  eval "$(rbfu --init --auto)"
1812+
1813+  # Internal: Print ruby version details, if it's currently
1814+  # active etc.
1815+  function _rbfu_rubies_print() {
1816+    local rb rb_out
1817+    rb=$(basename $1)
1818+    rb_out="$rb"
1819+    [[ -h $1 ]] && rb_out="$rb_out${fg[green]}@${reset_color}"
1820+    [[ "x$rb" == "x$2" ]] && rb_out="${fg[red]}$rb_out ${fg[red]}*${reset_color}"
1821+    echo $rb_out
1822+  }
1823+
1824+  # Public: Provide a list with all available rubies, this basically depends
1825+  # on `ls -1` and .rfbu/rubies. Highlights the currently active ruby version
1826+  # and aliases.
1827+  function rbfu-rubies() {
1828+    local rbfu_dir active_rb
1829+    rbfu_dir=$RBFU_RUBIES
1830+    active_rb=$RBFU_RUBY_VERSION
1831+    [[ -z "$rbfu_dir" ]] && rbfu_dir="${HOME}/.rbfu/rubies"
1832+    [[ -z "$active_rb" ]] && active_rb="system"
1833+    _rbfu_rubies_print "${rbfu_dir}/system" $active_rb
1834+    for rb in $(ls -1 $rbfu_dir); do
1835+      _rbfu_rubies_print "${rbfu_dir}/${rb}" $active_rb
1836+    done
1837+  }
1838+
1839+  # Public: Create rvm_prompt_info command for themes compatibility, unless
1840+  # it has already been defined.
1841+  [ ! -x rvm_prompt_info ] && function rvm_prompt_info() { echo "${RBFU_RUBY_VERSION:=system}" }
1842+fi