7576f856b915e6e02c5990cd7e221d7b9efbe44a

Author
Ramses Ladlani <ramses.ladlani@fishingcactus.com>
Committer
Ramses Ladlani <ramses.ladlani@fishingcactus.com>
Date

Message

Merge remote-tracking branch 'robyrussel/master' into fix-atom_plugin_for_cygwin

Discarded all previous changes to atom plugin for easier review in next commit.

Diff

This diff is truncated to protect this page.

   1diff --git a/lib/compfix.zsh b/lib/compfix.zsh
   2new file mode 100644
   3index 0000000000000000000000000000000000000000..208aaadb1ebad0e25ebdef29192da815be8136bd
   4--- /dev/null
   5+++ b/lib/compfix.zsh
   6@@ -0,0 +1,60 @@
   7+# Handle completions insecurities (i.e., completion-dependent directories with
   8+# insecure ownership or permissions) by:
   9+#
  10+# * Human-readably notifying the user of these insecurities.
  11+# * Moving away all existing completion caches to a temporary directory. Since
  12+#   any of these caches may have been generated from insecure directories, they
  13+#   are all suspect now. Failing to do so typically causes subsequent compinit()
  14+#   calls to fail with "command not found: compdef" errors. (That's bad.)
  15+function handle_completion_insecurities() {
  16+  # List of the absolute paths of all unique insecure directories, split on
  17+  # newline from compaudit()'s output resembling:
  18+  #
  19+  #     There are insecure directories:
  20+  #     /usr/share/zsh/site-functions
  21+  #     /usr/share/zsh/5.0.6/functions
  22+  #     /usr/share/zsh
  23+  #     /usr/share/zsh/5.0.6
  24+  #
  25+  # Since the ignorable first line is printed to stderr and thus not captured,
  26+  # stderr is squelched to prevent this output from leaking to the user. 
  27+  local -aU insecure_dirs
  28+  insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
  29+
  30+  # If no such directories exist, get us out of here.
  31+  if (( ! ${#insecure_dirs} )); then
  32+      print "[oh-my-zsh] No insecure completion-dependent directories detected."
  33+      return
  34+  fi
  35+
  36+  # List ownership and permissions of all insecure directories.
  37+  print "[oh-my-zsh] Insecure completion-dependent directories detected:"
  38+  ls -ld "${(@)insecure_dirs}"
  39+  print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
  40+  print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
  41+  print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
  42+
  43+  # Locally enable the "NULL_GLOB" option, thus removing unmatched filename
  44+  # globs from argument lists *AND* printing no warning when doing so. Failing
  45+  # to do so prints an unreadable warning if no completion caches exist below.
  46+  setopt local_options null_glob
  47+
  48+  # List of the absolute paths of all unique existing completion caches.
  49+  local -aU zcompdump_files
  50+  zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
  51+
  52+  # Move such caches to a temporary directory.
  53+  if (( ${#zcompdump_files} )); then
  54+    # Absolute path of the directory to which such files will be moved.
  55+    local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
  56+
  57+    # List such files first.
  58+    print "[oh-my-zsh] Insecure completion caches also detected:"
  59+    ls -l "${(@)zcompdump_files}"
  60+
  61+    # For safety, move rather than permanently remove such files.
  62+    print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
  63+    mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
  64+    mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
  65+  fi
  66+}
  67diff --git a/lib/completion.zsh b/lib/completion.zsh
  68index 452c0dfe765539dd6cf0a83f85037c7ac5f571a9..f5b29247127543f4aec6ffec6bdb4b29bcdd9de1 100644
  69--- a/lib/completion.zsh
  70+++ b/lib/completion.zsh
  71@@ -58,9 +58,13 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
  72 # ... unless we really want to.
  73 zstyle '*' single-ignored show
  74 
  75-if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
  76+if [[ $COMPLETION_WAITING_DOTS = true ]]; then
  77   expand-or-complete-with-dots() {
  78-    echo -n "\e[31m......\e[0m"
  79+    # toggle line-wrapping off and back on again
  80+    [[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
  81+    print -Pn "%{%F{red}......%f%}"
  82+    [[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
  83+
  84     zle expand-or-complete
  85     zle redisplay
  86   }
  87diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh
  88new file mode 100644
  89index 0000000000000000000000000000000000000000..afc33829b01c0a09dc0633a21fbfee906c5d3116
  90--- /dev/null
  91+++ b/lib/diagnostics.zsh
  92@@ -0,0 +1,335 @@
  93+# diagnostics.zsh
  94+#
  95+# Diagnostic and debugging support for oh-my-zsh
  96+
  97+# omz_diagnostic_dump()
  98+#
  99+# Author: Andrew Janke <andrew@apjanke.net>
 100+#
 101+# Usage:
 102+#
 103+# omz_diagnostic_dump [-v] [-V] [file]
 104+#
 105+# NOTE: This is a work in progress. Its interface and behavior are going to change,
 106+# and probably in non-back-compatible ways.
 107+#
 108+# Outputs a bunch of information about the state and configuration of
 109+# oh-my-zsh, zsh, and the user's system. This is intended to provide a
 110+# bunch of context for diagnosing your own or a third party's problems, and to
 111+# be suitable for posting to public bug reports.
 112+#
 113+# The output is human-readable and its format may change over time. It is not
 114+# suitable for parsing. All the output is in one single file so it can be posted
 115+# as a gist or bug comment on GitHub. GitHub doesn't support attaching tarballs
 116+# or other files to bugs; otherwise, this would probably have an option to produce
 117+# tarballs that contain copies of the config and customization files instead of
 118+# catting them all in to one file.
 119+#
 120+# This is intended to be widely portable, and run anywhere that oh-my-zsh does.
 121+# Feel free to report any portability issues as bugs.
 122+#
 123+# This is written in a defensive style so it still works (and can detect) cases when
 124+# basic functionality like echo and which have been redefined. In particular, almost
 125+# everything is invoked with "builtin" or "command", to work in the face of user 
 126+# redefinitions.
 127+#
 128+# OPTIONS
 129+#
 130+# [file]   Specifies the output file. If not given, a file in the current directory
 131+#        is selected automatically.
 132+#
 133+# -v    Increase the verbosity of the dump output. May be specified multiple times.
 134+#       Verbosity levels:
 135+#        0 - Basic info, shell state, omz configuration, git state
 136+#        1 - (default) Adds key binding info and configuration file contents
 137+#        2 - Adds zcompdump file contents
 138+#
 139+# -V    Reduce the verbosity of the dump output. May be specified multiple times.
 140+#
 141+# TODO:
 142+# * Multi-file capture
 143+# * Add automatic gist uploading
 144+# * Consider whether to move default output file location to TMPDIR. More robust
 145+#     but less user friendly.
 146+#
 147+function omz_diagnostic_dump() {
 148+  emulate -L zsh
 149+
 150+  builtin echo "Generating diagnostic dump; please be patient..."
 151+  
 152+  local thisfcn=omz_diagnostic_dump
 153+  local -A opts
 154+  local opt_verbose opt_noverbose opt_outfile
 155+  local timestamp=$(date +%Y%m%d-%H%M%S)
 156+  local outfile=omz_diagdump_$timestamp.txt
 157+  builtin zparseopts -A opts -D -- "v+=opt_verbose" "V+=opt_noverbose"
 158+  local verbose n_verbose=${#opt_verbose} n_noverbose=${#opt_noverbose}
 159+  (( verbose = 1 + n_verbose - n_noverbose ))
 160+
 161+  if [[ ${#*} > 0 ]]; then
 162+    opt_outfile=$1
 163+  fi
 164+  if [[ ${#*} > 1 ]]; then
 165+    builtin echo "$thisfcn: error: too many arguments" >&2
 166+    return 1
 167+  fi
 168+  if [[ -n "$opt_outfile" ]]; then
 169+    outfile="$opt_outfile"
 170+  fi
 171+
 172+  # Always write directly to a file so terminal escape sequences are
 173+  # captured cleanly
 174+  _omz_diag_dump_one_big_text &> "$outfile"
 175+  if [[ $? != 0 ]]; then
 176+    builtin echo "$thisfcn: error while creating diagnostic dump; see $outfile for details"
 177+  fi
 178+
 179+  builtin echo
 180+  builtin echo Diagnostic dump file created at: "$outfile"
 181+  builtin echo
 182+  builtin echo To share this with OMZ developers, post it as a gist on GitHub 
 183+  builtin echo at "https://gist.github.com" and share the link to the gist.
 184+  builtin echo
 185+  builtin echo "WARNING: This dump file contains all your zsh and omz configuration files,"
 186+  builtin echo "so don't share it publicly if there's sensitive information in them."
 187+  builtin echo
 188+
 189+}
 190+
 191+function _omz_diag_dump_one_big_text() {
 192diff --git a/lib/functions.zsh b/lib/functions.zsh
 193index 0d632a2686693f5d624ebd17694d9c4e18bc3d3e..efb73a1bd91170f1c2622635875ceb900942ee43 100644
 194--- a/lib/functions.zsh
 195+++ b/lib/functions.zsh
 196@@ -89,3 +89,135 @@ function env_default() {
 197     env | grep -q "^$1=" && return 0 
 198     export "$1=$2"       && return 3
 199 }
 200+
 201+
 202+# Required for $langinfo
 203+zmodload zsh/langinfo
 204+
 205+# URL-encode a string
 206+#
 207+# Encodes a string using RFC 2396 URL-encoding (%-escaped).
 208+# See: https://www.ietf.org/rfc/rfc2396.txt
 209+#
 210+# By default, reserved characters and unreserved "mark" characters are
 211+# not escaped by this function. This allows the common usage of passing
 212+# an entire URL in, and encoding just special characters in it, with 
 213+# the expectation that reserved and mark characters are used appropriately.
 214+# The -r and -m options turn on escaping of the reserved and mark characters,
 215+# respectively, which allows arbitrary strings to be fully escaped for
 216+# embedding inside URLs, where reserved characters might be misinterpreted.
 217+#
 218+# Prints the encoded string on stdout.
 219+# Returns nonzero if encoding failed.
 220+#
 221+# Usage:
 222+#  omz_urlencode [-r] [-m] <string>
 223+#  
 224+#    -r causes reserved characters (;/?:@&=+$,) to be escaped
 225+#
 226+#    -m causes "mark" characters (_.!~*''()-) to be escaped
 227+#
 228+#    -P causes spaces to be encoded as '%20' instead of '+'
 229+function omz_urlencode() {
 230+  emulate -L zsh
 231+  zparseopts -D -E -a opts r m P
 232+
 233+  local in_str=$1
 234+  local url_str=""
 235+  local spaces_as_plus
 236+  if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
 237+  local str="$in_str"
 238+
 239+  # URLs must use UTF-8 encoding; convert str to UTF-8 if required
 240+  local encoding=$langinfo[CODESET]
 241+  local safe_encodings
 242+  safe_encodings=(UTF-8 utf8 US-ASCII)
 243+  if [[ -z ${safe_encodings[(r)$encoding]} ]]; then
 244+    str=$(echo -E "$str" | iconv -f $encoding -t UTF-8)
 245+    if [[ $? != 0 ]]; then
 246+      echo "Error converting string from $encoding to UTF-8" >&2
 247+      return 1
 248+    fi
 249+  fi
 250+
 251+  # Use LC_CTYPE=C to process text byte-by-byte
 252+  local i byte ord LC_ALL=C
 253+  export LC_ALL
 254+  local reserved=';/?:@&=+$,'
 255+  local mark='_.!~*''()-'
 256+  local dont_escape="[A-Za-z0-9"
 257+  if [[ -z $opts[(r)-r] ]]; then
 258+    dont_escape+=$reserved
 259+  fi
 260+  # $mark must be last because of the "-"
 261+  if [[ -z $opts[(r)-m] ]]; then
 262+    dont_escape+=$mark
 263+  fi
 264+  dont_escape+="]"
 265+
 266+  # Implemented to use a single printf call and avoid subshells in the loop,
 267+  # for performance (primarily on Windows).
 268+  local url_str=""
 269+  for (( i = 1; i <= ${#str}; ++i )); do
 270+    byte="$str[i]"
 271+    if [[ "$byte" =~ "$dont_escape" ]]; then
 272+      url_str+="$byte"
 273+    else
 274+      if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
 275+        url_str+="+"
 276+      else
 277+        ord=$(( [##16] #byte ))
 278+        url_str+="%$ord"
 279+      fi
 280+    fi
 281+  done
 282+  echo -E "$url_str"
 283+}
 284+
 285+# URL-decode a string
 286+#
 287+# Decodes a RFC 2396 URL-encoded (%-escaped) string.
 288+# This decodes the '+' and '%' escapes in the input string, and leaves 
 289+# other characters unchanged. Does not enforce that the input is a 
 290+# valid URL-encoded string. This is a convenience to allow callers to
 291+# pass in a full URL or similar strings and decode them for human
 292+# presentation.
 293+#
 294+# Outputs the encoded string on stdout.
 295+# Returns nonzero if encoding failed.
 296diff --git a/lib/git.zsh b/lib/git.zsh
 297index caa7e632913251f9694b3a3b7cb357e2879e02cf..baf86371724d01ae842bbfe6d4f8e39530caf208 100644
 298--- a/lib/git.zsh
 299+++ b/lib/git.zsh
 300@@ -36,7 +36,10 @@ git_remote_status() {
 301         ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
 302         behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
 303 
 304-        if [ $ahead -gt 0 ] && [ $behind -eq 0 ]
 305+        if [ $ahead -eq 0 ] && [ $behind -eq 0 ]
 306+        then
 307+          echo "$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
 308+        elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
 309         then
 310             git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
 311             git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
 312diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 313index babbaa95789afb3233e8b4eb74216ceed44ce716..5f61fe8ef2d4e3cd34fe441dde04779f709f9fa7 100644
 314--- a/lib/termsupport.zsh
 315+++ b/lib/termsupport.zsh
 316@@ -33,6 +33,7 @@ fi
 317 
 318 # Runs before showing the prompt
 319 function omz_termsupport_precmd {
 320+  emulate -L zsh
 321   if [[ $DISABLE_AUTO_TITLE == true ]]; then
 322     return
 323   fi
 324@@ -42,11 +43,11 @@ function omz_termsupport_precmd {
 325 
 326 # Runs before executing the command
 327 function omz_termsupport_preexec {
 328+  emulate -L zsh
 329   if [[ $DISABLE_AUTO_TITLE == true ]]; then
 330     return
 331   fi
 332 
 333-  emulate -L zsh
 334   setopt extended_glob
 335 
 336   # cmd name only, or if this is sudo or ssh, the next cmd
 337@@ -60,14 +61,28 @@ precmd_functions+=(omz_termsupport_precmd)
 338 preexec_functions+=(omz_termsupport_preexec)
 339 
 340 
 341-# Runs before showing the prompt, to update the current directory in Terminal.app
 342-function omz_termsupport_cwd {
 343-  # Notify Terminal.app of current directory using undocumented OSC sequence
 344-  # found in OS X 10.9 and 10.10's /etc/bashrc
 345-  if [[ $TERM_PROGRAM == Apple_Terminal ]] && [[ -z $INSIDE_EMACS ]]; then
 346-    local PWD_URL="file://$HOSTNAME${PWD// /%20}"
 347-    printf '\e]7;%s\a' "$PWD_URL"
 348-  fi
 349-}
 350+# Keep Apple Terminal.app's current working directory updated
 351+# Based on this answer: http://superuser.com/a/315029
 352+# With extra fixes to handle multibyte chars and non-UTF-8 locales
 353 
 354-precmd_functions+=(omz_termsupport_cwd)
 355+if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
 356+
 357+  # Emits the control sequence to notify Terminal.app of the cwd
 358+  function update_terminalapp_cwd() {
 359+    emulate -L zsh
 360+    # Identify the directory using a "file:" scheme URL, including
 361+    # the host name to disambiguate local vs. remote paths.
 362+
 363+    # Percent-encode the pathname.
 364+    local URL_PATH=$(omz_urlencode -P $PWD)
 365+    [[ $? != 0 ]] && return 1
 366+    local PWD_URL="file://$HOST$URL_PATH"
 367+    # Undocumented Terminal.app-specific control sequence
 368+    printf '\e]7;%s\a' $PWD_URL
 369+  }
 370+
 371+  # Use a precmd hook instead of a chpwd hook to avoid contaminating output
 372+  precmd_functions+=(update_terminalapp_cwd)
 373+  # Run once to get initial cwd set
 374+  update_terminalapp_cwd
 375+fi
 376diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
 377index 926303ca4509cd89bbc30187fd99879c1fbeb771..ebb11fb3185cef97ef29c8b6f11174c7669986ac 100644
 378--- a/lib/theme-and-appearance.zsh
 379+++ b/lib/theme-and-appearance.zsh
 380@@ -11,8 +11,11 @@ then
 381     # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
 382     gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
 383   elif [[ "$(uname -s)" == "OpenBSD" ]]; then
 384-    # On OpenBSD, test if "colorls" is installed (this one supports colors);
 385-    # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G
 386+    # On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base, 
 387+    # with color and multibyte support) are available from ports.  "colorls"  
 388+    # will be installed on purpose and can't be pulled in by installing 
 389+    # coreutils, so prefer it to "gls".
 390+    gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
 391     colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
 392   else
 393     ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
 394diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 395index 4e5f77990dd567ca1495ed2af948473609ed1bfe..8e31ddd0ff62c43d187cd6f6fd2bf97a72a0bc11 100644
 396--- a/oh-my-zsh.sh
 397+++ b/oh-my-zsh.sh
 398@@ -8,6 +8,9 @@ fi
 399 # add a function path
 400 fpath=($ZSH/functions $ZSH/completions $fpath)
 401 
 402+# Load all stock functions (from $fpath files) called below.
 403+autoload -U compaudit compinit
 404+
 405 # Set ZSH_CUSTOM to the path where your custom config files
 406 # and plugins exists, or else we will use the default custom/
 407 if [[ -z "$ZSH_CUSTOM" ]]; then
 408@@ -59,9 +62,14 @@ if [ -z "$ZSH_COMPDUMP" ]; then
 409   ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
 410 fi
 411 
 412-# Load and run compinit
 413-autoload -U compinit
 414-compinit -i -d "${ZSH_COMPDUMP}"
 415+# If completion insecurities exist, warn the user without enabling completions.
 416+if ! compaudit &>/dev/null; then
 417+  # This function resides in the "lib/compfix.zsh" script sourced above.
 418+  handle_completion_insecurities
 419+# Else, enable and cache completions to the desired file.
 420+else
 421+  compinit -d "${ZSH_COMPDUMP}"
 422+fi
 423 
 424 # Load all of the plugins that were defined in ~/.zshrc
 425 for plugin ($plugins); do
 426diff --git a/plugins/atom/README.md b/plugins/atom/README.md
 427index 75d77a0ac1c3732be4dbab1b4062e4f8e1d315fc..6350c647b029ef0ca2416c6dcfe976a63e1d1534 100644
 428--- a/plugins/atom/README.md
 429+++ b/plugins/atom/README.md
 430@@ -1,6 +1,8 @@
 431 ## atom
 432 
 433-Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows.
 434+This plugin makes "at" a useful function for invoking the Atom Editor.
 435+
 436+Originally by Github user [aforty](https://github.com/aforty) for OSX, modified to alias 'at' to 'atom' for Linux, since atom already works on the terminal for Linux, and calling 'at' in a non-OSX environment should still work.
 437 
 438 ### Requirements
 439 
 440@@ -10,8 +12,12 @@ Plugin for Atom, a cross platform text and code editor, available for Linux, Mac
 441 
 442  * If `at` command is called without an argument, launch Atom
 443 
 444- * If `at` is passed a directory, `cd` to it and open it in Atom
 445+ * If `at` is passed a directory, open it in Atom
 446 
 447  * If `at` is passed a file, open it in Atom
 448 
 449- * if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom
 450+### Examples
 451+
 452+ * Open the current dir in atom: `at .`
 453+ * Open another dir in atom: `at path/to/folder`
 454+ * Open a file: `at filename.extension`
 455diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh
 456index 290c75330cd87c109e91d4c663d7f624dc259e89..ec1a114edeb67221e0f203646fb0daf30fabbe07 100644
 457--- a/plugins/atom/atom.plugin.zsh
 458+++ b/plugins/atom/atom.plugin.zsh
 459@@ -1,23 +1,9 @@
 460-if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
 461-    local _atom_path > /dev/null 2>&1
 462+# Gets OS Type
 463+unamestr=$(uname -s)
 464 
 465-    _atom_path=${LOCALAPPDATA}/atom/bin/atom
 466-
 467-    if [[ -a $_atom_path ]]; then
 468-        cyg_open_atom()
 469-        {
 470-            if [[ -n $1 ]]; then
 471-                ${_atom_path} `cygpath -w $1`
 472-            else
 473-                ${_atom_path}
 474-            fi
 475-        }
 476-
 477-        alias at=cyg_open_atom
 478-    fi
 479-else
 480+# If OSX
 481+if [[ "$unamestr" == 'Darwin' ]]; then
 482     local _atom_paths > /dev/null 2>&1
 483-
 484     _atom_paths=(
 485         "$HOME/Applications/Atom.app"
 486         "/Applications/Atom.app"
 487@@ -29,6 +15,8 @@ else
 488             break
 489         fi
 490     done
 491+# If Linux
 492+elif [[ "$unamestr" == 'Linux' ]]; then
 493+    # Alerts the user if 'atom' is not a found command.
 494+    type atom >/dev/null 2>&1 && alias at="atom" || { echo >&2 "You have enabled the atom oh-my-zsh plugin on Linux, but atom is not a recognized command. Please make sure you have it installed before using this plugin."; }
 495 fi
 496-
 497-alias att='at .'
 498diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 499index 7246db9f0e10252a2c9bee1cff624e0b76ebc6c9..d31052f8300082f0d7ed5a47e59a2cf1454288d0 100644
 500--- a/plugins/aws/aws.plugin.zsh
 501+++ b/plugins/aws/aws.plugin.zsh
 502@@ -11,11 +11,16 @@ export AWS_HOME=~/.aws
 503 function agp {
 504   echo $AWS_DEFAULT_PROFILE
 505 }
 506+
 507 function asp {
 508+  local rprompt=${RPROMPT/<aws:$(agp)>/}
 509+
 510   export AWS_DEFAULT_PROFILE=$1
 511   export AWS_PROFILE=$1
 512-  export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$RPROMPT"
 513+
 514+  export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
 515 }
 516+
 517 function aws_profiles {
 518   reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
 519 }
 520diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
 521index b70b42f984540b2d58e9a6720e57234ec5ae21d6..459f5214e62c07d62d65dbd98901ea2c4dc82bcc 100755
 522--- a/plugins/bgnotify/bgnotify.plugin.zsh
 523+++ b/plugins/bgnotify/bgnotify.plugin.zsh
 524@@ -11,31 +11,38 @@ autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
 525 
 526 ## definitions ##
 527 
 528-if ! (type bgnotify_formatted | grep -q 'function'); then
 529-  function bgnotify_formatted {
 530-    ## exit_status, command, elapsed_time
 531-    [ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)"
 532-    bgnotify "$title" "$2"
 533+if ! (type bgnotify_formatted | grep -q 'function'); then ## allow custom function override
 534+  function bgnotify_formatted { ## args: (exit_status, command, elapsed_seconds)
 535+    elapsed="$(( $3 % 60 ))s"
 536+    (( $3 >= 60 )) && elapsed="$((( $3 % 3600) / 60 ))m $elapsed"
 537+    (( $3 >= 3600 )) && elapsed="$(( $3 / 3600 ))h $elapsed"
 538+    [ $1 -eq 0 ] && bgnotify "#win (took $elapsed)" "$2" || bgnotify "#fail (took $elapsed)" "$2"
 539   }
 540 fi
 541 
 542 currentWindowId () {
 543   if hash osascript 2>/dev/null; then #osx
 544     osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
 545-  elif hash notify-send 2>/dev/null; then #ubuntu!
 546-    xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
 547+  elif (hash notify-send 2>/dev/null || hash kdialog 2>/dev/null); then #ubuntu!
 548+    xprop -root 2> /dev/null | awk '/NET_ACTIVE_WINDOW/{print $5;exit} END{exit !$5}' || echo "0"
 549   else
 550     echo $EPOCHSECONDS #fallback for windows
 551   fi
 552 }
 553 
 554-bgnotify () {
 555+bgnotify () { ## args: (title, subtitle)
 556   if hash terminal-notifier 2>/dev/null; then #osx
 557-    terminal-notifier -message "$2" -title "$1"
 558+    [[ "$TERM_PROGRAM" == 'iTerm.app' ]] && term_id='com.googlecode.iterm2';
 559+    [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] && term_id='com.apple.terminal';
 560+    ## now call terminal-notifier, (hopefully with $term_id!)
 561+    [ -z "$term_id" ] && terminal-notifier -message "$2" -title "$1" >/dev/null ||
 562+    terminal-notifier -message "$2" -title "$1" -activate "$term_id" -sender "$term_id" >/dev/null
 563   elif hash growlnotify 2>/dev/null; then #osx growl
 564     growlnotify -m "$1" "$2"
 565-  elif hash notify-send 2>/dev/null; then #ubuntu!
 566+  elif hash notify-send 2>/dev/null; then #ubuntu gnome!
 567     notify-send "$1" "$2"
 568+  elif hash kdialog 2>/dev/null; then #ubuntu kde!
 569+    kdialog  -title "$1" --passivepopup  "$2" 5
 570   elif hash notifu 2>/dev/null; then #cygwyn support!
 571     notifu /m "$2" /p "$1"
 572   fi
 573@@ -46,7 +53,7 @@ bgnotify () {
 574 
 575 bgnotify_begin() {
 576   bgnotify_timestamp=$EPOCHSECONDS
 577-  bgnotify_lastcmd=$1
 578+  bgnotify_lastcmd="$1"
 579   bgnotify_windowid=$(currentWindowId)
 580 }
 581 
 582@@ -63,5 +70,8 @@ bgnotify_end() {
 583   bgnotify_timestamp=0 #reset it to 0!
 584 }
 585 
 586-add-zsh-hook preexec bgnotify_begin
 587-add-zsh-hook precmd bgnotify_end
 588+## only enable if a local (non-ssh) connection
 589+if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
 590+  add-zsh-hook preexec bgnotify_begin
 591+  add-zsh-hook precmd bgnotify_end
 592+fi
 593diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano
 594index 3cadf3d54be8aabaacaf509d5ca75ab14eb97910..e6e71ffcc80d121d3adba7bde7f461bafcaa26b3 100644
 595--- a/plugins/capistrano/_capistrano
 596+++ b/plugins/capistrano/_capistrano
 597@@ -1,10 +1,49 @@
 598-#compdef cap
 599+#compdef shipit
 600 #autoload
 601 
 602-if [[ -f config/deploy.rb || -f Capfile ]]; then
 603-  if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
 604-    echo "\nGenerating .cap_tasks~..." > /dev/stderr
 605-    cap -v --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
 606+# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
 607+# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
 608+
 609+local curcontext="$curcontext" state line ret=1
 610+local -a _configs
 611+
 612+_arguments -C \
 613+  '1: :->cmds' \
 614+  '2:: :->args' && ret=0
 615+
 616+_cap_tasks() {
 617+  if [[ -f config/deploy.rb || -f Capfile ]]; then
 618+    if [[ ! -f .cap_tasks~ ]]; then
 619+      shipit -v --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~
 620+    fi
 621+
 622+    OLD_IFS=$IFS
 623+    IFS=$'\n'
 624+    _values 'cap commands' $(< .cap_tasks~)
 625+    IFS=$OLD_IFS
 626+    # zmodload zsh/mapfile
 627+    # _values ${(f)mapfile[.cap_tasks~]}
 628   fi
 629-  compadd `cat .cap_tasks~`
 630-fi
 631+}
 632+
 633+_cap_stages() {
 634+  compadd $(find config/deploy -name \*.rb | cut -d/ -f3 | sed s:.rb::g)
 635+}
 636+
 637+case $state in
 638+  cmds)
 639+    # check if it uses multistage
 640+    if [[ -d config/deploy ]]; then
 641+      _cap_stages
 642+    else
 643+      _cap_tasks
 644+    fi
 645+    ret=0
 646+    ;;
 647+  args)
 648+    _cap_tasks
 649+    ret=0
 650+    ;;
 651+esac
 652+
 653+return ret
 654diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh
 655new file mode 100644
 656index 0000000000000000000000000000000000000000..c85eb474ca8a9cd85f8f3cc4446e54ce5a5a0c85
 657--- /dev/null
 658+++ b/plugins/capistrano/capistrano.plugin.zsh
 659@@ -0,0 +1,11 @@
 660+# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
 661+# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
 662+
 663+func shipit() {
 664+  if [ -f Gemfile ]
 665+  then
 666+    bundle exec cap $*
 667+  else
 668+    cap $*
 669+  fi
 670+}
 671diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
 672index b461b0c9be7d5b39a27ebc7d646e93434e57e15a..5be6528b0edbcf818ca8ccd52d6cc7a619de7079 100644
 673--- a/plugins/chruby/chruby.plugin.zsh
 674+++ b/plugins/chruby/chruby.plugin.zsh
 675@@ -45,11 +45,11 @@ _source_from_omz_settings() {
 676     zstyle -s :omz:plugins:chruby path _chruby_path
 677     zstyle -s :omz:plugins:chruby auto _chruby_auto
 678 
 679-    if ${_chruby_path} && [[ -r ${_chruby_path} ]]; then
 680+    if [[ -r ${_chruby_path} ]]; then
 681         source ${_chruby_path}
 682     fi
 683 
 684-    if ${_chruby_auto} && [[ -r ${_chruby_auto} ]]; then
 685+    if [[ -r ${_chruby_auto} ]]; then
 686         source ${_chruby_auto}
 687     fi
 688 }
 689diff --git a/plugins/codeclimate/_codeclimate b/plugins/codeclimate/_codeclimate
 690new file mode 100644
 691index 0000000000000000000000000000000000000000..fd2536a340d632108c3f04bdd130052445c8d02d
 692--- /dev/null
 693+++ b/plugins/codeclimate/_codeclimate
 694@@ -0,0 +1,82 @@
 695+#compdef codeclimate
 696+
 697+_codeclimate_all_engines() {
 698+  engines_all=(`codeclimate engines:list | tail -n +2 | gawk '{ print $2 }' | gawk -F: '{ print $1 }'`)
 699+}
 700+
 701+_codeclimate_installed_engines() {
 702+  _codeclimate_all_engines
 703+
 704+  engines_installed=()
 705+
 706+  if [ -e .codeclimate.yml ]
 707+  then
 708+    for engine in $engines_all
 709+    do
 710+      if grep -q $engine ".codeclimate.yml"
 711+      then
 712+        engines_installed+=$engine
 713+      fi
 714+    done
 715+  fi
 716+}
 717+
 718+_codeclimate_not_installed_engines() {
 719+  _codeclimate_all_engines
 720+
 721+  engines_not_installed=()
 722+
 723+  if [ -e .codeclimate.yml ]
 724+  then
 725+    for engine in $engines_all
 726+    do
 727+      if ! grep -q $engine ".codeclimate.yml"
 728+      then
 729+        engines_not_installed+=$engine
 730+      fi
 731+    done
 732+  fi
 733+}
 734+
 735+local curcontext="$curcontext" state line ret=1
 736+local expl
 737+local -a engines_all engines_installed engines_not_installed
 738+
 739+_arguments \
 740+  '1: :->cmds' \
 741+  '*:: :->args' && ret=0
 742+
 743+case $state in
 744+  cmds)
 745+    _values "bundle command" \
 746+      "analyze[Analyze all relevant files in the current working directory]" \
 747+      "console[Start an interactive session providing access to the classes within the CLI]" \
 748+      "engines\:disable[Prevents the engine from being used in this project]" \
 749+      "engines\:enable[This engine will be run the next time your project is analyzed]" \
 750+      "engines\:install[Compares the list of engines in your .codeclimate.yml file to those that are currently installed, then installs any missing engines]" \
 751+      "engines\:list[Lists all available engines in the Code Climate Docker Hub]" \
 752+      "engines\:remove[Removes an engine from your .codeclimate.yml file]" \
 753+      "help[Displays a list of commands that can be passed to the Code Climate CLI]" \
 754+      "init[Generates a new .codeclimate.yml file in the current working directory]" \
 755+      "validate-config[Validates the .codeclimate.yml file in the current working directory]" \
 756+      "version[Displays the current version of the Code Climate CLI]"
 757+    ret=0
 758+    ;;
 759+  args)
 760+    case $line[1] in
 761+      engines:enable)
 762+        _codeclimate_not_installed_engines
 763+        _wanted engines_not_installed expl 'not installed engines' compadd -a engines_not_installed ;;
 764+      engines:disable|engines:remove)
 765+        _codeclimate_installed_engines
 766+        _wanted engines_installed expl 'installed engines' compadd -a engines_installed ;;
 767+      analyze)
 768+        _arguments \
 769+          '-f:Output Format:(text json)'
 770+        ret=0
 771+        ;;
 772+    esac
 773+    ;;
 774+esac
 775+
 776+return ret
 777diff --git a/plugins/coffee/coffee.plugin.zsh b/plugins/coffee/coffee.plugin.zsh
 778index 1a7bedd87fe9426f18c00e9f99bbc269a194406d..4e98e022869ea8b968ab4f3598f904bb51ff27d8 100644
 779--- a/plugins/coffee/coffee.plugin.zsh
 780+++ b/plugins/coffee/coffee.plugin.zsh
 781@@ -2,11 +2,11 @@
 782 
 783 # compile a string of coffeescript and print to output
 784 cf () {
 785-  coffee -peb $1
 786+  coffee -peb "$1"
 787 }
 788 # compile & copy to clipboard
 789 cfc () {
 790-  cf $1 | pbcopy
 791+  cf "$1" | pbcopy
 792 }
 793 
 794 # compile from pasteboard & print
 795diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh
 796new file mode 100644
 797index 0000000000000000000000000000000000000000..b32dd1a4c52b0a76ec21b6b7a5485db6f6a5af5a
 798--- /dev/null
 799+++ b/plugins/emotty/emotty.plugin.zsh
 800@@ -0,0 +1,43 @@
 801+# ------------------------------------------------------------------------------
 802+#          FILE: emotty.plugin.zsh
 803+#   DESCRIPTION: Return an emoji for the current $TTY number.
 804+#        AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
 805+#       VERSION: 1.0.0
 806+#       DEPENDS: emoji plugin
 807+#       
 808+# There are different sets of emoji characters available, to choose a different
 809+# set export emotty_set to the name of the set you would like to use, e.g.:
 810+# % export emotty_set=nature
 811+# ------------------------------------------------------------------------------
 812+
 813+typeset -gAH _emotty_sets
 814+local _emotty_plugin_dir="${0:h}"
 815+source "$_emotty_plugin_dir/emotty_stellar_set.zsh"
 816+source "$_emotty_plugin_dir/emotty_floral_set.zsh"
 817+source "$_emotty_plugin_dir/emotty_zodiac_set.zsh"
 818+source "$_emotty_plugin_dir/emotty_nature_set.zsh"
 819+source "$_emotty_plugin_dir/emotty_emoji_set.zsh"
 820+source "$_emotty_plugin_dir/emotty_love_set.zsh"
 821+unset _emotty_plugin_dir
 822+
 823+emotty_default_set=emoji
 824+
 825+function emotty() {
 826+  # Use emotty set defined by user, fallback to default
 827+  local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]}
 828+  # Parse $TTY number, normalizing it to an emotty set index
 829+  (( tty = (${TTY##/dev/ttys} % ${#${=emotty}}) + 1 ))
 830+  local character_name=${${=emotty}[tty]}
 831+  echo "${emoji[${character_name}]}${emoji2[emoji_style]}"
 832+}
 833+
 834+function display_emotty() {
 835+  local name=$1
 836+  for i in ${=_emotty_sets[$name]}; do
 837+    printf "${emoji[$i]}${emoji2[emoji_style]}  "
 838+  done
 839+  print
 840+  for i in ${=_emotty_sets[$name]}; do
 841+    print "${emoji[$i]}${emoji2[emoji_style]}  = $i"
 842+  done
 843+}
 844diff --git a/plugins/emotty/emotty_emoji_set.zsh b/plugins/emotty/emotty_emoji_set.zsh
 845new file mode 100644
 846index 0000000000000000000000000000000000000000..00e3171312aa7da12ba138f19904d2184e58b0e7
 847--- /dev/null
 848+++ b/plugins/emotty/emotty_emoji_set.zsh
 849@@ -0,0 +1,24 @@
 850+#!/usr/bin/env zsh
 851+# vim:ft=zsh ts=2 sw=2 sts=2
 852+
 853+_emotty_sets[emoji]="
 854+  crystal_ball
 855+  ghost
 856+  jack_o_lantern
 857+  see_no_evil_monkey
 858+  hear_no_evil_monkey
 859+  speak_no_evil_monkey
 860+  smiling_cat_face_with_open_mouth
 861+  extraterrestrial_alien
 862+  rocket
 863+  billiards
 864+  bomb
 865+  pill
 866+  japanese_symbol_for_beginner
 867+  direct_hit
 868+  cyclone
 869+  diamond_shape_with_a_dot_inside
 870+  sparkle
 871+  eight_spoked_asterisk
 872+  eight_pointed_black_star
 873+  "
 874diff --git a/plugins/emotty/emotty_floral_set.zsh b/plugins/emotty/emotty_floral_set.zsh
 875new file mode 100644
 876index 0000000000000000000000000000000000000000..f761feae6de186cf83e68f8398d535472dc1fd82
 877--- /dev/null
 878+++ b/plugins/emotty/emotty_floral_set.zsh
 879@@ -0,0 +1,18 @@
 880+#!/usr/bin/env zsh
 881+# vim:ft=zsh ts=2 sw=2 sts=2
 882+
 883+_emotty_sets[floral]="
 884+  hibiscus
 885+  cherry_blossom
 886+  blossom
 887+  sunflower
 888+  bouquet
 889+  tulip
 890+  rose
 891+  four_leaf_clover
 892+  seedling
 893+  herb
 894+  palm_tree
 895+  evergreen_tree
 896+  deciduous_tree
 897+  "
 898diff --git a/plugins/emotty/emotty_love_set.zsh b/plugins/emotty/emotty_love_set.zsh
 899new file mode 100644
 900index 0000000000000000000000000000000000000000..8f19e6902e2e5842eba4ed2dfb53e36ef619b391
 901--- /dev/null
 902+++ b/plugins/emotty/emotty_love_set.zsh
 903@@ -0,0 +1,34 @@
 904+#!/usr/bin/env zsh
 905+# vim:ft=zsh ts=2 sw=2 sts=2
 906+
 907+# Note: The heavy_black_heart emoji requires $emoji2[emoji_style]
 908+# to be rendered as the emoji red heart.
 909+_emotty_sets[love]="
 910+  green_heart
 911+  blue_heart
 912+  purple_heart
 913+  yellow_heart
 914+  heavy_black_heart
 915+  broken_heart
 916+  heart_with_arrow
 917+  heart_with_ribbon
 918+  sparkling_heart
 919+  two_hearts
 920+  revolving_hearts
 921+  growing_heart
 922+  beating_heart
 923+  heart_decoration
 924+  couple_with_heart
 925+  kiss
 926+  man_and_woman_holding_hands
 927+  two_women_holding_hands
 928+  two_men_holding_hands
 929+  kiss_mark
 930+  smiling_face_with_heart_shaped_eyes
 931+  kissing_face
 932+  face_throwing_a_kiss
 933+  kissing_face_with_smiling_eyes
 934+  kissing_face_with_closed_eyes
 935+  smiling_cat_face_with_heart_shaped_eyes
 936+  kissing_cat_face_with_closed_eyes
 937+  "
 938diff --git a/plugins/emotty/emotty_nature_set.zsh b/plugins/emotty/emotty_nature_set.zsh
 939new file mode 100644
 940index 0000000000000000000000000000000000000000..8dab4c1ba2eee2ad59bb8335dea79aabb007dadd
 941--- /dev/null
 942+++ b/plugins/emotty/emotty_nature_set.zsh
 943@@ -0,0 +1,58 @@
 944+#!/usr/bin/env zsh
 945+# vim:ft=zsh ts=2 sw=2 sts=2
 946+
 947+_emotty_sets[nature]="
 948+  mouse_face
 949+  hamster_face
 950+  rabbit_face
 951+  dog_face
 952+  cat_face
 953+  tiger_face
 954+  bear_face
 955+  monkey_face
 956+  koala
 957+  panda_face
 958+  chicken
 959+  baby_chick
 960+  bird
 961+  penguin
 962+  cow_face
 963+  pig_face
 964+  frog_face
 965+  boar
 966+  wolf_face
 967+  horse_face
 968+  snail
 969+  bug
 970+  ant
 971+  honeybee
 972+  lady_beetle
 973+  spouting_whale
 974+  dolphin
 975+  octopus
 976+  fish
 977+  tropical_fish
 978+  snake
 979+  turtle
 980+  lemon
 981+  tangerine
 982+  peach
 983+  mushroom
 984+  tomato
 985+  strawberry
 986+  red_apple
 987+  cherries
 988+  grapes
 989+  aubergine
 990+  watermelon
 991+  banana
 992+  pineapple
 993+  melon
 994+  pear
 995+  green_apple
 996+  ear_of_maize
 997+  sunflower
 998+  seedling
 999+  herb
1000+  four_leaf_clover
1001+  "
1002diff --git a/plugins/emotty/emotty_stellar_set.zsh b/plugins/emotty/emotty_stellar_set.zsh
1003new file mode 100644
1004index 0000000000000000000000000000000000000000..8e7e61068a523461cd1dbd4b5d0e8e023a35ce6c
1005--- /dev/null
1006+++ b/plugins/emotty/emotty_stellar_set.zsh
1007@@ -0,0 +1,25 @@
1008+#!/usr/bin/env zsh
1009+# vim:ft=zsh ts=2 sw=2 sts=2
1010+
1011+# NOTE: The following emoji show as $'character' in the title
1012+#  white_medium_star
1013+#  sparkles
1014+#  dizzy_symbol
1015+
1016+_emotty_sets[stellar]="
1017+  full_moon_symbol
1018+  waning_gibbous_moon_symbol
1019+  waning_crescent_moon_symbol
1020+  last_quarter_moon_symbol
1021+  new_moon_symbol
1022+  new_moon_with_face
1023+  waxing_crescent_moon_symbol
1024+  first_quarter_moon_symbol
1025+  waxing_gibbous_moon_symbol
1026+  full_moon_with_face
1027+  sun_with_face
1028+  glowing_star
1029+  crescent_moon
1030+  first_quarter_moon_with_face
1031+  last_quarter_moon_with_face
1032+  "
1033diff --git a/plugins/emotty/emotty_zodiac_set.zsh b/plugins/emotty/emotty_zodiac_set.zsh
1034new file mode 100644
1035index 0000000000000000000000000000000000000000..bde6e3d2e764477ce3ed0e3a0186d02a09ed6bff
1036--- /dev/null
1037+++ b/plugins/emotty/emotty_zodiac_set.zsh
1038@@ -0,0 +1,29 @@
1039+#!/usr/bin/env zsh
1040+# vim:ft=zsh ts=2 sw=2 sts=2
1041+
1042+_emotty_sets[zodiac]="
1043+  aries
1044+  taurus
1045+  gemini
1046+  cancer
1047+  leo
1048+  virgo
1049+  libra
1050+  scorpius
1051+  sagittarius
1052+  capricorn
1053+  aquarius
1054+  pisces
1055+  rat
1056+  ox
1057+  tiger
1058+  rabbit
1059+  dragon
1060+  snake
1061+  horse
1062+  goat
1063+  monkey
1064+  rooster
1065+  dog
1066+  pig
1067+  "
1068diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md
1069new file mode 100644
1070index 0000000000000000000000000000000000000000..a7670fa2c2d9a21ea1c5aeeeb06ed07c6ece2988
1071--- /dev/null
1072+++ b/plugins/fancy-ctrl-z/README.md
1073@@ -0,0 +1,14 @@
1074+# Use Ctrl-Z to switch back to Vim
1075+
1076+I frequently need to execute random command in my shell. To achieve it I pause 
1077+Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
1078+The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back 
1079+to Vim. I could not find a solution, so I developed one on my own that 
1080+works wonderfully with ZSH
1081+
1082+Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
1083+
1084+Credits: 
1085+- original idea by @sheerun
1086+- added to OMZ by @mbologna
1087+
1088diff --git a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
1089new file mode 100644
1090index 0000000000000000000000000000000000000000..8ab2979133efda46a4ce1990f4d159da69d603e6
1091--- /dev/null
1092+++ b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
1093@@ -0,0 +1,12 @@
1094+fancy-ctrl-z () {
1095+  if [[ $#BUFFER -eq 0 ]]; then
1096+    BUFFER="fg"
1097+    zle accept-line
1098+  else
1099+    zle push-input
1100+    zle clear-screen
1101+  fi
1102+}
1103+zle -N fancy-ctrl-z
1104+bindkey '^Z' fancy-ctrl-z
1105+
1106diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
1107index 8419166abc10b7f05a30fe02d39aa34d3c33cddb..d91c1af81c6391c17249449e8cd5bc554201a73a 100644
1108--- a/plugins/git-extras/git-extras.plugin.zsh
1109+++ b/plugins/git-extras/git-extras.plugin.zsh
1110@@ -3,19 +3,20 @@
1111 # Description
1112 # -----------
1113 #
1114-#  Completion script for git-extras (http://github.com/visionmedia/git-extras).
1115+#  Completion script for git-extras (http://github.com/tj/git-extras).
1116 #
1117 # ------------------------------------------------------------------------------
1118 # Authors
1119 # -------
1120 #
1121 #  * Alexis GRIMALDI (https://github.com/agrimaldi)
1122+#  * spacewander (https://github.com/spacewander)
1123 #
1124 # ------------------------------------------------------------------------------
1125 # Inspirations
1126 # -----------
1127 #
1128-#  * git-extras (http://github.com/visionmedia/git-extras)
1129+#  * git-extras (http://github.com/tj/git-extras)
1130 #  * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
1131 #
1132 # ------------------------------------------------------------------------------
1133@@ -30,10 +31,21 @@ __git_command_successful () {
1134 }
1135 
1136 
1137+__git_commits() {
1138+    declare -A commits
1139+    git log --oneline -15 | sed 's/\([[:alnum:]]\{7\}\) /\1:/' | while read commit
1140+    do
1141+        hash=$(echo $commit | cut -d':' -f1)
1142+        commits[$hash]="$commit"
1143+    done
1144+    local ret=1
1145+    _describe -t commits commit commits && ret=0
1146+}
1147+
1148 __git_tag_names() {
1149     local expl
1150     declare -a tag_names
1151-    tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
1152+    tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
1153     __git_command_successful || return
1154     _wanted tag-names expl tag-name compadd $* - $tag_names
1155 }
1156@@ -47,31 +59,27 @@ __git_branch_names() {
1157     _wanted branch-names expl branch-name compadd $* - $branch_names
1158 }
1159 
1160-
1161-__git_feature_branch_names() {
1162+__git_specific_branch_names() {
1163     local expl
1164     declare -a branch_names
1165-    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
1166+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
1167     __git_command_successful || return
1168     _wanted branch-names expl branch-name compadd $* - $branch_names
1169 }
1170 
1171 
1172+__git_feature_branch_names() {
1173+    __git_specific_branch_names 'feature'
1174+}
1175+
1176+
1177 __git_refactor_branch_names() {
1178-    local expl
1179-    declare -a branch_names
1180-    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
1181-    __git_command_successful || return
1182-    _wanted branch-names expl branch-name compadd $* - $branch_names
1183+    __git_specific_branch_names 'refactor'
1184 }
1185 
1186 
1187 __git_bug_branch_names() {
1188-    local expl
1189-    declare -a branch_names
1190-    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
1191-    __git_command_successful || return
1192-    _wanted branch-names expl branch-name compadd $* - $branch_names
1193+    __git_specific_branch_names 'bug'
1194 }
1195 
1196 
1197@@ -92,19 +100,43 @@ __git_author_names() {
1198     _wanted author-names expl author-name compadd $* - $author_names
1199 }
1200 
1201+# subcommands
1202 
1203-_git-changelog() {
1204-    _arguments \
1205-        '(-l --list)'{-l,--list}'[list commits]' \
1206+_git-bug() {
1207+    local curcontext=$curcontext state line ret=1
1208+    declare -A opt_args
1209+
1210diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
1211index e59265d664fa6f0022c52d2791bcf78a84d2b793..de95f7e6c0824a736fccdcb8fa4f23a576db6823 100644
1212--- a/plugins/gnu-utils/gnu-utils.plugin.zsh
1213+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
1214@@ -29,7 +29,10 @@ if [[ -x "${commands[gwhoami]}" ]]; then
1215     'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
1216     'gwhoami' 'gyes')
1217 
1218-    # Not part of coreutils, installed separately.
1219+    # findutils
1220+    gcmds+=('gfind' 'gxargs' 'glocate')
1221+
1222+    # Not part of either coreutils or findutils, installed separately.
1223     gcmds+=('gsed' 'gtar' 'gtime')
1224 
1225     for gcmd in "${gcmds[@]}"; do
1226diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
1227index 900fc630dbe3c346ea014588ad854d3f97c80864..1ce3cea58e861e6540509143d1e3f1913056177e 100644
1228--- a/plugins/golang/golang.plugin.zsh
1229+++ b/plugins/golang/golang.plugin.zsh
1230@@ -54,23 +54,42 @@ __go_tool_complete() {
1231     '-installsuffix[suffix to add to package directory]:suffix'
1232     '-tags[list of build tags to consider satisfied]:tags'
1233   )
1234-  __go_list() {
1235-      local expl importpaths
1236-      declare -a importpaths
1237-      importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
1238-      _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
1239+  __go_packages() {
1240+      local gopaths
1241+      declare -a gopaths
1242+      gopaths=("${(s/:/)$(go env GOPATH)}")
1243+      gopaths+=("$(go env GOROOT)")
1244+      for p in $gopaths; do
1245+        _path_files -W "$p/src" -/
1246+      done
1247+  }
1248+  __go_identifiers() {
1249+      compadd $(godoc -templates $ZSH/plugins/golang/templates ${words[-2]} 2> /dev/null)
1250   }
1251   case ${words[2]} in
1252-  clean|doc)
1253-      _arguments -s -w : '*:importpaths:__go_list'
1254+  doc)
1255+    _arguments -s -w \
1256+      "-c[symbol matching honors case (paths not affected)]" \
1257+      "-cmd[show symbols with package docs even if package is a command]" \
1258+      "-u[show unexported symbols as well as exported]" \
1259+      "2:importpaths:__go_packages" \
1260+      ":next identifiers:__go_identifiers"
1261+      ;;
1262+  clean)
1263+    _arguments -s -w \
1264+      "-i[remove the corresponding installed archive or binary (what 'go install' would create)]" \
1265+      "-n[print the remove commands it would execute, but not run them]" \
1266+      "-r[apply recursively to all the dependencies of the packages named by the import paths]" \
1267+      "-x[print remove commands as it executes them]" \
1268+      "*:importpaths:__go_packages"
1269       ;;
1270   fix|fmt|list|vet)
1271-      _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
1272+      _alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"'
1273       ;;
1274   install)
1275       _arguments -s -w : ${build_flags[@]} \
1276         "-v[show package names]" \
1277-        '*:importpaths:__go_list'
1278+        '*:importpaths:__go_packages'
1279       ;;
1280   get)
1281       _arguments -s -w : \
1282@@ -81,7 +100,7 @@ __go_tool_complete() {
1283         ${build_flags[@]} \
1284         "-v[show package names]" \
1285         "-o[output file]:file:_files" \
1286-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1287+        "*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
1288       ;;
1289   test)
1290       _arguments -s -w : \
1291@@ -103,7 +122,7 @@ __go_tool_complete() {
1292         "-cpuprofile[write CPU profile to file]:file:_files" \
1293         "-memprofile[write heap profile to file]:file:_files" \
1294         "-memprofilerate[set heap profiling rate]:number" \
1295-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1296+        "*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
1297       ;;
1298   help)
1299       _values "${commands[@]}" \
1300diff --git a/plugins/golang/templates/package.txt b/plugins/golang/templates/package.txt
1301new file mode 100644
1302index 0000000000000000000000000000000000000000..2b75cce35d43b2cf93883d9c278a104b1bde71b0
1303--- /dev/null
1304+++ b/plugins/golang/templates/package.txt
1305@@ -0,0 +1,29 @@
1306+{{with .PDoc}}{{/*
1307+
1308+Constants 
1309+---------------------------------------
1310+
1311+*/}}{{with .Consts}}{{range .}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{/*
1312+
1313+Variables
1314+---------------------------------------
1315+
1316+*/}}{{with .Vars}}{{range .}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{/*
1317+
1318+Functions
1319+---------------------------------------
1320+
1321+*/}}{{with .Funcs}}{{range .}}{{ .Name }} {{end}}{{end}}{{/*
1322+
1323+Types
1324+---------------------------------------
1325+
1326+*/}}{{with .Types}}{{range .}}{{ $TypeName := .Name }}{{ $TypeName }} {{/*
1327+
1328+*/}}{{range .Methods}}{{ $TypeName }}.{{.Name}} {{end}}{{/*
1329+
1330+*/}}{{range .Funcs}}{{.Name}} {{end}}{{/*
1331+
1332+*/}}{{range .Consts}}{{range .Names}}{{.}} {{end}}{{end}}{{/*
1333+
1334+*/}}{{range .Vars}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{end}}{{end}}
1335diff --git a/plugins/golang/templates/search.txt b/plugins/golang/templates/search.txt
1336new file mode 100644
1337index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
1338--- /dev/null
1339+++ b/plugins/golang/templates/search.txt
1340diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
1341index 6f634d1baa4320bfbd08a70443d04a1a65cdda18..97941756d653d860d9506b4981bd81009e64295c 100644
1342--- a/plugins/gradle/gradle.plugin.zsh
1343+++ b/plugins/gradle/gradle.plugin.zsh
1344@@ -82,7 +82,7 @@ _gradlew_tasks () {
1345   if [ in_gradle ]; then
1346     _gradle_arguments
1347     if _gradle_does_task_list_need_generating; then
1348-     gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1349+     ./gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1350     fi
1351     compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache`
1352   fi
1353diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh
1354new file mode 100644
1355index 0000000000000000000000000000000000000000..6017c7b6023a5e5e9987e54af0d1c3fc278725b2
1356--- /dev/null
1357+++ b/plugins/gulp/gulp.plugin.zsh
1358@@ -0,0 +1,29 @@
1359+#!/usr/bin/env zsh
1360+
1361+#
1362+# gulp-autocompletion-zsh
1363+# 
1364+# Autocompletion for your gulp.js tasks
1365+#
1366+# Copyright(c) 2014 André König <andre.koenig@posteo.de>
1367+# MIT Licensed
1368+# 
1369+
1370+#
1371+# André König
1372+# Github: https://github.com/akoenig
1373+# Twitter: https://twitter.com/caiifr
1374+#
1375+
1376+#
1377+# Grabs all available tasks from the `gulpfile.js`
1378+# in the current directory.
1379+#
1380+function $$gulp_completion() {
1381+    compls=$(grep -Eo "gulp.task\(('(([a-zA-Z0-9]|-)*)',)" gulpfile.js 2>/dev/null | grep -Eo "'(([a-zA-Z0-9]|-)*)'" | sed s/"'"//g | sort)
1382+
1383+    completions=(${=compls})
1384+    compadd -- $completions
1385+}
1386+
1387+compdef $$gulp_completion gulp
1388diff --git a/plugins/jira/README.md b/plugins/jira/README.md
1389new file mode 100644
1390index 0000000000000000000000000000000000000000..efb8a743a6e6c4d07c01f9ab79075c89d7de5a17
1391--- /dev/null
1392+++ b/plugins/jira/README.md
1393@@ -0,0 +1,64 @@
1394+#  Jira plugin  #
1395+
1396+CLI support for JIRA interaction
1397+
1398+##  Description  ##
1399+
1400+This plugin provides command line tools for interacting with Atlassian's [JIRA](https://www.atlassian.com/software/jira) bug tracking software.
1401+
1402+The interaction is all done through the web. No local installation of JIRA is necessary.
1403+
1404+In this document, "JIRA" refers to the JIRA issue tracking server, and `jira` refers to the command this plugin supplies.
1405+
1406+##  Usage  ##
1407+
1408+This plugin supplies one command, `jira`, through which all its features are exposed. Most forms of this command open a JIRA page in your web browser.
1409+
1410+```
1411+jira            # performs the default action
1412+
1413+jira new        # opens a new issue
1414+jira dashboard  # opens your JIRA dashboard
1415+jira reported [username]  # queries for issues reported by a user
1416+jira assigned [username]  # queries for issues assigned to a user
1417+jira ABC-123    # opens an existing issue
1418+jira ABC-123 m  # opens an existing issue for adding a comment
1419+```
1420+
1421+#### Debugging usage  ####
1422+
1423+These calling forms are for developers' use, and may change at any time.
1424+
1425+```
1426+jira dumpconfig   # displays the effective configuration
1427+```
1428+
1429+##  Setup  ##
1430+
1431+The URL for your JIRA instance is set by `$JIRA_URL` or a `.jira_url` file.
1432+
1433+Add a `.jira-url` file in the base of your project. You can also set `$JIRA_URL` in your `~/.zshrc` or put a `.jira-url` in your home directory. A `.jira-url` in the current directory takes precedence, so you can make per-project customizations.
1434+
1435+The same goes with `.jira-prefix` and `$JIRA_PREFIX`. These control the prefix added to all issue IDs, which differentiates projects within a JIRA instance.
1436+
1437+For example:
1438+
1439+```
1440+cd to/my/project
1441+echo "https://jira.atlassian.com" >> .jira-url
1442+```
1443+
1444diff --git a/plugins/jira/_jira b/plugins/jira/_jira
1445index b0ea658e2f3ac23079fb19166509667407741ae2..03fe6a4993fb1a92a2fb0fad73c56f03d3453cc7 100644
1446--- a/plugins/jira/_jira
1447+++ b/plugins/jira/_jira
1448@@ -7,6 +7,7 @@ _1st_arguments=(
1449   'dashboard:open the dashboard'
1450   'reported:search for issues reported by a user'
1451   'assigned:search for issues assigned to a user'
1452+  'dumpconfig:display effective jira configuration'
1453 )
1454 
1455 _arguments -C \
1456diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
1457index 89559767f86b684ea0e47a69ea363e94acf11d12..341e23ec0e5cc42ea7d0bf28ef0abc05425998d5 100644
1458--- a/plugins/jira/jira.plugin.zsh
1459+++ b/plugins/jira/jira.plugin.zsh
1460@@ -1,35 +1,11 @@
1461 # CLI support for JIRA interaction
1462 #
1463-# Setup: 
1464-#   Add a .jira-url file in the base of your project
1465-#   You can also set $JIRA_URL in your .zshrc or put .jira-url in your home directory
1466-#   A .jira-url in the current directory takes precedence. 
1467-#   The same goes with .jira-prefix and $JIRA_PREFIX.
1468-#
1469-#   For example:
1470-#     cd to/my/project
1471-#     echo "https://name.jira.com" >> .jira-url
1472-#
1473-# Variables:
1474-#  $JIRA_RAPID_BOARD     - set to "true" if you use Rapid Board
1475-#  $JIRA_DEFAULT_ACTION  - action to do when `jira` is called witn no args
1476-#                          defaults to "new"
1477-#  $JIRA_NAME            - Your JIRA username. Used as default for assigned/reported
1478-#  $JIRA_PREFIX          - Prefix added to issue ID arguments
1479-#
1480-#
1481-# Usage: 
1482-#   jira            # Performs the default action
1483-#   jira new        # opens a new issue
1484-#   jira reported [username]
1485-#   jira assigned [username]
1486-#   jira dashboard
1487-#   jira ABC-123    # Opens an existing issue
1488-#   jira ABC-123 m  # Opens an existing issue for adding a comment
1489+# See README.md for details
1490 
1491 : ${JIRA_DEFAULT_ACTION:=new}
1492 
1493 function jira() {
1494+  emulate -L zsh
1495   local action=${1:=$JIRA_DEFAULT_ACTION}
1496 
1497   local jira_url jira_prefix
1498@@ -63,6 +39,12 @@ function jira() {
1499   elif [[ "$action" == "dashboard" ]]; then
1500     echo "Opening dashboard"
1501     open_command "${jira_url}/secure/Dashboard.jspa"
1502+  elif [[ "$action" == "dumpconfig" ]]; then
1503+    echo "JIRA_URL=$jira_url"
1504+    echo "JIRA_PREFIX=$jira_prefix"
1505+    echo "JIRA_NAME=$JIRA_NAME"
1506+    echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD"
1507+    echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
1508   else
1509     # Anything that doesn't match a special action is considered an issue name
1510     local issue_arg=$action
1511@@ -84,15 +66,17 @@ function jira() {
1512 
1513 function _jira_url_help() {
1514   cat << EOF
1515-JIRA url is not specified anywhere.
1516+error: JIRA URL is not specified anywhere.
1517+
1518 Valid options, in order of precedence:
1519   .jira-url file
1520   \$HOME/.jira-url file
1521-  JIRA_URL environment variable
1522+  \$JIRA_URL environment variable
1523 EOF
1524 }
1525 
1526 function _jira_query() {
1527+  emulate -L zsh
1528   local verb="$1"
1529   local jira_name lookup preposition query
1530   if [[ "${verb}" == "reported" ]]; then
1531@@ -102,12 +86,12 @@ function _jira_query() {
1532     lookup=assignee
1533     preposition=to
1534   else
1535-    echo "not a valid lookup: $verb" >&2
1536+    echo "error: not a valid lookup: $verb" >&2
1537     return 1
1538   fi
1539   jira_name=${2:=$JIRA_NAME}
1540   if [[ -z $jira_name ]]; then
1541-    echo "JIRA_NAME not specified" >&2
1542+    echo "error: JIRA_NAME not specified" >&2
1543     return 1
1544   fi
1545 
1546diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
1547index 68ec5fabd2fd5601d1cd4e43ecd7889660002170..595105d3c1c2355a23c571f4d7ae4e4103220d9b 100644
1548--- a/plugins/npm/npm.plugin.zsh
1549+++ b/plugins/npm/npm.plugin.zsh
1550@@ -12,3 +12,6 @@ alias npmS="npm i -S "
1551 # Install and save to dev-dependencies in your package.json
1552 # npmd is used by https://github.com/dominictarr/npmd
1553 alias npmD="npm i -D "
1554+# Execute command from node_modules folder based on current directory
1555+# i.e npmE gulp
1556+alias npmE='PATH="$(npm bin)":"$PATH"'
1557diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
1558index 390960fdcc162c6701fe0c066772f32d75460bb8..2cbb95977af17c2bc88a731b8e1e711e2139c860 100644
1559--- a/plugins/osx/osx.plugin.zsh
1560+++ b/plugins/osx/osx.plugin.zsh
1561@@ -5,29 +5,35 @@
1562 #       VERSION:  1.1.0
1563 # ------------------------------------------------------------------------------
1564 
1565-function tab() {
1566-  local command="cd \\\"$PWD\\\"; clear"
1567-  (( $# > 0 )) && command="${command}; $*"
1568-
1569-  the_app=$(
1570+function _omz_osx_get_frontmost_app() {
1571+  local the_app=$(
1572     osascript 2>/dev/null <<EOF
1573       tell application "System Events"
1574         name of first item of (every process whose frontmost is true)
1575       end tell
1576 EOF
1577   )
1578+  echo "$the_app"
1579+}
1580 
1581-  [[ "$the_app" == 'Terminal' ]] && {
1582-    osascript 2>/dev/null <<EOF
1583+function tab() {
1584+  # Must not have trailing semicolon, for iTerm compatibility
1585+  local command="cd \\\"$PWD\\\"; clear"
1586+  (( $# > 0 )) && command="${command}; $*"
1587+
1588+  local the_app=$(_omz_osx_get_frontmost_app)
1589+
1590+  if [[ "$the_app" == 'Terminal' ]]; then
1591+    # Discarding stdout to quash "tab N of window id XXX" output
1592+    osascript >/dev/null <<EOF
1593       tell application "System Events"
1594         tell process "Terminal" to keystroke "t" using command down
1595-        tell application "Terminal" to do script "${command}" in front window
1596       end tell
1597+      tell application "Terminal" to do script "${command}" in front window
1598 EOF
1599-  }
1600 
1601-  [[ "$the_app" == 'iTerm' ]] && {
1602-    osascript 2>/dev/null <<EOF
1603+  elif [[ "$the_app" == 'iTerm' ]]; then
1604+    osascript <<EOF
1605       tell application "iTerm"
1606         set current_terminal to current terminal
1607         tell current_terminal
1608@@ -35,29 +41,27 @@ EOF
1609           set current_session to current session
1610           tell current_session
1611             write text "${command}"
1612-            keystroke return
1613           end tell
1614         end tell
1615       end tell
1616 EOF
1617-  }
1618+
1619+  else
1620+    echo "tab: unsupported terminal app: $the_app"
1621+    false
1622+
1623+  fi
1624 }
1625 
1626 function vsplit_tab() {
1627-  local command="cd \\\"$PWD\\\""
1628+  local command="cd \\\"$PWD\\\"; clear"
1629   (( $# > 0 )) && command="${command}; $*"
1630 
1631-  the_app=$(
1632-    osascript 2>/dev/null <<EOF
1633-      tell application "System Events"
1634-        name of first item of (every process whose frontmost is true)
1635-      end tell
1636-EOF
1637-  )
1638+  local the_app=$(_omz_osx_get_frontmost_app)
1639 
1640-  [[ "$the_app" == 'iTerm' ]] && {
1641-    osascript 2>/dev/null <<EOF
1642-      tell application "iTerm" to activate
1643+  if [[ "$the_app" == 'iTerm' ]]; then
1644+    osascript <<EOF
1645+      -- tell application "iTerm" to activate
1646 
1647       tell application "System Events"
1648         tell process "iTerm"
1649@@ -65,26 +69,24 @@ EOF
1650             click
1651           end tell
1652         end tell
1653-        keystroke "${command}; clear;"
1654-        keystroke return
1655+        keystroke "${command} \n"
1656       end tell
1657 EOF
1658-  }
1659+
1660+  else
1661diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
1662index 6824836fc6c5c6502691d2618381d0591a90b765..39e38849450aac75951e0ceaffbc685cdb9bfaba 100644
1663--- a/plugins/rails/rails.plugin.zsh
1664+++ b/plugins/rails/rails.plugin.zsh
1665@@ -54,10 +54,12 @@ alias rdrs='rake db:reset'
1666 alias rdtc='rake db:test:clone'
1667 alias rdtp='rake db:test:prepare'
1668 alias rdmtc='rake db:migrate db:test:clone'
1669-
1670 alias rlc='rake log:clear'
1671 alias rn='rake notes'
1672 alias rr='rake routes'
1673+alias rrg='rake routes | grep'
1674+alias rt='rake test'
1675+
1676 
1677 # legacy stuff
1678 alias sstat='thin --stats "/thin/stats" start'
1679diff --git a/plugins/scw/README.md b/plugins/scw/README.md
1680new file mode 100644
1681index 0000000000000000000000000000000000000000..d2312c2e5cba0ead32f1459ed5ed574b81e14bc5
1682--- /dev/null
1683+++ b/plugins/scw/README.md
1684@@ -0,0 +1,7 @@
1685+## Scaleway CLI autocomplete plugin
1686+
1687+[scw](https://github.com/scaleway/scaleway-cli): Manage Bare Metal servers from Command Line (as easily as with Docker)
1688+
1689+- Adds autocomplete options for all `scw` commands.
1690+
1691+Maintainer : Manfred Touron ([@moul](https://github.com/moul))
1692diff --git a/plugins/scw/_scw b/plugins/scw/_scw
1693new file mode 100644
1694index 0000000000000000000000000000000000000000..f9fdf916e761728b398f7ed04f0399457d419026
1695--- /dev/null
1696+++ b/plugins/scw/_scw
1697@@ -0,0 +1,333 @@
1698+#compdef scw
1699+#
1700+# zsh completion for scw (http://scaleway.com)
1701+#
1702+# Inspired by https://github.com/felixr/docker-zsh-completion
1703+
1704+__scw_get_servers() {
1705+    local expl
1706+    declare -a servers
1707+    servers=(${(f)"$(_call_program commands scw _completion servers-names)"})
1708+    _describe -t servers "servers" servers
1709+}
1710+
1711+__scw_stoppedservers() {
1712+    __scw_get_servers
1713+}
1714+
1715+__scw_runningservers() {
1716+    __scw_get_servers
1717+}
1718+
1719+__scw_servers () {
1720+    __scw_get_servers
1721+}
1722+
1723+__scw_images () {
1724+    local expl
1725+    declare -a images
1726+    images=(${(f)"$(_call_program commands scw _completion images-names)"})
1727+    _describe -t images "images" images
1728+}
1729+
1730+__scw_images_and_snapshots () {
1731+    __scw_images
1732+    __scw_snapshots
1733+}
1734+
1735+__scw_snapshots () {
1736+    local expl
1737+    declare -a snapshots
1738+    snapshots=(${(f)"$(_call_program commands scw _completion --prefix snapshots-names)"})
1739+    _describe -t snapshots "snapshots" snapshots
1740+}
1741+
1742+__scw_bootscripts () {
1743+    local expl
1744+    declare -a bootscripts
1745+    bootscripts=(${(f)"$(_call_program commands scw _completion bootscripts-names)"})
1746+    _describe -t bootscripts "bootscripts" bootscripts
1747+}
1748+
1749+__scw_tags() {
1750+    __scw_images
1751+}
1752+
1753+__scw_repositories_with_tags() {
1754+    __scw_images
1755+}
1756+
1757+__scw_search() {
1758+    # declare -a scwsearch
1759+    local cache_policy
1760+    zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
1761+    if [[ -z "$cache_policy" ]]; then
1762+        zstyle ":completion:${curcontext}:" cache-policy __scw_caching_policy
1763+    fi
1764+
1765+    local searchterm cachename
1766+    searchterm="${words[$CURRENT]%/}"
1767+    cachename=_scw-search-$searchterm
1768+
1769+    local expl
1770+    local -a result
1771+    if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \
1772+        && ! _retrieve_cache ${cachename#_}; then
1773+        _message "Searching for ${searchterm}..."
1774+        result=(${${${(f)"$(_call_program commands scw search ${searchterm})"}%% *}[2,-1]})
1775+        _store_cache ${cachename#_} result
1776+    fi
1777+    _wanted scwsearch expl 'available images' compadd -a result
1778+}
1779+
1780+__scw_caching_policy()
1781+{
1782+  oldp=( "$1"(Nmh+1) )     # 1 hour
1783+  (( $#oldp ))
1784+}
1785+
1786+
1787+__scw_repositories () {
1788+    __scw_images
1789+}
1790+
1791+__scw_commands () {
1792+    # local -a  _scw_subcommands
1793+    local cache_policy
1794+
1795+    zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
1796+    if [[ -z "$cache_policy" ]]; then
1797diff --git a/plugins/stack/stack.plugin.zsh b/plugins/stack/stack.plugin.zsh
1798new file mode 100644
1799index 0000000000000000000000000000000000000000..a149208d0ab364ded6ce46c1ed19da75597737d9
1800--- /dev/null
1801+++ b/plugins/stack/stack.plugin.zsh
1802@@ -0,0 +1,37 @@
1803+function _stack_commands() {
1804+    local ret=1 state
1805+    _arguments ':subcommand:->subcommand' && ret=0
1806+
1807+    case $state in
1808+      subcommand)
1809+        subcommands=(
1810+          "build:Build the project(s) in this directory/configuration"
1811+          "install:Build executables and install to a user path"
1812+          "test:Build and test the project(s) in this directory/configuration"
1813+          "bench:Build and benchmark the project(s) in this directory/configuration"
1814+          "haddock:Generate haddocks for the project(s) in this directory/configuration"
1815+          "new:Create a brand new project"
1816+          "init:Initialize a stack project based on one or more stack packages"
1817+          "solver:Use a dependency solver to try and determine missing extra-deps"
1818+          "setup:Get the appropriate ghc for your project"
1819+          "path:Print out handy path information"
1820+          "unpack:Unpack one or more packages locally"
1821+          "update:Update the package index"
1822+          "upgrade:Upgrade to the latest stack (experimental)"
1823+          "upload:Upload a package to Hackage"
1824+          "dot:Visualize your project's dependency graph using Graphviz dot"
1825+          "exec:Execute a command"
1826+          "ghc:Run ghc"
1827+          "ghci:Run ghci in the context of project(s)"
1828+          "ide:Run ide-backend-client with the correct arguments"
1829+          "runghc:Run runghc"
1830+          "clean:Clean the local packages"
1831+          "docker:Subcommands specific to Docker use"
1832+        )
1833+        _describe -t subcommands 'stack subcommands' subcommands && ret=0
1834+    esac
1835+
1836+    return ret
1837+}
1838+
1839+compdef _stack_commands stack
1840diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
1841index e3ba39918af9345bb04801bb2c5dc5c6704d99b0..0ba8bed5be790fb1daf2749da215d275bf71add3 100644
1842--- a/plugins/sudo/sudo.plugin.zsh
1843+++ b/plugins/sudo/sudo.plugin.zsh
1844@@ -14,7 +14,11 @@
1845 
1846 sudo-command-line() {
1847     [[ -z $BUFFER ]] && zle up-history
1848-    [[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
1849+    if [[ $BUFFER == sudo\ * ]]; then
1850+        LBUFFER="${LBUFFER#sudo }"
1851+    else
1852+        LBUFFER="sudo $LBUFFER"
1853+    fi
1854 }
1855 zle -N sudo-command-line
1856 # Defined shortcut keys: [Esc] [Esc]
1857diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
1858index 9f7a4c6eb4721c57b5f6c1b710a052b494248dc9..816055afe956311ee22ca2b564bb7eb521b3a526 100644
1859--- a/plugins/svn/svn.plugin.zsh
1860+++ b/plugins/svn/svn.plugin.zsh
1861@@ -1,16 +1,17 @@
1862 # vim:ft=zsh ts=2 sw=2 sts=2
1863 #
1864 function svn_prompt_info() {
1865+  local _DISPLAY
1866   if in_svn; then
1867     if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then
1868       unset SVN_SHOW_BRANCH
1869       _DISPLAY=$(svn_get_branch_name)
1870     else
1871       _DISPLAY=$(svn_get_repo_name)
1872+      _DISPLAY=$(omz_urldecode "${_DISPLAY}")
1873     fi
1874     echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
1875 $ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(svn_dirty)$(svn_dirty_pwd)$ZSH_PROMPT_BASE_COLOR"
1876-    unset _DISPLAY
1877   fi
1878 }
1879 
1880@@ -30,7 +31,7 @@ function svn_get_repo_name() {
1881 }
1882 
1883 function svn_get_branch_name() {
1884-  _DISPLAY=$(
1885+  local _DISPLAY=$(
1886     svn info 2> /dev/null | \
1887       awk -F/ \
1888       '/^URL:/ { \
1889@@ -49,7 +50,6 @@ function svn_get_branch_name() {
1890   else
1891     echo $_DISPLAY
1892   fi
1893-  unset _DISPLAY
1894 }
1895 
1896 function svn_get_rev_nr() {
1897@@ -60,7 +60,7 @@ function svn_get_rev_nr() {
1898 
1899 function svn_dirty_choose() {
1900   if in_svn; then
1901-    root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
1902+    local root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
1903     if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
1904       # Grep exits with 0 when "One or more lines were selected", return "dirty".
1905       echo $1
1906@@ -77,7 +77,7 @@ function svn_dirty() {
1907 
1908 function svn_dirty_choose_pwd () {
1909   if in_svn; then
1910-    root=$PWD
1911+    local root=$PWD
1912     if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
1913       # Grep exits with 0 when "One or more lines were selected", return "dirty".
1914       echo $1
1915diff --git a/plugins/taskwarrior/README.md b/plugins/taskwarrior/README.md
1916new file mode 100644
1917index 0000000000000000000000000000000000000000..053151e78c98cdecfcabd1c2c46b7bec5b169eb1
1918--- /dev/null
1919+++ b/plugins/taskwarrior/README.md
1920@@ -0,0 +1,13 @@
1921+# taskwarrior
1922+
1923+This plugin adds smart tab completion for [TaskWarrior](http://taskwarrior.org/).
1924+It uses the zsh tab completion script (`_task`) shipped with TaskWarrior for the
1925+completion definitions.
1926+
1927+The latest version pulled in from the official project is of January 1st, 2015.
1928+
1929+
1930+## Examples
1931+
1932+Typing `task [TAB]` will give you a list of commands, `task 66[TAB]` shows a
1933+list of available modifications for that task, etcetera.
1934diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
1935index 5cc2531526e051022dcb3b411bc8a342103eb127..afa30d45a14991d459056c0d2cecd187c568c933 100644
1936--- a/plugins/taskwarrior/_task
1937+++ b/plugins/taskwarrior/_task
1938@@ -1,9 +1,6 @@
1939 #compdef task
1940-# zsh completion for taskwarrior
1941 #
1942-# taskwarrior - a command line task list manager.
1943-#
1944-# Copyright 2010 - 2011 Johannes Schlatow
1945+# Copyright 2010 - 2015 Johannes Schlatow
1946 # Copyright 2009 P.C. Shyamshankar
1947 #
1948 # Permission is hereby granted, free of charge, to any person obtaining a copy
1949@@ -30,31 +27,40 @@ typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
1950 _task_projects=($(task _projects))
1951 _task_tags=($(task _tags))
1952 _task_ids=($(task _ids))
1953+_task_zshids=( ${(f)"$(task _zshids)"} )
1954 _task_config=($(task _config))
1955 _task_columns=($(task _columns))
1956 _task_modifiers=(
1957-	'before' \
1958-	'after' \
1959-	'none' \
1960-	'any' \
1961-	'is' \
1962-	'isnt' \
1963-	'has' \
1964-	'hasnt' \
1965-	'startswith' \
1966-	'endswith' \
1967-	'word' \
1968-	'noword'
1969+  'before' \
1970+  'after' \
1971+  'none' \
1972+  'any' \
1973+  'is' \
1974+  'isnt' \
1975+  'has' \
1976+  'hasnt' \
1977+  'startswith' \
1978+  'endswith' \
1979+  'word' \
1980+  'noword'
1981 )
1982 _task_conjunctions=(
1983-   'and' \
1984-   'or' \
1985-	'xor' \
1986-	'\)'
1987-	'\('
1988+  'and' \
1989+  'or' \
1990+  'xor' \
1991+  '\)' \
1992+  '\(' \
1993+  '<' \
1994+  '<=' \
1995+  '=' \
1996+  '!=' \
1997+  '>=' \
1998+  '>'
1999 )
2000-_task_cmds=($(task _commands))
2001-_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
2002+_task_cmds=($(task _commands; task _aliases))
2003+_task_zshcmds=( ${(f)"$(task _zshcommands)"} sentinel:sentinel:sentinel )
2004+
2005+_task_aliases=($(task _aliases))
2006 
2007 _task() {
2008     _arguments -s -S \
2009@@ -68,110 +74,130 @@ word=$'[^\0]#\0'
2010 # priorities
2011 local -a task_priorities
2012 _regex_words values 'task priorities' \
2013-	'H:High' \
2014-	'M:Middle' \
2015-	'L:Low'
2016+  'H:High' \
2017+  'M:Middle' \
2018+  'L:Low'
2019 task_priorities=("$reply[@]")
2020 
2021 # projects
2022 local -a task_projects
2023 task_projects=(
2024-	/"$word"/
2025-	":values:task projects:compadd -a _task_projects"
2026+  /"$word"/
2027+  ":values:task projects:compadd -a _task_projects"
2028 )
2029 
2030 local -a _task_dates
2031 _regex_words values 'task dates' \
2032-	'tod*ay:Today' \
2033-	'yes*terday:Yesterday' \
2034-	'tom*orrow:Tomorrow' \
2035-	'sow:Start of week' \
2036-	'soww:Start of work week' \
2037-	'socw:Start of calendar week' \
2038diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh
2039index 5d1e6ffea23fabfa87ae3d3e2f81dd1082d85684..ab885943f14d72b569ecb8e38ebb8ade0d51d7d2 100644
2040--- a/plugins/taskwarrior/taskwarrior.plugin.zsh
2041+++ b/plugins/taskwarrior/taskwarrior.plugin.zsh
2042@@ -1,17 +1,3 @@
2043-################################################################################
2044-# Author: Pete Clark
2045-# Email: pete[dot]clark[at]gmail[dot]com
2046-# Version: 0.1 (05/24/2011)
2047-# License: WTFPL<http://sam.zoy.org/wtfpl/>
2048-#
2049-# This oh-my-zsh plugin adds smart tab completion for
2050-# TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion
2051-# script (_task) distributed with TaskWarrior for the completion definitions.
2052-#
2053-# Typing task [tabtab] will give you a list of current tasks, task 66[tabtab]
2054-# gives a list of available modifications for that task, etc.
2055-################################################################################
2056-
2057 zstyle ':completion:*:*:task:*' verbose yes
2058 zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u'
2059 
2060diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh
2061index 6e47ee188db466f713b1203ae4918a8ddd6d8982..7c0c278b98387bc3f611884c28fb33d1b856c9d2 100644
2062--- a/plugins/terminalapp/terminalapp.plugin.zsh
2063+++ b/plugins/terminalapp/terminalapp.plugin.zsh
2064@@ -1,39 +1,6 @@
2065-# Set Apple Terminal.app resume directory
2066-# based on this answer: http://superuser.com/a/315029
2067-# 2012-10-26: (javageek) Changed code using the updated answer
2068-
2069-# Tell the terminal about the working directory whenever it changes.
2070-if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
2071-  update_terminal_cwd() {
2072-        # Identify the directory using a "file:" scheme URL, including
2073-        # the host name to disambiguate local vs. remote paths.
2074-
2075-        # Percent-encode the pathname.
2076-        local URL_PATH=''
2077-        {
2078-            # Use LANG=C to process text byte-by-byte.
2079-            local i ch hexch LANG=C
2080-            for ((i = 1; i <= ${#PWD}; ++i)); do
2081-                ch="$PWD[i]"
2082-                if [[ "$ch" =~ [/._~A-Za-z0-9-] ]]; then
2083-                    URL_PATH+="$ch"
2084-                else
2085-                    hexch=$(printf "%02X" "'$ch")
2086-                    URL_PATH+="%$hexch"
2087-                fi
2088-            done
2089-        }
2090-
2091-        local PWD_URL="file://$HOST$URL_PATH"
2092-        #echo "$PWD_URL"        # testing
2093-        printf '\e]7;%s\a' "$PWD_URL"
2094-    }
2095-
2096-    # Register the function so it is called whenever the working
2097-    # directory changes.
2098-    autoload add-zsh-hook
2099-    add-zsh-hook precmd update_terminal_cwd
2100-
2101-    # Tell the terminal about the initial directory.
2102-    update_terminal_cwd
2103-fi
2104+# This file is intentionally empty.
2105+#
2106+# The terminalapp plugin is deprecated and may be removed in a future release.
2107+# Its functionality has been folded in to the core lib/termsupport.zsh, which
2108+# is loaded for all users. You can remove terminalapp from your $plugins list
2109+# once all your systems are updated to the current version of Oh My Zsh.
2110diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
2111index 76f80b0d78b6b5f787c4997eedba0f63e2a9eb37..764f8954516fceebbbb6d7d2fed9daf01ed25b62 100644
2112--- a/plugins/vagrant/_vagrant
2113+++ b/plugins/vagrant/_vagrant
2114@@ -1,4 +1,4 @@
2115-#compdef vagrant 
2116+#compdef vagrant
2117 #autoload
2118 
2119 # vagrant zsh completion
2120@@ -6,37 +6,45 @@
2121 local -a _1st_arguments
2122 _1st_arguments=(
2123     'box:Box commands'
2124-    'connect:Connects to a shared, remote Vagrant environment'
2125+    'connect:Connects to a remotely shared Vagrant environment'
2126     'destroy:Destroys the vagrant environment'
2127-    'docker-logs:Shows Docker logs'
2128-    'docker-run:Run one-off commands against a Docker container'
2129+    'docker-logs:Outputs the logs from the Docker container'
2130+    'docker-run:Run a one-off command in the context of a container'
2131     'global-status:Reports the status of all active Vagrant environments on the system'
2132     'halt:Halts the currently running vagrant environment'
2133+    'help:Shows the help for a subcommand'
2134     'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
2135+    'list-commands:Outputs all available Vagrant subcommands, even non-primary ones'
2136     'login:Authenticates against a Vagrant Cloud server to access protected boxes'
2137     'package:Packages a vagrant environment for distribution'
2138     'plugin:Plugin commands'
2139     'provision:Run the provisioner'
2140+    'push:Deploys code in this environment to a configured destination'
2141+    'rdp:Connects to machine via RDP'
2142     'reload:Reload the vagrant environment'
2143     'resume:Resumes a suspend vagrant environment'
2144-    'share:Shares the Vagrant environment and allows remote access'
2145+    'rsync:Syncs rsync synced folders to remote machine'
2146+    'rsync-auto:Syncs rsync synced folders automatically when files change'
2147+    'share:Shares your Vagrant environment with anyone in the world'
2148     'ssh:SSH into the currently running environment'
2149-    'ssh-config:outputs .ssh/config valid syntax for connecting to this environment via ssh'
2150+    'ssh-config:Outputs .ssh/config valid syntax for connecting to this environment via ssh'
2151     'status:Shows the status of the current Vagrant environment'
2152     'suspend:Suspends the currently running vagrant environment'
2153     'up:Creates the vagrant environment'
2154-    'version:Prints the currently installed Vagrant version and checks for new updates'
2155+    'version:Prints current and latest Vagrant version'
2156     '--help:[TASK] Describe available tasks or one specific task'
2157     '--version:Prints the Vagrant version information'
2158 )
2159 
2160 local -a _box_arguments
2161 _box_arguments=(
2162-    'add:NAME URI Add a box to the system'
2163-    'help:COMMAND Describe subcommands or one specific subcommand'
2164+    'add:ADDRESS Adds a box to the system'
2165+    'help:COMMAND List subcommands'
2166     'list:Lists all installed boxes'
2167-    'remove:NAME Remove a box from the system'
2168-    'repackage:NAME Repackage an installed box into a `.box` file.'
2169+    'outdated:Checks if a box has newer version'
2170+    'remove:NAME Removes a box from the system'
2171+    'repackage:NAME PROVIDER VERSION Repackages an installed box into a `.box` file'
2172+    'update:Updates box to a newer version, if available'
2173 )
2174 
2175 __task_list ()
2176@@ -78,7 +86,7 @@ __vagrant-box ()
2177        (options)
2178            case $line[1] in
2179                (repackage|remove)
2180-                   _arguments ':feature:__box_list' 
2181+                   _arguments ':feature:__box_list'
2182                ;;
2183            esac
2184        ;;
2185@@ -107,14 +115,14 @@ case $state in
2186   (options)
2187     case $line[1] in
2188       (help)
2189-         _arguments ':feature:__task_list' 
2190+         _arguments ':feature:__task_list'
2191       ;;
2192 
2193       (box)
2194           __vagrant-box
2195       ;;
2196       (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status)
2197-	_arguments ':feature:__vm_list'
2198+      _arguments ':feature:__vm_list'
2199     esac
2200   ;;
2201 esac
2202diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh
2203index b0b9414cd2aac90e3403418c6b3e38e381cbcc6b..b774be342745ade466098e3158c0c3ccc5631524 100644
2204--- a/plugins/vim-interaction/vim-interaction.plugin.zsh
2205+++ b/plugins/vim-interaction/vim-interaction.plugin.zsh
2206@@ -4,17 +4,6 @@
2207 # Derek Wyatt (derek@{myfirstnamemylastname}.org
2208 # 
2209 
2210-function resolveFile
2211-{
2212-  if [ -f "$1" ]; then
2213-    echo $(readlink -f "$1")
2214-  elif [[ "${1#/}" == "$1" ]]; then
2215-    echo "$PWD/$1"
2216-  else
2217-    echo $1
2218-  fi
2219-}
2220-
2221 function callvim
2222 {
2223   if [[ $# == 0 ]]; then
2224@@ -48,13 +37,10 @@ EOH
2225   if [[ ${before#:} != $before && ${before%<cr>} == $before ]]; then
2226     before="$before<cr>"
2227   fi
2228-  local files=""
2229-  for f in $@
2230-  do
2231-    files="$files $(resolveFile $f)"
2232-  done
2233-  if [[ -n $files ]]; then
2234-    files=':args! '"$files<cr>"
2235+  local files
2236+  if [[ $# -gt 0 ]]; then
2237+    # absolute path of files resolving symlinks (:A) and quoting special chars (:q)
2238+    files=':args! '"${@:A:q}<cr>"
2239   fi
2240   cmd="$before$files$after"
2241   gvim --remote-send "$cmd"