d70e73294494e68c94879c7bf22f708a3049a9d4

Author
Bob Williams <bobwilliams.ii@gmail.com>
Committer
Bob Williams <bobwilliams.ii@gmail.com>
Date

Message

Merge remote-tracking branch 'upstream/master'

Diff

This diff is truncated to protect this page.

   1diff --git a/.gitignore b/.gitignore
   2index 51a5ee6c396f012ae162d0d63006d4d8e765b92f..8fa66f02fdcd06648d216376f3c202aa4e950669 100644
   3--- a/.gitignore
   4+++ b/.gitignore
   5@@ -1,8 +1,8 @@
   6 locals.zsh
   7 log/.zsh_history
   8 projects.zsh
   9-custom/*
  10-!custom/example
  11+custom
  12+!custom/plugins/example
  13 !custom/example.zsh
  14 *.swp
  15 !custom/example.zshcache
  16diff --git a/README.textile b/README.textile
  17index c808fb5d706fb5e8760cba4b1c45ed14583e44bd..4325c91eb94d1fbd2ab5bb5ac5d8fcc29f21f963 100644
  18--- a/README.textile
  19+++ b/README.textile
  20@@ -59,7 +59,7 @@ If you installed manually or changed the install location, check ZSH in ~/.zshrc
  21 
  22 h2. Usage
  23 
  24-* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
  25+* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's possible)
  26 ** example: @plugins=(git osx ruby)@
  27 * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
  28 ** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
  29diff --git a/custom/example/example.plugin.zsh b/custom/plugins/example/example.plugin.zsh
  30rename from custom/example/example.plugin.zsh
  31rename to custom/plugins/example/example.plugin.zsh
  32diff --git a/lib/grep.zsh b/lib/grep.zsh
  33index 93c4270b60c808e2f59ad925b1ea657bb2cdf50c..25345bd0688d8e0d2295b4620e87d428f0a528c7 100644
  34--- a/lib/grep.zsh
  35+++ b/lib/grep.zsh
  36@@ -2,5 +2,11 @@
  37 # Color grep results
  38 # Examples: http://rubyurl.com/ZXv
  39 #
  40-export GREP_OPTIONS='--color=auto'
  41+
  42+# avoid VCS folders
  43+GREP_OPTIONS=
  44+for PATTERN in .cvs .git .hg .svn; do
  45+    GREP_OPTIONS+="--exclude-dir=$PATTERN "
  46+done
  47+export GREP_OPTIONS+='--color=auto '
  48 export GREP_COLOR='1;32'
  49diff --git a/lib/history.zsh b/lib/history.zsh
  50index 655945166715d17f3e6084b4fab9af8911605bd3..1d83e56e3a63391133304d3f92596fab97fa1d55 100644
  51--- a/lib/history.zsh
  52+++ b/lib/history.zsh
  53@@ -5,7 +5,6 @@ fi
  54 HISTSIZE=10000
  55 SAVEHIST=10000
  56 
  57-setopt append_history
  58 setopt extended_history
  59 setopt hist_expire_dups_first
  60 setopt hist_ignore_dups # ignore duplication command history list
  61diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
  62index 94f1842f37b5f38a5c6387ec6aae243af0820e34..5f3f237c72b6408fe4233ab7b7eab6f3365c326b 100644
  63--- a/lib/key-bindings.zsh
  64+++ b/lib/key-bindings.zsh
  65@@ -15,29 +15,49 @@ if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
  66   zle -N zle-line-finish
  67 fi
  68 
  69-bindkey -e                                          # Use emacs key bindings
  70+bindkey -e                                            # Use emacs key bindings
  71 
  72-bindkey '\ew' kill-region                           # [Esc-w] - Kill from the cursor to the mark
  73-bindkey -s '\el' 'ls\n'                             # [Esc-l] - run command: ls
  74-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.
  75-bindkey "${terminfo[kpp]}" up-line-or-history       # [PageUp] - Up a line of history
  76-bindkey "${terminfo[knp]}" down-line-or-history     # [PageDown] - Down a line of history
  77+bindkey '\ew' kill-region                             # [Esc-w] - Kill from the cursor to the mark
  78+bindkey -s '\el' 'ls\n'                               # [Esc-l] - run command: ls
  79+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.
  80+if [[ "${terminfo[kpp]}" != "" ]]; then
  81+  bindkey "${terminfo[kpp]}" up-line-or-history       # [PageUp] - Up a line of history
  82+fi
  83+if [[ "${terminfo[knp]}" != "" ]]; then
  84+  bindkey "${terminfo[knp]}" down-line-or-history     # [PageDown] - Down a line of history
  85+fi
  86 
  87-bindkey "${terminfo[kcuu1]}" up-line-or-search      # start typing + [Up-Arrow] - fuzzy find history forward
  88-bindkey "${terminfo[kcud1]}" down-line-or-search    # start typing + [Down-Arrow] - fuzzy find history backward
  89+if [[ "${terminfo[kcuu1]}" != "" ]]; then
  90+  bindkey "${terminfo[kcuu1]}" up-line-or-search      # start typing + [Up-Arrow] - fuzzy find history forward
  91+fi
  92+if [[ "${terminfo[kcud1]}" != "" ]]; then
  93+  bindkey "${terminfo[kcud1]}" down-line-or-search    # start typing + [Down-Arrow] - fuzzy find history backward
  94+fi
  95 
  96-bindkey "${terminfo[khome]}" beginning-of-line      # [Home] - Go to beginning of line
  97-bindkey "${terminfo[kend]}"  end-of-line            # [End] - Go to end of line
  98+if [[ "${terminfo[khome]}" != "" ]]; then
  99+  bindkey "${terminfo[khome]}" beginning-of-line      # [Home] - Go to beginning of line
 100+fi
 101+if [[ "${terminfo[kend]}" != "" ]]; then
 102+  bindkey "${terminfo[kend]}"  end-of-line            # [End] - Go to end of line
 103+fi
 104 
 105-bindkey ' ' magic-space                             # [Space] - do history expansion
 106+bindkey ' ' magic-space                               # [Space] - do history expansion
 107 
 108-bindkey '^[[1;5C' forward-word                      # [Ctrl-RightArrow] - move forward one word
 109-bindkey '^[[1;5D' backward-word                     # [Ctrl-LeftArrow] - move backward one word
 110+bindkey '^[[1;5C' forward-word                        # [Ctrl-RightArrow] - move forward one word
 111+bindkey '^[[1;5D' backward-word                       # [Ctrl-LeftArrow] - move backward one word
 112 
 113-bindkey "${terminfo[kcbt]}" reverse-menu-complete   # [Shift-Tab] - move through the completion menu backwards
 114+if [[ "${terminfo[kdch1]}" != "" ]]; then
 115+  bindkey "${terminfo[kdch1]}" reverse-menu-complete  # [Shift-Tab] - move through the completion menu backwards
 116+fi
 117 
 118-bindkey '^?' backward-delete-char                   # [Backspace] - delete backward
 119-bindkey "${terminfo[kdch1]}" delete-char            # [Delete] - delete forward
 120+bindkey '^?' backward-delete-char                     # [Backspace] - delete backward
 121+if [[ "${terminfo[kdch1]}" != "" ]]; then
 122+  bindkey "${terminfo[kdch1]}" delete-char            # [Delete] - delete forward
 123+else
 124+  bindkey "^[[3~" delete-char
 125+  bindkey "^[3;5~" delete-char
 126+  bindkey "\e[3~" delete-char
 127+fi
 128 
 129 # Edit the current command line in $EDITOR
 130 autoload -U edit-command-line
 131diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh
 132index 048fd75219fd48d3e4d0b6d0caf29d091c350d68..9adb9031a0e9c61c113a0e210531f5f3fdc5f4e2 100644
 133--- a/plugins/atom/atom.plugin.zsh
 134+++ b/plugins/atom/atom.plugin.zsh
 135@@ -1,4 +1,14 @@
 136-#
 137-# Your guess is as good as mine. Let's just assume that we will need this...
 138-#   - For more info visit... http://atom.io/
 139-#
 140+local _atom_paths > /dev/null 2>&1
 141+_atom_paths=(
 142+    "$HOME/Applications/Atom.app"
 143+    "/Applications/Atom.app"
 144+)
 145+
 146+for _atom_path in $_atom_paths; do
 147+    if [[ -a $_atom_path ]]; then
 148+        alias at="open -a '$_atom_path'"
 149+        break
 150+    fi
 151+done
 152+
 153+alias att='at .'
 154diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
 155index b16a75c5b1cb07466b83673c32e29183dbe7a684..32dd4b624dfd96081f3a2d518af1d4b763089bc7 100644
 156--- a/plugins/battery/battery.plugin.zsh
 157+++ b/plugins/battery/battery.plugin.zsh
 158@@ -21,7 +21,7 @@ if [[ $(uname) == "Darwin" ]] ; then
 159   function plugged_in() {
 160     [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
 161   }
 162-  
 163+
 164   function battery_pct_remaining() {
 165     if plugged_in ; then
 166       echo "External Power"
 167@@ -31,7 +31,7 @@ if [[ $(uname) == "Darwin" ]] ; then
 168   }
 169 
 170   function battery_time_remaining() {
 171-  	local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
 172+    local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
 173     if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
 174       timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
 175       if [ $timeremaining -gt 720 ] ; then
 176@@ -59,9 +59,9 @@ if [[ $(uname) == "Darwin" ]] ; then
 177       echo "∞"
 178     fi
 179   }
 180-  
 181+
 182   function battery_is_charging() {
 183-	  [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]]
 184+    [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]]
 185   }
 186 
 187 elif [[ $(uname) == "Linux"  ]] ; then
 188@@ -71,7 +71,9 @@ elif [[ $(uname) == "Linux"  ]] ; then
 189   }
 190 
 191   function battery_pct() {
 192-    echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" 
 193+    if (( $+commands[acpi] )) ; then
 194+      echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')"
 195+    fi
 196   }
 197 
 198   function battery_pct_remaining() {
 199@@ -103,7 +105,7 @@ elif [[ $(uname) == "Linux"  ]] ; then
 200       echo "∞"
 201     fi
 202   }
 203-  
 204+
 205 else
 206   # Empty functions so we don't cause errors in prompts
 207   function battery_pct_remaining() {
 208@@ -136,7 +138,7 @@ function battery_level_gauge() {
 209   if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then
 210     local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots)));
 211     local empty=$(($gauge_slots - $filled));
 212-	
 213+
 214     if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green;
 215     elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow;
 216     else local gauge_color=$color_red;
 217@@ -144,10 +146,9 @@ function battery_level_gauge() {
 218   else
 219     local filled=$gauge_slots;
 220     local empty=0;
 221-  	filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'};
 222+    filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'};
 223   fi
 224 
 225-  
 226   local charging=' ' && battery_is_charging && charging=$charging_symbol;
 227 
 228   printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%}
 229diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 230index df30ed7c7063578745d2409d8f826c548182d8f9..e4b03e7b0b95a832d9c1273f33d8cc9d8de86f26 100644
 231--- a/plugins/bundler/bundler.plugin.zsh
 232+++ b/plugins/bundler/bundler.plugin.zsh
 233@@ -6,7 +6,7 @@ alias bu="bundle update"
 234 
 235 # The following is based on https://github.com/gma/bundler-exec
 236 
 237-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)
 238+bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife mailcatcher middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails)
 239 
 240 # Remove $UNBUNDLED_COMMANDS from the bundled_commands list
 241 for cmd in $UNBUNDLED_COMMANDS; do
 242diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh
 243index 75899ca2cd527c41e736369452788de754815323..b19650feeba177ad5ede7304c4969122bda9cc90 100644
 244--- a/plugins/common-aliases/common-aliases.plugin.zsh
 245+++ b/plugins/common-aliases/common-aliases.plugin.zsh
 246@@ -71,7 +71,7 @@ if [ ${ZSH_VERSION//\./} -ge 420 ]; then
 247   _image_fts=(jpg jpeg png gif mng tiff tif xpm)
 248   for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done
 249 
 250-  _media_fts=(avi mpg mpeg ogm mp3 wav ogg ape rm mov mkv)
 251+  _media_fts=(ape avi flv mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
 252   for ft in $_media_fts ; do alias -s $ft=mplayer ; done
 253 
 254   #read documents
 255diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
 256index 0f6d9f435a5c318d6bd7674c4154d8ad9eb18184..88d1129d4ac9a21a0a08f1a61f6531b84f320c34 100644
 257--- a/plugins/dirpersist/dirpersist.plugin.zsh
 258+++ b/plugins/dirpersist/dirpersist.plugin.zsh
 259@@ -1,39 +1,19 @@
 260-#!/bin/zsh
 261-# 
 262-# Make the dirstack more persistant
 263-# 
 264-# Add dirpersist to $plugins in ~/.zshrc to load
 265-# 
 266+# Save dirstack history to .zdirs
 267+# adapted from:
 268+# github.com/grml/grml-etc-core/blob/master/etc/zsh/zshrc#L1547
 269 
 270-# $zdirstore is the file used to persist the stack
 271-zdirstore=~/.zdirstore
 272+DIRSTACKSIZE=${DIRSTACKSIZE:-20}
 273+dirstack_file=${dirstack_file:-${HOME}/.zdirs}
 274 
 275-dirpersistinstall () {
 276-    if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
 277-    else
 278-        if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
 279-            echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
 280-        else
 281-            echo "If you don't want this message to appear, remove dirspersist from \$plugins"
 282-        fi
 283-    fi
 284-}
 285-
 286-dirpersiststore () {
 287-    dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
 288-}
 289+if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
 290+  dirstack=( ${(f)"$(< $dirstack_file)"} )
 291+  # "cd -" won't work after login by just setting $OLDPWD, so
 292+  [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
 293+fi
 294 
 295-dirpersistrestore () {
 296-    if [ -f $zdirstore ]; then
 297-        source $zdirstore
 298-    fi
 299+chpwd() {
 300+  if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi
 301+  local -ax my_stack
 302+  my_stack=( ${PWD} ${dirstack} )
 303+  builtin print -l ${(u)my_stack} >! ${dirstack_file}
 304 }
 305-
 306-DIRSTACKSIZE=10
 307-setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
 308-
 309-dirpersistinstall
 310-dirpersistrestore
 311-
 312-# Make popd changes permanent without having to wait for logout
 313-alias popd="popd;dirpersiststore"
 314diff --git a/plugins/gas/_gas b/plugins/gas/_gas
 315index befdc94598df69bba47201e6933829b4fb39fbce..23e6d99aa93bfe7a007f2c519e12153abc33025a 100644
 316--- a/plugins/gas/_gas
 317+++ b/plugins/gas/_gas
 318@@ -13,6 +13,7 @@ case $state in
 319 		cmds=(
 320             "version:Prints Gas's version"
 321             "use:Uses author"
 322+            "ssh:Creates a new ssh key for an existing gas author"
 323             "show:Shows your current user"
 324             "list:Lists your authors"
 325             "import:Imports current user to gasconfig"
 326@@ -25,8 +26,12 @@ case $state in
 327 	args)
 328 		case $line[1] in
 329 			(use|delete)
 330-				_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
 331-				;;
 332+        VERSION=$(gas -v)
 333+        if [[ $VERSION == <1->.*.* ]] || [[ $VERSION == 0.<2->.* ]] || [[ $VERSION == 0.1.<6-> ]] then
 334+          _values -S , 'authors' $(cat ~/.gas/gas.authors | sed -n -e 's/^.*\[\(.*\)\]/\1/p') && ret=0
 335+        else
 336+				  _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
 337+        fi
 338 		esac
 339 		;;
 340 esac
 341diff --git a/plugins/gem/_gem b/plugins/gem/_gem
 342index 66c77b7d1b839d7b76f79f7bdfe739b072fefd41..25967f1e7a8e9aacd1e6c08844830a916e2b2fbe 100644
 343--- a/plugins/gem/_gem
 344+++ b/plugins/gem/_gem
 345@@ -56,6 +56,9 @@ if (( CURRENT == 1 )); then
 346 fi
 347 
 348 case "$words[1]" in
 349+  build)
 350+    _files -g "*.gemspec"
 351+    ;;
 352   list)
 353       if [[ "$state" == forms ]]; then
 354         _gem_installed
 355diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 356index 2b5983f33922a7728634e1f308dd9b2be64161d8..9f7819df31f542dd741be572f5fb99006037dd3c 100644
 357--- a/plugins/git/git.plugin.zsh
 358+++ b/plugins/git/git.plugin.zsh
 359@@ -149,7 +149,7 @@ function work_in_progress() {
 360   fi
 361 }
 362 # these alias commit and uncomit wip branches
 363-alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "--wip--"'
 364+alias gwip='git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"'
 365 alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
 366 
 367 # these alias ignore changes to file
 368diff --git a/plugins/glassfish/_asadmin b/plugins/glassfish/_asadmin
 369new file mode 100644
 370index 0000000000000000000000000000000000000000..a6a7af5498aaac1d64ec25a6b3fbad6bd7824865
 371--- /dev/null
 372+++ b/plugins/glassfish/_asadmin
 373@@ -0,0 +1,1150 @@
 374+#compdef asadmin
 375+#autoload
 376+
 377+local -a _1st_arguments
 378+_1st_arguments=(
 379+    "add-library:adds one or more library JAR files to GlassFish Server"
 380+    "add-resources:creates the resources specified in an XML file"
 381+    "apply-http-lb-changes:applies load balancer configuration changes to the load balancer"
 382+    "backup-domain:performs a backup on the domain"
 383+    "change-admin-password:changes the administrator password"
 384+    "change-master-broker:changes the master broker in a Message Queue cluster providing JMS services for a GlassFish Server cluster."
 385+    "change-master-password:changes the master password"
 386+    "collect-log-files:creates a ZIP archive of all available log files"
 387+    "configure-jms-cluster:configures the Message Queue cluster providing JMS services to a GlassFish Server cluster"
 388+    "configure-lb-weight:sets load balancing weights for clustered instances"
 389+    "configure-ldap-for-admin:configures the authentication realm named admin-realm for the given LDAP"
 390+    "copy-config:copies an existing named configuration to create another configuration"
 391+    "create-admin-object:adds the administered object with the specified JNDI name for a resource adapter"
 392+    "create-application-ref:creates a reference to an application"
 393+    "create-audit-module:adds an audit module"
 394+    "create-auth-realm:adds the named authentication realm"
 395+    "create-cluster:creates a GlassFish Server cluster"
 396+    "create-connector-connection-pool:adds a connection pool with the specified connection pool name"
 397+    "create-connector-resource:registers the connector resource with the specified JNDI name"
 398+    "create-connector-security-map:creates a security map for the specified connector connection pool"
 399+    "create-connector-work-security-map:creates a work security map for the specified resource adapter"
 400+    "create-custom-resource:creates a custom resource"
 401+    "create-domain:creates a domain"
 402+    "create-file-user:creates a new file user"
 403+    "create-http:sets HTTP parameters for a protocol"
 404+    "create-http-health-checker:creates a health-checker for a specified load balancer configuration"
 405+    "create-http-lb:creates a load balancer"
 406+    "create-http-lb-config:creates a configuration for the load balancer"
 407+    "create-http-lb-ref:adds an existing cluster or server instance to an existing load balancer configuration or load balancer"
 408+    "create-http-listener:adds a new HTTP network listener socket"
 409+    "create-http-redirect:adds a new HTTP redirect"
 410+    "create-iiop-listener:adds an IIOP listener"
 411+    "create-instance:creates a GlassFish Server instance"
 412+    "create-jacc-provider:enables administrators to create a JACC provider that can be used by third-party authorization modules for applications running in GlassFish Server"
 413+    "create-javamail-resource:creates a JavaMail session resource"
 414+    "create-jdbc-connection-pool:registers a JDBC connection pool"
 415+    "create-jdbc-resource:creates a JDBC resource with the specified JNDI name"
 416+    "create-jms-host:creates a JMS host"
 417+    "create-jms-resource:creates a JMS resource"
 418+    "create-jmsdest:creates a JMS physical destination"
 419+    "create-jndi-resource:registers a JNDI resource"
 420+    "create-jvm-options:creates options for the Java application launcher"
 421+    "create-lifecycle-module:creates a lifecycle module"
 422+    "create-local-instance:creates a GlassFish Server instance on the host where the subcommand is run"
 423+    "create-message-security-provider:enables administrators to create a message security provider, which specifies how SOAP messages will be secured."
 424+    "create-network-listener:adds a new network listener socket"
 425+    "create-node-config:creates a node that is not enabled for remote communication"
 426+    "create-node-dcom:creates a node that is enabled for com munication over DCOM"
 427+    "create-node-ssh:creates a node that is enabled for communication over SSH"
 428+    "create-password-alias:creates a password alias"
 429+    "create-profiler:creates the profiler element"
 430+    "create-protocol:adds a new protocol"
 431+    "create-protocol-filter:adds a new protocol filter"
 432+    "create-protocol-finder:adds a new protocol finder"
 433+    "create-resource-adapter-config:creates the configuration information for the connector module"
 434+    "create-resource-ref:creates a reference to a resource"
 435+    "create-service:configures the starting of a DAS or a GlassFish Server instance on an unattended boot"
 436+    "create-ssl:creates and configures the SSL element in the selected HTTP listener, IIOP listener, or IIOP service"
 437+    "create-system-properties:adds one or more system property elements that can be referenced elsewhere in the configuration."
 438+    "create-threadpool:adds a thread pool"
 439+    "create-transport:adds a new transport"
 440+    "create-virtual-server:creates the named virtual server"
 441+    "delete-admin-object:removes the administered object with the specified JNDI name."
 442+    "delete-application-ref:removes a reference to an applica tion"
 443+    "delete-audit-module:removes the named audit-module"
 444+    "delete-auth-realm:removes the named authentication realm"
 445+    "delete-cluster:deletes a GlassFish Server cluster"
 446+    "delete-config:deletes an existing named configuration"
 447+    "delete-connector-connection-pool:removes the specified connector connection pool"
 448+    "delete-connector-resource:removes the connector resource with the specified JNDI name"
 449+    "delete-connector-security-map:deletes a security map for the specified connector connection pool"
 450+    "delete-connector-work-security-map:deletes a work security map for the specified resource adapter"
 451+    "delete-custom-resource:removes a custom resource"
 452+    "delete-domain:deletes a domain"
 453+    "delete-file-user:removes the named file user"
 454+    "delete-http:removes HTTP parameters from a protocol"
 455+    "delete-http-health-checker:deletes the health-checker for a specified load balancer configuration"
 456+    "delete-http-lb:deletes a load balancer"
 457+    "delete-http-lb-config:deletes a load balancer configuration"
 458+    "delete-http-lb-ref:deletes the cluster or server instance from a load balancer"
 459+    "delete-http-listener:removes a network listener"
 460+    "delete-http-redirect:removes an HTTP redirect"
 461+    "delete-iiop-listener:removes an IIOP listener"
 462+    "delete-instance:deletes a GlassFish Server instance"
 463+    "delete-jacc-provider:enables administrators to delete JACC providers defined for a domain"
 464+    "delete-javamail-resource:removes a JavaMail session resource"
 465+    "delete-jdbc-connection-pool:removes the specified JDBC connection pool"
 466+    "delete-jdbc-resource:removes a JDBC resource with the specified JNDI name"
 467+    "delete-jms-host:removes a JMS host"
 468+    "delete-jms-resource:removes a JMS resource"
 469+    "delete-jmsdest:removes a JMS physical destination"
 470+    "delete-jndi-resource:removes a JNDI resource"
 471+    "delete-jvm-options:removes one or more options for the Java application launcher"
 472+    "delete-lifecycle-module:removes the lifecycle module"
 473diff --git a/plugins/glassfish/glassfish.plugin.zsh b/plugins/glassfish/glassfish.plugin.zsh
 474new file mode 100644
 475index 0000000000000000000000000000000000000000..fde2edb2a59de8f9be9459fee93803c07d9b785d
 476--- /dev/null
 477+++ b/plugins/glassfish/glassfish.plugin.zsh
 478@@ -0,0 +1,3 @@
 479+# if there is a user named 'glassfish' on the system, we'll assume
 480+# that is the user asadmin should be run as
 481+# grep -e '^glassfish' /etc/passwd > /dev/null && alias asadmin='sudo -u glassfish asadmin'
 482diff --git a/plugins/knife/_knife b/plugins/knife/_knife
 483index b44283f78fd435f976c052d5c535259c6284e3e3..163149267dbd5589c0db6fcb06d2bebb606f9228 100644
 484--- a/plugins/knife/_knife
 485+++ b/plugins/knife/_knife
 486@@ -31,7 +31,7 @@ _knife() {
 487   
 488   case $state in
 489   knifecmd)
 490-    compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload windows $cloudproviders
 491+    compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload vault windows $cloudproviders
 492   ;;
 493   knifesubcmd)
 494     case $words[2] in
 495@@ -65,6 +65,9 @@ _knife() {
 496     upload)
 497      _arguments '*:file or directory:_files -g "*"'
 498     ;;
 499+    vault)
 500+      compadd -Q "$@" create decrypt delete edit remove "rotate all keys" "rotate keys" show update
 501+    ;;
 502     windows)
 503       compadd "$@" bootstrap
 504     ;;
 505diff --git a/plugins/laravel4/laravel4.plugin.zsh b/plugins/laravel4/laravel4.plugin.zsh
 506new file mode 100644
 507index 0000000000000000000000000000000000000000..4b1022b6619105ee07ecbe94d4c799af9dec8d75
 508--- /dev/null
 509+++ b/plugins/laravel4/laravel4.plugin.zsh
 510@@ -0,0 +1,20 @@
 511+# Laravel4 basic command completion
 512+_laravel4_get_command_list () {
 513+	php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'
 514+}
 515+
 516+_laravel4 () {
 517+  if [ -f artisan ]; then
 518+    compadd `_laravel4_get_command_list`
 519+  fi
 520+}
 521+
 522+compdef _laravel4 artisan
 523+compdef _laravel4 la4
 524+
 525+#Alias
 526+alias la4='php artisan'
 527+
 528+alias la4dump='php artisan dump-autoload'
 529+alias la4cache='php artisan cache:clear'
 530+alias la4routes='php artisan routes'
 531diff --git a/plugins/pip/_pip b/plugins/pip/_pip
 532index 7c1238db7a8f65b97974512e719f9f9b778a907e..9892dd19c92688c070f65ffabce0247ebbceebe6 100644
 533--- a/plugins/pip/_pip
 534+++ b/plugins/pip/_pip
 535@@ -59,6 +59,7 @@ case "$words[1]" in
 536   	_arguments \
 537       '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
 538       '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
 539+      '(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \
 540       '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
 541       '(--no-install)--no-install[only download packages]' \
 542       '(--no-download)--no-download[only install downloaded packages]' \
 543diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
 544index 399a54cb02aae802afb95f72a343b35b1412f779..7f86c0c76ed9e051a28aa82519d11776d0c05add 100644
 545--- a/plugins/pow/pow.plugin.zsh
 546+++ b/plugins/pow/pow.plugin.zsh
 547@@ -8,18 +8,18 @@
 548 # Supports command completion.
 549 #
 550 # If you are not already using completion you might need to enable it with
 551-# 
 552+#
 553 #    autoload -U compinit compinit
 554 #
 555 # Changes:
 556 #
 557-# Defaults to the current application, and will walk up the tree to find 
 558+# Defaults to the current application, and will walk up the tree to find
 559 # a config.ru file and restart the corresponding app
 560 #
 561-# Will Detect if a app does not exist in pow and print a (slightly) helpful 
 562+# Will Detect if a app does not exist in pow and print a (slightly) helpful
 563 # error message
 564 
 565-rack_root_detect(){
 566+rack_root(){
 567   setopt chaselinks
 568   local orgdir=$(pwd)
 569   local basedir=$(pwd)
 570@@ -32,6 +32,11 @@ rack_root_detect(){
 571 
 572   builtin cd $orgdir 2>/dev/null
 573   [[ ${basedir} == "/" ]] && return 1
 574+  echo $basedir
 575+}
 576+
 577+rack_root_detect(){
 578+  basedir=$(rack_root)
 579   echo `basename $basedir | sed -E "s/.(com|net|org)//"`
 580 }
 581 
 582@@ -51,16 +56,30 @@ kapow(){
 583 compctl -W ~/.pow -/ kapow
 584 
 585 powit(){
 586-	local basedir=$(pwd)
 587+  local basedir=$(pwd)
 588   local vhost=$1
 589   [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
 590   if [ ! -h ~/.pow/$vhost ]
 591-	then
 592-		echo "pow: Symlinking your app with pow. ${vhost}"
 593-	  [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
 594+  then
 595+    echo "pow: Symlinking your app with pow. ${vhost}"
 596+    [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
 597     return 1
 598   fi
 599 }
 600 
 601+powed(){
 602+  local basedir=$(rack_root)
 603+  find ~/.pow/ -type l -lname "*$basedir*" -exec basename {}'.dev' \;
 604+}
 605+
 606+# Restart pow process
 607+# taken from http://www.matthewratzloff.com/blog/2011/12/23/restarting-pow-when-dns-stops-responding
 608+repow(){
 609+  lsof | grep 20560 | awk '{print $2}' | xargs kill -9
 610+  launchctl unload ~/Library/LaunchAgents/cx.pow.powd.plist
 611+  launchctl load ~/Library/LaunchAgents/cx.pow.powd.plist
 612+  echo "restarted pow"
 613+}
 614+
 615 # View the standard out (puts) from any pow app
 616-alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
 617+alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
 618diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh
 619new file mode 100644
 620index 0000000000000000000000000000000000000000..320855233f38a5d5e342f5cc04b85a73c3785c50
 621--- /dev/null
 622+++ b/plugins/rake-fast/rake-fast.plugin.zsh
 623@@ -0,0 +1,51 @@
 624+# rake-fast
 625+# Fast rake autocompletion plugin for oh-my-zsh
 626+
 627+# This script caches the output for later usage and significantly speeds it up.
 628+# It generates a .rake_tasks file in parallel to the Rakefile.
 629+
 630+# You'll want to add `.rake_tasks` to your global .git_ignore file:
 631+# https://help.github.com/articles/ignoring-files#global-gitignore
 632+
 633+# You can force .rake_tasks to refresh with:
 634+# $ rake_refresh
 635+
 636+# This is entirely based on Ullrich Schäfer's work
 637+# (https://github.com/robb/.dotfiles/pull/10/),
 638+# which is inspired by this Ruby on Rails trick from 2006:
 639+# http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/
 640+
 641+_rake_refresh () {
 642+  if [ -f .rake_tasks ]; then
 643+    rm .rake_tasks
 644+  fi
 645+  echo "Generating .rake_tasks..." > /dev/stderr
 646+  _rake_generate
 647+  cat .rake_tasks
 648+}
 649+
 650+_rake_does_task_list_need_generating () {
 651+  if [ ! -f .rake_tasks ]; then return 0;
 652+  else
 653+    accurate=$(stat -f%m .rake_tasks)
 654+    changed=$(stat -f%m Rakefile)
 655+    return $(expr $accurate '>=' $changed)
 656+  fi
 657+}
 658+
 659+_rake_generate () {
 660+  rake --silent --tasks | cut -d " " -f 2 > .rake_tasks
 661+}
 662+
 663+_rake () {
 664+  if [ -f Rakefile ]; then
 665+    if _rake_does_task_list_need_generating; then
 666+      echo "\nGenerating .rake_tasks..." > /dev/stderr
 667+      _rake_generate
 668+    fi
 669+    compadd `cat .rake_tasks`
 670+  fi
 671+}
 672+
 673+compdef _rake rake
 674+alias rake_refresh='_rake_refresh'
 675diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
 676index 57ae2ca1fad7a1e76fad8aa4c598d25bfad0869b..b6795b91c59b94392060b23fe3664a6170632c16 100644
 677--- a/plugins/rbenv/rbenv.plugin.zsh
 678+++ b/plugins/rbenv/rbenv.plugin.zsh
 679@@ -10,9 +10,6 @@ FOUND_RBENV=0
 680 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
 681 if _homebrew-installed && _rbenv-from-homebrew-installed ; then
 682     rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
 683-    if [[ $RBENV_ROOT = '' ]]; then 
 684-      RBENV_ROOT="$HOME/.rbenv"
 685-    fi
 686 fi
 687 
 688 for rbenvdir in "${rbenvdirs[@]}" ; do
 689diff --git a/plugins/scd/README.md b/plugins/scd/README.md
 690new file mode 100644
 691index 0000000000000000000000000000000000000000..197cea50a45df926f924e10c8cd6647d50b7a5e0
 692--- /dev/null
 693+++ b/plugins/scd/README.md
 694@@ -0,0 +1,122 @@
 695+# scd - smart change of directory
 696+
 697+Define `scd` shell function for changing to any directory with
 698+a few keystrokes.
 699+
 700+`scd` keeps history of the visited directories, which serves as an index of
 701+the known paths.  The directory index is updated after every `cd` command in
 702+the shell and can be also filled manually by running `scd -a`.  To switch to
 703+some directory, `scd` needs few fragments of the desired path to match with
 704+the index.  A selection menu is displayed in case of several matches, with a
 705+preference given to recently visited paths.  `scd` can create permanent
 706+directory aliases, which appear as named directories in zsh session.
 707+
 708+## INSTALLATION
 709+
 710+For oh-my-zsh, add `scd` to the `plugins` array in the ~/.zshrc file as in the
 711+[template file](../../templates/zshrc.zsh-template#L45).
 712+
 713+Besides zsh, `scd` can be used with *bash*, *dash* or *tcsh*
 714+shells and is also available as [Vim](http://www.vim.org/) plugin and
 715+[IPython](http://ipython.org/) extension.  For installation details, see
 716+https://github.com/pavoljuhas/smart-change-directory.
 717+
 718+## SYNOPSIS
 719+
 720+```sh
 721+scd [options] [pattern1 pattern2 ...]
 722+```
 723+
 724+## OPTIONS
 725+
 726+<dl><dt>
 727+-a, --add</dt><dd>
 728+  add specified directories to the directory index.</dd><dt>
 729+
 730+--unindex</dt><dd>
 731+  remove specified directories from the index.</dd><dt>
 732+
 733+-r, --recursive</dt><dd>
 734+  apply options <em>--add</em> or <em>--unindex</em> recursively.</dd><dt>
 735+
 736+--alias=ALIAS</dt><dd>
 737+  create alias for the current or specified directory and save it to
 738+  <em>~/.scdalias.zsh</em>.</dd><dt>
 739+
 740+--unalias</dt><dd>
 741+  remove ALIAS definition for the current or specified directory from
 742+  <em>~/.scdalias.zsh</em>.</dd><dt>
 743+
 744+--list</dt><dd>
 745+  show matching directories and exit.</dd><dt>
 746+
 747+-v, --verbose</dt><dd>
 748+  display directory rank in the selection menu.</dd><dt>
 749+
 750+-h, --help</dt><dd>
 751+  display this options summary and exit.</dd>
 752+</dl>
 753+
 754+## Examples
 755+
 756+```sh
 757+# Index recursively some paths for the very first run
 758+scd -ar ~/Documents/
 759+
 760+# Change to a directory path matching "doc"
 761+scd doc
 762+
 763+# Change to a path matching all of "a", "b" and "c"
 764+scd a b c
 765+
 766+# Change to a directory path that ends with "ts"
 767+scd "ts(#e)"
 768+
 769+# Show selection menu and ranking of 20 most likely directories
 770+scd -v
 771+
 772+# Alias current directory as "xray"
 773+scd --alias=xray
 774+
 775+# Jump to a previously defined aliased directory
 776+scd xray
 777+```
 778+
 779+# FILES
 780+
 781+<dl><dt>
 782+~/.scdhistory</dt><dd>
 783+    time-stamped index of visited directories.</dd><dt>
 784+
 785+~/.scdalias.zsh</dt><dd>
 786+    scd-generated definitions of directory aliases.</dd>
 787+</dl>
 788+
 789+# ENVIRONMENT
 790+
 791+<dl><dt>
 792+SCD_HISTFILE</dt><dd>
 793+    path to the scd index file (by default ~/.scdhistory).</dd><dt>
 794diff --git a/plugins/scd/scd b/plugins/scd/scd
 795new file mode 100755
 796index 0000000000000000000000000000000000000000..1567d2736cf8f4fb9582dc35dfc97b2bace9d0c9
 797--- /dev/null
 798+++ b/plugins/scd/scd
 799@@ -0,0 +1,353 @@
 800+#!/bin/zsh -f
 801+
 802+emulate -L zsh
 803+local EXIT=return
 804+if [[ $(whence -w $0) == *:' 'command ]]; then
 805+    emulate -R zsh
 806+    local RUNNING_AS_COMMAND=1
 807+    EXIT=exit
 808+fi
 809+
 810+local DOC='scd -- smart change to a recently used directory
 811+usage: scd [options] [pattern1 pattern2 ...]
 812+Go to a directory path that contains all fixed string patterns.  Prefer
 813+recently visited directories and directories with patterns in their tail
 814+component.  Display a selection menu in case of multiple matches.
 815+
 816+Options:
 817+  -a, --add         add specified directories to the directory index
 818+  --unindex         remove specified directories from the index
 819+  -r, --recursive   apply options --add or --unindex recursively
 820+  --alias=ALIAS     create alias for the current or specified directory and
 821+                    store it in ~/.scdalias.zsh
 822+  --unalias         remove ALIAS definition for the current or specified
 823+                    directory from ~/.scdalias.zsh
 824+  --list            show matching directories and exit
 825+  -v, --verbose     display directory rank in the selection menu
 826+  -h, --help        display this message and exit
 827+'
 828+
 829+local SCD_HISTFILE=${SCD_HISTFILE:-${HOME}/.scdhistory}
 830+local SCD_HISTSIZE=${SCD_HISTSIZE:-5000}
 831+local SCD_MENUSIZE=${SCD_MENUSIZE:-20}
 832+local SCD_MEANLIFE=${SCD_MEANLIFE:-86400}
 833+local SCD_THRESHOLD=${SCD_THRESHOLD:-0.005}
 834+local SCD_SCRIPT=${RUNNING_AS_COMMAND:+$SCD_SCRIPT}
 835+local SCD_ALIAS=~/.scdalias.zsh
 836+
 837+local ICASE a d m p i tdir maxrank threshold
 838+local opt_help opt_add opt_unindex opt_recursive opt_verbose
 839+local opt_alias opt_unalias opt_list
 840+local -A drank dalias
 841+local dmatching
 842+local last_directory
 843+
 844+setopt extendedhistory extendedglob noautonamedirs brace_ccl
 845+
 846+# If SCD_SCRIPT is defined make sure the file exists and is empty.
 847+# This removes any previous old commands.
 848+[[ -n "$SCD_SCRIPT" ]] && [[ -s $SCD_SCRIPT || ! -f $SCD_SCRIPT ]] && (
 849+    umask 077
 850+    : >| $SCD_SCRIPT
 851+)
 852+
 853+# process command line options
 854+zmodload -i zsh/zutil
 855+zmodload -i zsh/datetime
 856+zparseopts -D -- a=opt_add -add=opt_add -unindex=opt_unindex \
 857+    r=opt_recursive -recursive=opt_recursive \
 858+    -alias:=opt_alias -unalias=opt_unalias -list=opt_list \
 859+    v=opt_verbose -verbose=opt_verbose h=opt_help -help=opt_help \
 860+    || $EXIT $?
 861+
 862+if [[ -n $opt_help ]]; then
 863+    print $DOC
 864+    $EXIT
 865+fi
 866+
 867+# load directory aliases if they exist
 868+[[ -r $SCD_ALIAS ]] && source $SCD_ALIAS
 869+
 870+# works faster than the (:a) modifier and is compatible with zsh 4.2.6
 871+_scd_Y19oug_abspath() {
 872+    set -A $1 ${(ps:\0:)"$(
 873+        unfunction -m "*"; shift
 874+        for d; do
 875+            cd $d && print -Nr -- $PWD && cd $OLDPWD
 876+        done
 877+        )"}
 878+}
 879+
 880+# define directory alias
 881+if [[ -n $opt_alias ]]; then
 882+    if [[ -n $1 && ! -d $1 ]]; then
 883+        print -u2 "'$1' is not a directory."
 884+        $EXIT 1
 885+    fi
 886+    a=${opt_alias[-1]#=}
 887+    _scd_Y19oug_abspath d ${1:-$PWD}
 888+    # alias in the current shell, update alias file if successful
 889+    hash -d -- $a=$d &&
 890+    (
 891+        umask 077
 892+        hash -dr
 893+        [[ -r $SCD_ALIAS ]] && source $SCD_ALIAS
 894+        hash -d -- $a=$d
 895+        hash -dL >| $SCD_ALIAS
 896+    )
 897+    $EXIT $?
 898+fi
 899diff --git a/plugins/scd/scd.plugin.zsh b/plugins/scd/scd.plugin.zsh
 900new file mode 100644
 901index 0000000000000000000000000000000000000000..0197c53a170227363c085d1a5fc585d5be92af11
 902--- /dev/null
 903+++ b/plugins/scd/scd.plugin.zsh
 904@@ -0,0 +1,19 @@
 905+## The scd script should autoload as a shell function.
 906+autoload scd
 907+
 908+
 909+## If the scd function exists, define a change-directory-hook function
 910+## to record visited directories in the scd index.
 911+if [[ ${+functions[scd]} == 1 ]]; then
 912+    scd_chpwd_hook() { scd --add $PWD }
 913+    autoload add-zsh-hook
 914+    add-zsh-hook chpwd scd_chpwd_hook
 915+fi
 916+
 917+
 918+## Allow scd usage with unquoted wildcard characters such as "*" or "?".
 919+alias scd='noglob scd'
 920+
 921+
 922+## Load the directory aliases created by scd if any.
 923+if [[ -s ~/.scdalias.zsh ]]; then source ~/.scdalias.zsh; fi
 924diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
 925index 9af8cb0368f7ae49f9171f1d4cfb1136ab0aa795..d55ae6709037978f7e133d420e5acb874d2711a7 100644
 926--- a/plugins/vagrant/_vagrant
 927+++ b/plugins/vagrant/_vagrant
 928@@ -44,7 +44,7 @@ __task_list ()
 929 
 930 __box_list ()
 931 {
 932-    _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
 933+    _wanted application expl 'command' compadd $(command vagrant box list | sed -e 's/ /\\ /g')
 934 }
 935 
 936 __vm_list ()
 937diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
 938index a06100472a9710b1bc112121239a2b169f898f88..3ed32b3fb29decd731c6780a73f757f8945c6bd6 100644
 939--- a/plugins/vi-mode/vi-mode.plugin.zsh
 940+++ b/plugins/vi-mode/vi-mode.plugin.zsh
 941@@ -17,9 +17,15 @@ function zle-keymap-select zle-line-init zle-line-finish {
 942 zle -N zle-line-init
 943 zle -N zle-line-finish
 944 zle -N zle-keymap-select
 945+zle -N edit-command-line
 946+
 947 
 948 bindkey -v
 949 
 950+# allow v to edit the command line (standard behaviour)
 951+autoload -Uz edit-command-line
 952+bindkey -M vicmd 'v' edit-command-line
 953+
 954 # if mode indicator wasn't setup by theme, define default
 955 if [[ "$MODE_INDICATOR" == "" ]]; then
 956   MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}"
 957diff --git a/plugins/vim-interaction/README.md b/plugins/vim-interaction/README.md
 958new file mode 100644
 959index 0000000000000000000000000000000000000000..681648018e69ccb077909e9fcd6346be9d55d4d1
 960--- /dev/null
 961+++ b/plugins/vim-interaction/README.md
 962@@ -0,0 +1,82 @@
 963+# Vim Interaction #
 964+
 965+The plugin presents a function called `callvim` whose usage is:
 966+
 967+    usage: callvim [-b cmd] [-a cmd] [file ... fileN]
 968+    
 969+      -b cmd     Run this command in GVIM before editing the first file
 970+      -a cmd     Run this command in GVIM after editing the first file
 971+      file       The file to edit
 972+      ... fileN  The other files to add to the argslist
 973+
 974+## Rationale ##
 975+
 976+The idea for this script is to give you some decent interaction with a running
 977+GVim session.  Normally you'll be running around your filesystem doing any
 978+number of amazing things and you'll need to load some files into GVim for
 979+editing, inspecting, destruction, or other bits of mayhem.  This script lets you
 980+do that.
 981+
 982+## Aliases ##
 983+
 984+There are a few aliases presented as well:
 985+
 986+* `v` A shorthand for `callvim`
 987+* `vvsp` Edits the passed in file but first makes a vertical split
 988+* `vhsp` Edits the passed in file but first makes a horizontal split
 989+
 990+## Post Callout ##
 991+
 992+At the end of the `callvim` function we invoke the `postCallVim` function if it
 993+exists.  If you're using MacVim, for example, you could define a function that
 994+brings window focus to it after the file is loaded:
 995+
 996+    function postCallVim
 997+    {
 998+      osascript -e 'tell application "MacVim" to activate'
 999+    }
1000+
1001+This'll be different depending on your OS / Window Manager.
1002+
1003+## Examples ##
1004+
1005+This will load `/tmp/myfile.scala` into the running GVim session:
1006+
1007+    > v /tmp/myfile.scala
1008+
1009+This will load it after first doing a vertical split:
1010+
1011+    > vvsp /tmp/myfile.scala
1012+    or
1013+    > v -b':vsp' /tmp/myfile.scala
1014+
1015+This will load it after doing a horizontal split, then moving to the bottom of
1016+the file:
1017+
1018+    > vhsp -aG /tmp/myfile.scala
1019+    or
1020+    > v -b':sp' -aG /tmp/myfile.scala
1021+
1022+This will load the file and then copy the first line to the end (Why you would
1023+ever want to do this... I dunno):
1024+
1025+    > v -a':1t$' /tmp/myfile.scala
1026+
1027+And this will load all of the `*.txt` files into the args list:
1028+
1029+    > v *.txt
1030+
1031+If you want to load files into areas that are already split, use one of the
1032+aliases for that:
1033+
1034+    # Do a ':wincmd h' first
1035+    > vh /tmp/myfile.scala
1036+
1037+    # Do a ':wincmd j' first
1038+    > vj /tmp/myfile.scala
1039+
1040+    # Do a ':wincmd k' first
1041+    > vk /tmp/myfile.scala
1042+
1043+    # Do a ':wincmd l' first
1044+    > vl /tmp/myfile.scala
1045diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh
1046new file mode 100644
1047index 0000000000000000000000000000000000000000..5142f1f9b586607ec17355c33161ef99c9c486f8
1048--- /dev/null
1049+++ b/plugins/vim-interaction/vim-interaction.plugin.zsh
1050@@ -0,0 +1,72 @@
1051+#
1052+# See README.md
1053+#
1054+# Derek Wyatt (derek@{myfirstnamemylastname}.org
1055+# 
1056+
1057+function resolveFile
1058+{
1059+  if [ -f "$1" ]; then
1060+    echo $(readlink -f "$1")
1061+  elif [[ "${1#/}" == "$1" ]]; then
1062+    echo "$(pwd)/$1"
1063+  else
1064+    echo $1
1065+  fi
1066+}
1067+
1068+function callvim
1069+{
1070+  if [[ $# == 0 ]]; then
1071+    cat <<EOH
1072+usage: callvim [-b cmd] [-a cmd] [file ... fileN]
1073+
1074+  -b cmd     Run this command in GVIM before editing the first file
1075+  -a cmd     Run this command in GVIM after editing the first file
1076+  file       The file to edit
1077+  ... fileN  The other files to add to the argslist
1078+EOH
1079+    return 0
1080+  fi
1081+
1082+  local cmd=""
1083+  local before="<esc>"
1084+  local after=""
1085+  while getopts ":b:a:" option
1086+  do
1087+    case $option in
1088+      a) after="$OPTARG"
1089+         ;;
1090+      b) before="$OPTARG"
1091+         ;;
1092+    esac
1093+  done
1094+  shift $((OPTIND-1))
1095+  if [[ ${after#:} != $after && ${after%<cr>} == $after ]]; then
1096+    after="$after<cr>"
1097+  fi
1098+  if [[ ${before#:} != $before && ${before%<cr>} == $before ]]; then
1099+    before="$before<cr>"
1100+  fi
1101+  local files=""
1102+  for f in $@
1103+  do
1104+    files="$files $(resolveFile $f)"
1105+  done
1106+  if [[ -n $files ]]; then
1107+    files=':args! '"$files<cr>"
1108+  fi
1109+  cmd="$before$files$after"
1110+  gvim --remote-send "$cmd"
1111+  if typeset -f postCallVim > /dev/null; then
1112+    postCallVim
1113+  fi
1114+}
1115+
1116+alias v=callvim
1117+alias vvsp="callvim -b':vsp'"
1118+alias vhsp="callvim -b':sp'"
1119+alias vk="callvim -b':wincmd k'"
1120+alias vj="callvim -b':wincmd j'"
1121+alias vl="callvim -b':wincmd l'"
1122+alias vh="callvim -b':wincmd h'"
1123diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
1124index 16f32da6e170cd1ab98782c067d3c8c820227fe5..f58bda1ad40a763a733b8532cdd684080bc36173 100644
1125--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
1126+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
1127@@ -1,4 +1,4 @@
1128-virtualenvwrapper='virtualenvwrapper_lazy.sh'
1129+virtualenvwrapper='virtualenvwrapper.sh'
1130 if (( $+commands[$virtualenvwrapper] )); then
1131   source ${${virtualenvwrapper}:c}
1132 
1133@@ -17,7 +17,7 @@ if (( $+commands[$virtualenvwrapper] )); then
1134             # Check for virtualenv name override
1135             if [[ -f "$PROJECT_ROOT/.venv" ]]; then
1136                 ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
1137-            elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then 
1138+            elif [[ -f "$PROJECT_ROOT/.venv/bin/activate" ]];then
1139                 ENV_NAME="$PROJECT_ROOT/.venv"
1140             elif [[ "$PROJECT_ROOT" != "." ]]; then
1141                 ENV_NAME=`basename "$PROJECT_ROOT"`
1142diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
1143new file mode 100644
1144index 0000000000000000000000000000000000000000..a435dbc8d999bbbb0b193b44525a11ba4a6f0f1f
1145--- /dev/null
1146+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
1147@@ -0,0 +1,13 @@
1148+zsh_cache=$HOME/.zsh_cache
1149+mkdir -p $zsh_cache
1150+
1151+# reload zshrc
1152+function src()
1153+{
1154+  autoload -U compinit zrecompile
1155+  compinit -d $zsh_cache/zcomp-$HOST
1156+  for f in $HOME/.zshrc $zsh_cache/zcomp-$HOST; do
1157+    zrecompile -p $f && rm -f $f.zwc.old
1158+  done
1159+  source ~/.zshrc
1160+}
1161diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
1162index c2254d055dc485e4581beee4291478e89729f5ee..c25c20e75dfffa33be9d38e6f41eb38c6e523245 100644
1163--- a/templates/zshrc.zsh-template
1164+++ b/templates/zshrc.zsh-template
1165@@ -1,5 +1,5 @@
1166 # Path to your oh-my-zsh configuration.
1167-ZSH=$HOME/.oh-my-zsh
1168+export ZSH=$HOME/.oh-my-zsh
1169 
1170 # Set name of the theme to load.
1171 # Look in ~/.oh-my-zsh/themes/
1172diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
1173index 1ff86b54c41d1e188fe89ee5dceeb241701e0be9..f1057a9a974fafd033ea30a613d76295aefaaaa5 100644
1174--- a/themes/gallois.zsh-theme
1175+++ b/themes/gallois.zsh-theme
1176@@ -18,7 +18,7 @@ else
1177   if which rbenv &> /dev/null; then
1178     RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
1179   else
1180-    if which chruby_prompt_info &> /dev/null; then
1181+    if [[ -n `which chruby_prompt_info` && -n `chruby_prompt_info` ]]; then
1182       RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1'
1183     else
1184       RPS1='$(git_custom_status) $EPS1'
1185diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme
1186index 3c6b8a409f6de3d5750cacff36edfdaad764e003..33f187bc6cd42770ae74329e769128c472b300e7 100644
1187--- a/themes/gnzh.zsh-theme
1188+++ b/themes/gnzh.zsh-theme
1189@@ -6,7 +6,7 @@ autoload -U colors zsh/terminfo # Used in the colour alias below
1190 colors
1191 setopt prompt_subst
1192 
1193-# make some aliases for the colours: (coud use normal escap.seq's too)
1194+# make some aliases for the colours: (could use normal escape sequences too)
1195 for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
1196   eval PR_$color='%{$fg[${(L)color}]%}'
1197 done
1198@@ -25,7 +25,7 @@ elif [[ $UID -eq 0 ]]; then # root
1199 fi
1200 
1201 # Check if we are on SSH or not
1202-if [[ -n "$SSH_CLIENT"  ||  -n "$SSH2_CLIENT" ]]; then 
1203+if [[ -n "$SSH_CLIENT"  ||  -n "$SSH2_CLIENT" ]]; then
1204   eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH
1205 else
1206   eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH
1207@@ -36,12 +36,12 @@ local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
1208 local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}'
1209 local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}'
1210 local rvm_ruby=''
1211-if which rvm-prompt &> /dev/null; then
1212+if ${HOME}/.rvm/bin/rvm-prompt &> /dev/null; then # detect local user rvm installation
1213+  rvm_ruby='%{$PR_RED%}‹$(${HOME}/.rvm/bin/rvm-prompt i v g s)›%{$PR_NO_COLOR%}'
1214+elif which rvm-prompt &> /dev/null; then # detect sysem-wide rvm installation
1215   rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}'
1216-else
1217-  if which rbenv &> /dev/null; then
1218-    rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}'
1219-  fi
1220+elif which rbenv &> /dev/null; then # detect Simple Ruby Version management
1221+  rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}'
1222 fi
1223 local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}'
1224