6cddf7202b8ef5c2eb2dfc081d870dc9e751d646

Author
Andrew Janke <andrew@apjanke.net>
Committer
Andrew Janke <andrew@apjanke.net>
Date

Message

Merge branch 'master' into installer-portable-colors

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 9adb9031a0e9c61c113a0e210531f5f3fdc5f4e2..ec1a114edeb67221e0f203646fb0daf30fabbe07 100644
 457--- a/plugins/atom/atom.plugin.zsh
 458+++ b/plugins/atom/atom.plugin.zsh
 459@@ -1,14 +1,22 @@
 460-local _atom_paths > /dev/null 2>&1
 461-_atom_paths=(
 462-    "$HOME/Applications/Atom.app"
 463-    "/Applications/Atom.app"
 464-)
 465+# Gets OS Type
 466+unamestr=$(uname -s)
 467 
 468-for _atom_path in $_atom_paths; do
 469-    if [[ -a $_atom_path ]]; then
 470-        alias at="open -a '$_atom_path'"
 471-        break
 472-    fi
 473-done
 474+# If OSX
 475+if [[ "$unamestr" == 'Darwin' ]]; then
 476+    local _atom_paths > /dev/null 2>&1
 477+    _atom_paths=(
 478+        "$HOME/Applications/Atom.app"
 479+        "/Applications/Atom.app"
 480+    )
 481 
 482-alias att='at .'
 483+    for _atom_path in $_atom_paths; do
 484+        if [[ -a $_atom_path ]]; then
 485+            alias at="open -a '$_atom_path'"
 486+            break
 487+        fi
 488+    done
 489+# If Linux
 490+elif [[ "$unamestr" == 'Linux' ]]; then
 491+    # Alerts the user if 'atom' is not a found command.
 492+    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."; }
 493+fi
 494diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 495index 7246db9f0e10252a2c9bee1cff624e0b76ebc6c9..d31052f8300082f0d7ed5a47e59a2cf1454288d0 100644
 496--- a/plugins/aws/aws.plugin.zsh
 497+++ b/plugins/aws/aws.plugin.zsh
 498@@ -11,11 +11,16 @@ export AWS_HOME=~/.aws
 499 function agp {
 500   echo $AWS_DEFAULT_PROFILE
 501 }
 502+
 503 function asp {
 504+  local rprompt=${RPROMPT/<aws:$(agp)>/}
 505+
 506   export AWS_DEFAULT_PROFILE=$1
 507   export AWS_PROFILE=$1
 508-  export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$RPROMPT"
 509+
 510+  export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
 511 }
 512+
 513 function aws_profiles {
 514   reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
 515 }
 516diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
 517index b70b42f984540b2d58e9a6720e57234ec5ae21d6..459f5214e62c07d62d65dbd98901ea2c4dc82bcc 100755
 518--- a/plugins/bgnotify/bgnotify.plugin.zsh
 519+++ b/plugins/bgnotify/bgnotify.plugin.zsh
 520@@ -11,31 +11,38 @@ autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
 521 
 522 ## definitions ##
 523 
 524-if ! (type bgnotify_formatted | grep -q 'function'); then
 525-  function bgnotify_formatted {
 526-    ## exit_status, command, elapsed_time
 527-    [ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)"
 528-    bgnotify "$title" "$2"
 529+if ! (type bgnotify_formatted | grep -q 'function'); then ## allow custom function override
 530+  function bgnotify_formatted { ## args: (exit_status, command, elapsed_seconds)
 531+    elapsed="$(( $3 % 60 ))s"
 532+    (( $3 >= 60 )) && elapsed="$((( $3 % 3600) / 60 ))m $elapsed"
 533+    (( $3 >= 3600 )) && elapsed="$(( $3 / 3600 ))h $elapsed"
 534+    [ $1 -eq 0 ] && bgnotify "#win (took $elapsed)" "$2" || bgnotify "#fail (took $elapsed)" "$2"
 535   }
 536 fi
 537 
 538 currentWindowId () {
 539   if hash osascript 2>/dev/null; then #osx
 540     osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
 541-  elif hash notify-send 2>/dev/null; then #ubuntu!
 542-    xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
 543+  elif (hash notify-send 2>/dev/null || hash kdialog 2>/dev/null); then #ubuntu!
 544+    xprop -root 2> /dev/null | awk '/NET_ACTIVE_WINDOW/{print $5;exit} END{exit !$5}' || echo "0"
 545   else
 546     echo $EPOCHSECONDS #fallback for windows
 547   fi
 548 }
 549 
 550-bgnotify () {
 551+bgnotify () { ## args: (title, subtitle)
 552   if hash terminal-notifier 2>/dev/null; then #osx
 553-    terminal-notifier -message "$2" -title "$1"
 554+    [[ "$TERM_PROGRAM" == 'iTerm.app' ]] && term_id='com.googlecode.iterm2';
 555+    [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] && term_id='com.apple.terminal';
 556+    ## now call terminal-notifier, (hopefully with $term_id!)
 557+    [ -z "$term_id" ] && terminal-notifier -message "$2" -title "$1" >/dev/null ||
 558+    terminal-notifier -message "$2" -title "$1" -activate "$term_id" -sender "$term_id" >/dev/null
 559   elif hash growlnotify 2>/dev/null; then #osx growl
 560     growlnotify -m "$1" "$2"
 561-  elif hash notify-send 2>/dev/null; then #ubuntu!
 562+  elif hash notify-send 2>/dev/null; then #ubuntu gnome!
 563     notify-send "$1" "$2"
 564+  elif hash kdialog 2>/dev/null; then #ubuntu kde!
 565+    kdialog  -title "$1" --passivepopup  "$2" 5
 566   elif hash notifu 2>/dev/null; then #cygwyn support!
 567     notifu /m "$2" /p "$1"
 568   fi
 569@@ -46,7 +53,7 @@ bgnotify () {
 570 
 571 bgnotify_begin() {
 572   bgnotify_timestamp=$EPOCHSECONDS
 573-  bgnotify_lastcmd=$1
 574+  bgnotify_lastcmd="$1"
 575   bgnotify_windowid=$(currentWindowId)
 576 }
 577 
 578@@ -63,5 +70,8 @@ bgnotify_end() {
 579   bgnotify_timestamp=0 #reset it to 0!
 580 }
 581 
 582-add-zsh-hook preexec bgnotify_begin
 583-add-zsh-hook precmd bgnotify_end
 584+## only enable if a local (non-ssh) connection
 585+if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
 586+  add-zsh-hook preexec bgnotify_begin
 587+  add-zsh-hook precmd bgnotify_end
 588+fi
 589diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano
 590index 3cadf3d54be8aabaacaf509d5ca75ab14eb97910..e6e71ffcc80d121d3adba7bde7f461bafcaa26b3 100644
 591--- a/plugins/capistrano/_capistrano
 592+++ b/plugins/capistrano/_capistrano
 593@@ -1,10 +1,49 @@
 594-#compdef cap
 595+#compdef shipit
 596 #autoload
 597 
 598-if [[ -f config/deploy.rb || -f Capfile ]]; then
 599-  if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
 600-    echo "\nGenerating .cap_tasks~..." > /dev/stderr
 601-    cap -v --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
 602+# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
 603+# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
 604+
 605+local curcontext="$curcontext" state line ret=1
 606+local -a _configs
 607+
 608+_arguments -C \
 609+  '1: :->cmds' \
 610+  '2:: :->args' && ret=0
 611+
 612+_cap_tasks() {
 613+  if [[ -f config/deploy.rb || -f Capfile ]]; then
 614+    if [[ ! -f .cap_tasks~ ]]; then
 615+      shipit -v --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~
 616+    fi
 617+
 618+    OLD_IFS=$IFS
 619+    IFS=$'\n'
 620+    _values 'cap commands' $(< .cap_tasks~)
 621+    IFS=$OLD_IFS
 622+    # zmodload zsh/mapfile
 623+    # _values ${(f)mapfile[.cap_tasks~]}
 624   fi
 625-  compadd `cat .cap_tasks~`
 626-fi
 627+}
 628+
 629+_cap_stages() {
 630+  compadd $(find config/deploy -name \*.rb | cut -d/ -f3 | sed s:.rb::g)
 631+}
 632+
 633+case $state in
 634+  cmds)
 635+    # check if it uses multistage
 636+    if [[ -d config/deploy ]]; then
 637+      _cap_stages
 638+    else
 639+      _cap_tasks
 640+    fi
 641+    ret=0
 642+    ;;
 643+  args)
 644+    _cap_tasks
 645+    ret=0
 646+    ;;
 647+esac
 648+
 649+return ret
 650diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh
 651new file mode 100644
 652index 0000000000000000000000000000000000000000..c85eb474ca8a9cd85f8f3cc4446e54ce5a5a0c85
 653--- /dev/null
 654+++ b/plugins/capistrano/capistrano.plugin.zsh
 655@@ -0,0 +1,11 @@
 656+# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
 657+# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
 658+
 659+func shipit() {
 660+  if [ -f Gemfile ]
 661+  then
 662+    bundle exec cap $*
 663+  else
 664+    cap $*
 665+  fi
 666+}
 667diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
 668index b461b0c9be7d5b39a27ebc7d646e93434e57e15a..5be6528b0edbcf818ca8ccd52d6cc7a619de7079 100644
 669--- a/plugins/chruby/chruby.plugin.zsh
 670+++ b/plugins/chruby/chruby.plugin.zsh
 671@@ -45,11 +45,11 @@ _source_from_omz_settings() {
 672     zstyle -s :omz:plugins:chruby path _chruby_path
 673     zstyle -s :omz:plugins:chruby auto _chruby_auto
 674 
 675-    if ${_chruby_path} && [[ -r ${_chruby_path} ]]; then
 676+    if [[ -r ${_chruby_path} ]]; then
 677         source ${_chruby_path}
 678     fi
 679 
 680-    if ${_chruby_auto} && [[ -r ${_chruby_auto} ]]; then
 681+    if [[ -r ${_chruby_auto} ]]; then
 682         source ${_chruby_auto}
 683     fi
 684 }
 685diff --git a/plugins/codeclimate/_codeclimate b/plugins/codeclimate/_codeclimate
 686new file mode 100644
 687index 0000000000000000000000000000000000000000..fd2536a340d632108c3f04bdd130052445c8d02d
 688--- /dev/null
 689+++ b/plugins/codeclimate/_codeclimate
 690@@ -0,0 +1,82 @@
 691+#compdef codeclimate
 692+
 693+_codeclimate_all_engines() {
 694+  engines_all=(`codeclimate engines:list | tail -n +2 | gawk '{ print $2 }' | gawk -F: '{ print $1 }'`)
 695+}
 696+
 697+_codeclimate_installed_engines() {
 698+  _codeclimate_all_engines
 699+
 700+  engines_installed=()
 701+
 702+  if [ -e .codeclimate.yml ]
 703+  then
 704+    for engine in $engines_all
 705+    do
 706+      if grep -q $engine ".codeclimate.yml"
 707+      then
 708+        engines_installed+=$engine
 709+      fi
 710+    done
 711+  fi
 712+}
 713+
 714+_codeclimate_not_installed_engines() {
 715+  _codeclimate_all_engines
 716+
 717+  engines_not_installed=()
 718+
 719+  if [ -e .codeclimate.yml ]
 720+  then
 721+    for engine in $engines_all
 722+    do
 723+      if ! grep -q $engine ".codeclimate.yml"
 724+      then
 725+        engines_not_installed+=$engine
 726+      fi
 727+    done
 728+  fi
 729+}
 730+
 731+local curcontext="$curcontext" state line ret=1
 732+local expl
 733+local -a engines_all engines_installed engines_not_installed
 734+
 735+_arguments \
 736+  '1: :->cmds' \
 737+  '*:: :->args' && ret=0
 738+
 739+case $state in
 740+  cmds)
 741+    _values "bundle command" \
 742+      "analyze[Analyze all relevant files in the current working directory]" \
 743+      "console[Start an interactive session providing access to the classes within the CLI]" \
 744+      "engines\:disable[Prevents the engine from being used in this project]" \
 745+      "engines\:enable[This engine will be run the next time your project is analyzed]" \
 746+      "engines\:install[Compares the list of engines in your .codeclimate.yml file to those that are currently installed, then installs any missing engines]" \
 747+      "engines\:list[Lists all available engines in the Code Climate Docker Hub]" \
 748+      "engines\:remove[Removes an engine from your .codeclimate.yml file]" \
 749+      "help[Displays a list of commands that can be passed to the Code Climate CLI]" \
 750+      "init[Generates a new .codeclimate.yml file in the current working directory]" \
 751+      "validate-config[Validates the .codeclimate.yml file in the current working directory]" \
 752+      "version[Displays the current version of the Code Climate CLI]"
 753+    ret=0
 754+    ;;
 755+  args)
 756+    case $line[1] in
 757+      engines:enable)
 758+        _codeclimate_not_installed_engines
 759+        _wanted engines_not_installed expl 'not installed engines' compadd -a engines_not_installed ;;
 760+      engines:disable|engines:remove)
 761+        _codeclimate_installed_engines
 762+        _wanted engines_installed expl 'installed engines' compadd -a engines_installed ;;
 763+      analyze)
 764+        _arguments \
 765+          '-f:Output Format:(text json)'
 766+        ret=0
 767+        ;;
 768+    esac
 769+    ;;
 770+esac
 771+
 772+return ret
 773diff --git a/plugins/coffee/coffee.plugin.zsh b/plugins/coffee/coffee.plugin.zsh
 774index 1a7bedd87fe9426f18c00e9f99bbc269a194406d..4e98e022869ea8b968ab4f3598f904bb51ff27d8 100644
 775--- a/plugins/coffee/coffee.plugin.zsh
 776+++ b/plugins/coffee/coffee.plugin.zsh
 777@@ -2,11 +2,11 @@
 778 
 779 # compile a string of coffeescript and print to output
 780 cf () {
 781-  coffee -peb $1
 782+  coffee -peb "$1"
 783 }
 784 # compile & copy to clipboard
 785 cfc () {
 786-  cf $1 | pbcopy
 787+  cf "$1" | pbcopy
 788 }
 789 
 790 # compile from pasteboard & print
 791diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh
 792new file mode 100644
 793index 0000000000000000000000000000000000000000..b32dd1a4c52b0a76ec21b6b7a5485db6f6a5af5a
 794--- /dev/null
 795+++ b/plugins/emotty/emotty.plugin.zsh
 796@@ -0,0 +1,43 @@
 797+# ------------------------------------------------------------------------------
 798+#          FILE: emotty.plugin.zsh
 799+#   DESCRIPTION: Return an emoji for the current $TTY number.
 800+#        AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
 801+#       VERSION: 1.0.0
 802+#       DEPENDS: emoji plugin
 803+#       
 804+# There are different sets of emoji characters available, to choose a different
 805+# set export emotty_set to the name of the set you would like to use, e.g.:
 806+# % export emotty_set=nature
 807+# ------------------------------------------------------------------------------
 808+
 809+typeset -gAH _emotty_sets
 810+local _emotty_plugin_dir="${0:h}"
 811+source "$_emotty_plugin_dir/emotty_stellar_set.zsh"
 812+source "$_emotty_plugin_dir/emotty_floral_set.zsh"
 813+source "$_emotty_plugin_dir/emotty_zodiac_set.zsh"
 814+source "$_emotty_plugin_dir/emotty_nature_set.zsh"
 815+source "$_emotty_plugin_dir/emotty_emoji_set.zsh"
 816+source "$_emotty_plugin_dir/emotty_love_set.zsh"
 817+unset _emotty_plugin_dir
 818+
 819+emotty_default_set=emoji
 820+
 821+function emotty() {
 822+  # Use emotty set defined by user, fallback to default
 823+  local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]}
 824+  # Parse $TTY number, normalizing it to an emotty set index
 825+  (( tty = (${TTY##/dev/ttys} % ${#${=emotty}}) + 1 ))
 826+  local character_name=${${=emotty}[tty]}
 827+  echo "${emoji[${character_name}]}${emoji2[emoji_style]}"
 828+}
 829+
 830+function display_emotty() {
 831+  local name=$1
 832+  for i in ${=_emotty_sets[$name]}; do
 833+    printf "${emoji[$i]}${emoji2[emoji_style]}  "
 834+  done
 835+  print
 836+  for i in ${=_emotty_sets[$name]}; do
 837+    print "${emoji[$i]}${emoji2[emoji_style]}  = $i"
 838+  done
 839+}
 840diff --git a/plugins/emotty/emotty_emoji_set.zsh b/plugins/emotty/emotty_emoji_set.zsh
 841new file mode 100644
 842index 0000000000000000000000000000000000000000..00e3171312aa7da12ba138f19904d2184e58b0e7
 843--- /dev/null
 844+++ b/plugins/emotty/emotty_emoji_set.zsh
 845@@ -0,0 +1,24 @@
 846+#!/usr/bin/env zsh
 847+# vim:ft=zsh ts=2 sw=2 sts=2
 848+
 849+_emotty_sets[emoji]="
 850+  crystal_ball
 851+  ghost
 852+  jack_o_lantern
 853+  see_no_evil_monkey
 854+  hear_no_evil_monkey
 855+  speak_no_evil_monkey
 856+  smiling_cat_face_with_open_mouth
 857+  extraterrestrial_alien
 858+  rocket
 859+  billiards
 860+  bomb
 861+  pill
 862+  japanese_symbol_for_beginner
 863+  direct_hit
 864+  cyclone
 865+  diamond_shape_with_a_dot_inside
 866+  sparkle
 867+  eight_spoked_asterisk
 868+  eight_pointed_black_star
 869+  "
 870diff --git a/plugins/emotty/emotty_floral_set.zsh b/plugins/emotty/emotty_floral_set.zsh
 871new file mode 100644
 872index 0000000000000000000000000000000000000000..f761feae6de186cf83e68f8398d535472dc1fd82
 873--- /dev/null
 874+++ b/plugins/emotty/emotty_floral_set.zsh
 875@@ -0,0 +1,18 @@
 876+#!/usr/bin/env zsh
 877+# vim:ft=zsh ts=2 sw=2 sts=2
 878+
 879+_emotty_sets[floral]="
 880+  hibiscus
 881+  cherry_blossom
 882+  blossom
 883+  sunflower
 884+  bouquet
 885+  tulip
 886+  rose
 887+  four_leaf_clover
 888+  seedling
 889+  herb
 890+  palm_tree
 891+  evergreen_tree
 892+  deciduous_tree
 893+  "
 894diff --git a/plugins/emotty/emotty_love_set.zsh b/plugins/emotty/emotty_love_set.zsh
 895new file mode 100644
 896index 0000000000000000000000000000000000000000..8f19e6902e2e5842eba4ed2dfb53e36ef619b391
 897--- /dev/null
 898+++ b/plugins/emotty/emotty_love_set.zsh
 899@@ -0,0 +1,34 @@
 900+#!/usr/bin/env zsh
 901+# vim:ft=zsh ts=2 sw=2 sts=2
 902+
 903+# Note: The heavy_black_heart emoji requires $emoji2[emoji_style]
 904+# to be rendered as the emoji red heart.
 905+_emotty_sets[love]="
 906+  green_heart
 907+  blue_heart
 908+  purple_heart
 909+  yellow_heart
 910+  heavy_black_heart
 911+  broken_heart
 912+  heart_with_arrow
 913+  heart_with_ribbon
 914+  sparkling_heart
 915+  two_hearts
 916+  revolving_hearts
 917+  growing_heart
 918+  beating_heart
 919+  heart_decoration
 920+  couple_with_heart
 921+  kiss
 922+  man_and_woman_holding_hands
 923+  two_women_holding_hands
 924+  two_men_holding_hands
 925+  kiss_mark
 926+  smiling_face_with_heart_shaped_eyes
 927+  kissing_face
 928+  face_throwing_a_kiss
 929+  kissing_face_with_smiling_eyes
 930+  kissing_face_with_closed_eyes
 931+  smiling_cat_face_with_heart_shaped_eyes
 932+  kissing_cat_face_with_closed_eyes
 933+  "
 934diff --git a/plugins/emotty/emotty_nature_set.zsh b/plugins/emotty/emotty_nature_set.zsh
 935new file mode 100644
 936index 0000000000000000000000000000000000000000..8dab4c1ba2eee2ad59bb8335dea79aabb007dadd
 937--- /dev/null
 938+++ b/plugins/emotty/emotty_nature_set.zsh
 939@@ -0,0 +1,58 @@
 940+#!/usr/bin/env zsh
 941+# vim:ft=zsh ts=2 sw=2 sts=2
 942+
 943+_emotty_sets[nature]="
 944+  mouse_face
 945+  hamster_face
 946+  rabbit_face
 947+  dog_face
 948+  cat_face
 949+  tiger_face
 950+  bear_face
 951+  monkey_face
 952+  koala
 953+  panda_face
 954+  chicken
 955+  baby_chick
 956+  bird
 957+  penguin
 958+  cow_face
 959+  pig_face
 960+  frog_face
 961+  boar
 962+  wolf_face
 963+  horse_face
 964+  snail
 965+  bug
 966+  ant
 967+  honeybee
 968+  lady_beetle
 969+  spouting_whale
 970+  dolphin
 971+  octopus
 972+  fish
 973+  tropical_fish
 974+  snake
 975+  turtle
 976+  lemon
 977+  tangerine
 978+  peach
 979+  mushroom
 980+  tomato
 981+  strawberry
 982+  red_apple
 983+  cherries
 984+  grapes
 985+  aubergine
 986+  watermelon
 987+  banana
 988+  pineapple
 989+  melon
 990+  pear
 991+  green_apple
 992+  ear_of_maize
 993+  sunflower
 994+  seedling
 995+  herb
 996+  four_leaf_clover
 997+  "
 998diff --git a/plugins/emotty/emotty_stellar_set.zsh b/plugins/emotty/emotty_stellar_set.zsh
 999new file mode 100644
1000index 0000000000000000000000000000000000000000..8e7e61068a523461cd1dbd4b5d0e8e023a35ce6c
1001--- /dev/null
1002+++ b/plugins/emotty/emotty_stellar_set.zsh
1003@@ -0,0 +1,25 @@
1004+#!/usr/bin/env zsh
1005+# vim:ft=zsh ts=2 sw=2 sts=2
1006+
1007+# NOTE: The following emoji show as $'character' in the title
1008+#  white_medium_star
1009+#  sparkles
1010+#  dizzy_symbol
1011+
1012+_emotty_sets[stellar]="
1013+  full_moon_symbol
1014+  waning_gibbous_moon_symbol
1015+  waning_crescent_moon_symbol
1016+  last_quarter_moon_symbol
1017+  new_moon_symbol
1018+  new_moon_with_face
1019+  waxing_crescent_moon_symbol
1020+  first_quarter_moon_symbol
1021+  waxing_gibbous_moon_symbol
1022+  full_moon_with_face
1023+  sun_with_face
1024+  glowing_star
1025+  crescent_moon
1026+  first_quarter_moon_with_face
1027+  last_quarter_moon_with_face
1028+  "
1029diff --git a/plugins/emotty/emotty_zodiac_set.zsh b/plugins/emotty/emotty_zodiac_set.zsh
1030new file mode 100644
1031index 0000000000000000000000000000000000000000..bde6e3d2e764477ce3ed0e3a0186d02a09ed6bff
1032--- /dev/null
1033+++ b/plugins/emotty/emotty_zodiac_set.zsh
1034@@ -0,0 +1,29 @@
1035+#!/usr/bin/env zsh
1036+# vim:ft=zsh ts=2 sw=2 sts=2
1037+
1038+_emotty_sets[zodiac]="
1039+  aries
1040+  taurus
1041+  gemini
1042+  cancer
1043+  leo
1044+  virgo
1045+  libra
1046+  scorpius
1047+  sagittarius
1048+  capricorn
1049+  aquarius
1050+  pisces
1051+  rat
1052+  ox
1053+  tiger
1054+  rabbit
1055+  dragon
1056+  snake
1057+  horse
1058+  goat
1059+  monkey
1060+  rooster
1061+  dog
1062+  pig
1063+  "
1064diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md
1065new file mode 100644
1066index 0000000000000000000000000000000000000000..a7670fa2c2d9a21ea1c5aeeeb06ed07c6ece2988
1067--- /dev/null
1068+++ b/plugins/fancy-ctrl-z/README.md
1069@@ -0,0 +1,14 @@
1070+# Use Ctrl-Z to switch back to Vim
1071+
1072+I frequently need to execute random command in my shell. To achieve it I pause 
1073+Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
1074+The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back 
1075+to Vim. I could not find a solution, so I developed one on my own that 
1076+works wonderfully with ZSH
1077+
1078+Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
1079+
1080+Credits: 
1081+- original idea by @sheerun
1082+- added to OMZ by @mbologna
1083+
1084diff --git a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
1085new file mode 100644
1086index 0000000000000000000000000000000000000000..8ab2979133efda46a4ce1990f4d159da69d603e6
1087--- /dev/null
1088+++ b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
1089@@ -0,0 +1,12 @@
1090+fancy-ctrl-z () {
1091+  if [[ $#BUFFER -eq 0 ]]; then
1092+    BUFFER="fg"
1093+    zle accept-line
1094+  else
1095+    zle push-input
1096+    zle clear-screen
1097+  fi
1098+}
1099+zle -N fancy-ctrl-z
1100+bindkey '^Z' fancy-ctrl-z
1101+
1102diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
1103index b8e96ea4a36770a7731b4c20e30221a43594bc7a..d0bc5589f742e2dd3081242f2811b69d0571bff4 100644
1104--- a/plugins/frontend-search/README.md
1105+++ b/plugins/frontend-search/README.md
1106@@ -1,76 +1,60 @@
1107-## Rationale ##
1108+## Introduction ##
1109 
1110-> Searches for your Frontend contents more easier
1111+> Searches for your frontend web development made easier
1112 
1113 
1114-## Instalation ##
1115+## Installation ##
1116 
1117+Open your `~/.zshrc` file and enable the `frontend-search` plugin:
1118 
1119-Open your `.zshrc` file and load `frontend-search` plugin
1120+```zsh
1121+
1122+plugins=( ... frontend-search)
1123 
1124-```bash
1125-...
1126-plugins=( <your-plugins-list>... frontend-search)
1127-...
1128 ```
1129 
1130 
1131-## Commands ##
1132-
1133-All command searches are accept only in format
1134-
1135-* `frontend <search-content> <search-term>`
1136-
1137-The search content are
1138-
1139-* `jquery <api.jquery.com>`
1140-* `mdn <developer.mozilla.org>`
1141-* `compass <compass-style.org>`
1142-* `html5please <html5please.com>`
1143-* `caniuse <caniuse.com>`
1144-* `aurajs <aurajs.com>`
1145-* `dartlang <api.dartlang.org/apidocs/channels/stable/dartdoc-viewer>`
1146-* `lodash <search>`
1147-* `qunit <api.qunitjs.com>`
1148-* `fontello <fontello.com>`
1149-* `bootsnipp <bootsnipp.com>`
1150-* `cssflow <cssflow.com>`
1151-* `codepen <codepen.io>`
1152-* `unheap <www.unheap.com>`
1153-* `bem <google.com/search?as_q=<search-term>&as_sitesearch=bem.info>`
1154-* `smacss <google.com/search?as_q=<search-term>&as_sitesearch=smacss.com>`
1155-* `angularjs <google.com/search?as_q=<search-term>&as_sitesearch=angularjs.org>`
1156-* `reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
1157-* `emberjs <emberjs.com>`
1158-* `stackoverflow <stackoverflow.com>`
1159-* `npmjs <npmjs.com>`
1160-
1161-
1162-## Aliases ##
1163-
1164-There are a few aliases presented as well:
1165-
1166-* `jquery` A shorthand for `frontend jquery`
1167-* `mdn` A shorthand for `frontend mdn`
1168-* `compass` A shorthand for `frontend compass`
1169-* `html5please` A shorthand for `frontend html5please`
1170-* `caniuse` A shorthand for `frontend caniuse`
1171-* `aurajs` A shorthand for `frontend aurajs`
1172-* `dartlang` A shorthand for `frontend dartlang`
1173-* `lodash` A shorthand for `frontend lodash`
1174-* `qunit` A shorthand for `frontend qunit`
1175-* `fontello` A shorthand for `frontend fontello`
1176-* `bootsnipp` A shorthand for `frontend bootsnipp`
1177-* `cssflow` A shorthand for `frontend cssflow`
1178-* `codepen` A shorthand for `frontend codepen`
1179-* `unheap` A shorthand for `frontend unheap`
1180-* `bem` A shorthand for `frontend bem`
1181-* `smacss` A shorthand for `frontend smacss`
1182-* `angularjs` A shorthand for `frontend angularjs`
1183-* `reactjs` A shorthand for `frontend reactjs`
1184-* `emberjs` A shorthand for `frontend emberjs`
1185-* `stackoverflow` A shorthand for `frontend stackoverflow`
1186-* `npmjs` A shorthand for `frontend npmjs`
1187+## Usage ##
1188+
1189+You can use the frontend-search plugin in these two forms:
1190+
1191+* `frontend <context> <term> [more terms if you want]`
1192+* `<context> <term> [more terms if you want]`
1193+
1194+For example, these two are equivalent:
1195+
1196+```zsh
1197+$ frontend angularjs dependency injection
1198+$ angularjs dependency injection
1199+```
1200+
1201+Available search contexts are:
1202+
1203+| context       | URL                                                                      |
1204+|---------------|--------------------------------------------------------------------------|
1205+| angularjs     | `https://google.com/search?as_sitesearch=angularjs.org&as_q=`            |
1206diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
1207index e47735a60fe7fc2ea455f4e95ee236df8f4f24de..2fd5416b3c032aaab73f1ea780aa717881ddb680 100644
1208--- a/plugins/frontend-search/frontend-search.plugin.zsh
1209+++ b/plugins/frontend-search/frontend-search.plugin.zsh
1210@@ -1,155 +1,91 @@
1211-# frontend from terminal
1212+alias angularjs='frontend angularjs'
1213+alias aurajs='frontend aurajs'
1214+alias bem='frontend bem'
1215+alias bootsnipp='frontend bootsnipp'
1216+alias caniuse='frontend caniuse'
1217+alias codepen='frontend codepen'
1218+alias compass='frontend compass'
1219+alias cssflow='frontend cssflow'
1220+alias dartlang='frontend dartlang'
1221+alias emberjs='frontend emberjs'
1222+alias fontello='frontend fontello'
1223+alias html5please='frontend html5please'
1224+alias jquery='frontend jquery'
1225+alias lodash='frontend lodash'
1226+alias mdn='frontend mdn'
1227+alias npmjs='frontend npmjs'
1228+alias qunit='frontend qunit'
1229+alias reactjs='frontend reactjs'
1230+alias smacss='frontend smacss'
1231+alias stackoverflow='frontend stackoverflow'
1232+alias unheap='frontend unheap'
1233 
1234 function frontend() {
1235-
1236-  # no keyword provided, simply show how call methods
1237-  if [[ $# -le 1 ]]; then
1238-    echo "Please provide a search-content and a search-term for app.\nEx:\nfrontend <search-content> <search-term>\n"
1239-    return 1
1240+  emulate -L zsh
1241+
1242+  # define search context URLS
1243+  typeset -A urls
1244+  urls=(
1245+    angularjs      'https://google.com/search?as_sitesearch=angularjs.org&as_q='
1246+    aurajs         'http://aurajs.com/api/#stq='
1247+    bem            'https://google.com/search?as_sitesearch=bem.info&as_q='
1248+    bootsnipp      'http://bootsnipp.com/search?q='
1249+    caniuse        'http://caniuse.com/#search='
1250+    codepen        'http://codepen.io/search?q='
1251+    compass        'http://compass-style.org/search?q='
1252+    cssflow        'http://www.cssflow.com/search?q='
1253+    dartlang       'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
1254+    emberjs        'http://emberjs.com/api/#stp=1&stq='
1255+    fontello       'http://fontello.com/#search='
1256+    html5please    'http://html5please.com/#'
1257+    jquery         'https://api.jquery.com/?s='
1258+    lodash         'https://devdocs.io/lodash/index#'
1259+    mdn            'https://developer.mozilla.org/search?q='
1260+    npmjs          'https://www.npmjs.com/search?q='
1261+    qunit          'https://api.qunitjs.com/?s='
1262+    reactjs        'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q='
1263+    smacss         'https://google.com/search?as_sitesearch=smacss.com&as_q='
1264+    stackoverflow  'http://stackoverflow.com/search?q='
1265+    unheap         'http://www.unheap.com/?s='
1266+  )
1267+
1268+  # show help for command list
1269+  if [[ $# -lt 2 ]]
1270+  then
1271+      print -P "Usage: frontend %Ucontext%u %Uterm%u [...%Umore%u] (or just: %Ucontext%u %Uterm%u [...%Umore%u])"
1272+      print -P ""
1273+      print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
1274+      print -P "and %Ucontext%u is one of the following:"
1275+      print -P ""
1276+      print -P "  angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compass, cssflow,"
1277+      print -P "  dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs,"
1278+      print -P "  qunit, reactjs, smacss, stackoverflow, unheap"
1279+      print -P ""
1280+      print -P "For example: frontend npmjs mocha (or just: npmjs mocha)."
1281+      print -P ""
1282+      return 1
1283   fi
1284 
1285-  # check whether the search engine is supported
1286-  if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow|npmjs)' ]];
1287+  # check whether the search context is supported
1288+  if [[ -z "$urls[$1]" ]]
1289   then
1290-    echo "Search valid search content $1 not supported."
1291-    echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
1292-    echo "* jquery"
1293-    echo "* mdn"
1294-    echo "* compass"
1295-    echo "* html5please"
1296-    echo "* caniuse"
1297-    echo "* aurajs"
1298-    echo "* dartlang"
1299-    echo "* lodash"
1300-    echo "* qunit"
1301-    echo "* fontello"
1302-    echo "* bootsnipp"
1303-    echo "* cssflow"
1304-    echo "* codepen"
1305-    echo "* unheap"
1306-    echo "* bem"
1307-    echo "* smacss"
1308-    echo "* angularjs"
1309-    echo "* reactjs"
1310diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
1311index 8419166abc10b7f05a30fe02d39aa34d3c33cddb..d91c1af81c6391c17249449e8cd5bc554201a73a 100644
1312--- a/plugins/git-extras/git-extras.plugin.zsh
1313+++ b/plugins/git-extras/git-extras.plugin.zsh
1314@@ -3,19 +3,20 @@
1315 # Description
1316 # -----------
1317 #
1318-#  Completion script for git-extras (http://github.com/visionmedia/git-extras).
1319+#  Completion script for git-extras (http://github.com/tj/git-extras).
1320 #
1321 # ------------------------------------------------------------------------------
1322 # Authors
1323 # -------
1324 #
1325 #  * Alexis GRIMALDI (https://github.com/agrimaldi)
1326+#  * spacewander (https://github.com/spacewander)
1327 #
1328 # ------------------------------------------------------------------------------
1329 # Inspirations
1330 # -----------
1331 #
1332-#  * git-extras (http://github.com/visionmedia/git-extras)
1333+#  * git-extras (http://github.com/tj/git-extras)
1334 #  * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
1335 #
1336 # ------------------------------------------------------------------------------
1337@@ -30,10 +31,21 @@ __git_command_successful () {
1338 }
1339 
1340 
1341+__git_commits() {
1342+    declare -A commits
1343+    git log --oneline -15 | sed 's/\([[:alnum:]]\{7\}\) /\1:/' | while read commit
1344+    do
1345+        hash=$(echo $commit | cut -d':' -f1)
1346+        commits[$hash]="$commit"
1347+    done
1348+    local ret=1
1349+    _describe -t commits commit commits && ret=0
1350+}
1351+
1352 __git_tag_names() {
1353     local expl
1354     declare -a tag_names
1355-    tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
1356+    tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
1357     __git_command_successful || return
1358     _wanted tag-names expl tag-name compadd $* - $tag_names
1359 }
1360@@ -47,31 +59,27 @@ __git_branch_names() {
1361     _wanted branch-names expl branch-name compadd $* - $branch_names
1362 }
1363 
1364-
1365-__git_feature_branch_names() {
1366+__git_specific_branch_names() {
1367     local expl
1368     declare -a branch_names
1369-    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
1370+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
1371     __git_command_successful || return
1372     _wanted branch-names expl branch-name compadd $* - $branch_names
1373 }
1374 
1375 
1376+__git_feature_branch_names() {
1377+    __git_specific_branch_names 'feature'
1378+}
1379+
1380+
1381 __git_refactor_branch_names() {
1382-    local expl
1383-    declare -a branch_names
1384-    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
1385-    __git_command_successful || return
1386-    _wanted branch-names expl branch-name compadd $* - $branch_names
1387+    __git_specific_branch_names 'refactor'
1388 }
1389 
1390 
1391 __git_bug_branch_names() {
1392-    local expl
1393-    declare -a branch_names
1394-    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
1395-    __git_command_successful || return
1396-    _wanted branch-names expl branch-name compadd $* - $branch_names
1397+    __git_specific_branch_names 'bug'
1398 }
1399 
1400 
1401@@ -92,19 +100,43 @@ __git_author_names() {
1402     _wanted author-names expl author-name compadd $* - $author_names
1403 }
1404 
1405+# subcommands
1406 
1407-_git-changelog() {
1408-    _arguments \
1409-        '(-l --list)'{-l,--list}'[list commits]' \
1410+_git-bug() {
1411+    local curcontext=$curcontext state line ret=1
1412+    declare -A opt_args
1413+
1414diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
1415index e59265d664fa6f0022c52d2791bcf78a84d2b793..de95f7e6c0824a736fccdcb8fa4f23a576db6823 100644
1416--- a/plugins/gnu-utils/gnu-utils.plugin.zsh
1417+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
1418@@ -29,7 +29,10 @@ if [[ -x "${commands[gwhoami]}" ]]; then
1419     'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
1420     'gwhoami' 'gyes')
1421 
1422-    # Not part of coreutils, installed separately.
1423+    # findutils
1424+    gcmds+=('gfind' 'gxargs' 'glocate')
1425+
1426+    # Not part of either coreutils or findutils, installed separately.
1427     gcmds+=('gsed' 'gtar' 'gtime')
1428 
1429     for gcmd in "${gcmds[@]}"; do
1430diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
1431index 900fc630dbe3c346ea014588ad854d3f97c80864..1ce3cea58e861e6540509143d1e3f1913056177e 100644
1432--- a/plugins/golang/golang.plugin.zsh
1433+++ b/plugins/golang/golang.plugin.zsh
1434@@ -54,23 +54,42 @@ __go_tool_complete() {
1435     '-installsuffix[suffix to add to package directory]:suffix'
1436     '-tags[list of build tags to consider satisfied]:tags'
1437   )
1438-  __go_list() {
1439-      local expl importpaths
1440-      declare -a importpaths
1441-      importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
1442-      _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
1443+  __go_packages() {
1444+      local gopaths
1445+      declare -a gopaths
1446+      gopaths=("${(s/:/)$(go env GOPATH)}")
1447+      gopaths+=("$(go env GOROOT)")
1448+      for p in $gopaths; do
1449+        _path_files -W "$p/src" -/
1450+      done
1451+  }
1452+  __go_identifiers() {
1453+      compadd $(godoc -templates $ZSH/plugins/golang/templates ${words[-2]} 2> /dev/null)
1454   }
1455   case ${words[2]} in
1456-  clean|doc)
1457-      _arguments -s -w : '*:importpaths:__go_list'
1458+  doc)
1459+    _arguments -s -w \
1460+      "-c[symbol matching honors case (paths not affected)]" \
1461+      "-cmd[show symbols with package docs even if package is a command]" \
1462+      "-u[show unexported symbols as well as exported]" \
1463+      "2:importpaths:__go_packages" \
1464+      ":next identifiers:__go_identifiers"
1465+      ;;
1466+  clean)
1467+    _arguments -s -w \
1468+      "-i[remove the corresponding installed archive or binary (what 'go install' would create)]" \
1469+      "-n[print the remove commands it would execute, but not run them]" \
1470+      "-r[apply recursively to all the dependencies of the packages named by the import paths]" \
1471+      "-x[print remove commands as it executes them]" \
1472+      "*:importpaths:__go_packages"
1473       ;;
1474   fix|fmt|list|vet)
1475-      _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
1476+      _alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"'
1477       ;;
1478   install)
1479       _arguments -s -w : ${build_flags[@]} \
1480         "-v[show package names]" \
1481-        '*:importpaths:__go_list'
1482+        '*:importpaths:__go_packages'
1483       ;;
1484   get)
1485       _arguments -s -w : \
1486@@ -81,7 +100,7 @@ __go_tool_complete() {
1487         ${build_flags[@]} \
1488         "-v[show package names]" \
1489         "-o[output file]:file:_files" \
1490-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1491+        "*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
1492       ;;
1493   test)
1494       _arguments -s -w : \
1495@@ -103,7 +122,7 @@ __go_tool_complete() {
1496         "-cpuprofile[write CPU profile to file]:file:_files" \
1497         "-memprofile[write heap profile to file]:file:_files" \
1498         "-memprofilerate[set heap profiling rate]:number" \
1499-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1500+        "*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
1501       ;;
1502   help)
1503       _values "${commands[@]}" \
1504diff --git a/plugins/golang/templates/package.txt b/plugins/golang/templates/package.txt
1505new file mode 100644
1506index 0000000000000000000000000000000000000000..2b75cce35d43b2cf93883d9c278a104b1bde71b0
1507--- /dev/null
1508+++ b/plugins/golang/templates/package.txt
1509@@ -0,0 +1,29 @@
1510+{{with .PDoc}}{{/*
1511+
1512+Constants 
1513+---------------------------------------
1514+
1515+*/}}{{with .Consts}}{{range .}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{/*
1516+
1517+Variables
1518+---------------------------------------
1519+
1520+*/}}{{with .Vars}}{{range .}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{/*
1521+
1522+Functions
1523+---------------------------------------
1524+
1525+*/}}{{with .Funcs}}{{range .}}{{ .Name }} {{end}}{{end}}{{/*
1526+
1527+Types
1528+---------------------------------------
1529+
1530+*/}}{{with .Types}}{{range .}}{{ $TypeName := .Name }}{{ $TypeName }} {{/*
1531+
1532+*/}}{{range .Methods}}{{ $TypeName }}.{{.Name}} {{end}}{{/*
1533+
1534+*/}}{{range .Funcs}}{{.Name}} {{end}}{{/*
1535+
1536+*/}}{{range .Consts}}{{range .Names}}{{.}} {{end}}{{end}}{{/*
1537+
1538+*/}}{{range .Vars}}{{range .Names}}{{.}} {{end}}{{end}}{{end}}{{end}}{{end}}
1539diff --git a/plugins/golang/templates/search.txt b/plugins/golang/templates/search.txt
1540new file mode 100644
1541index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
1542--- /dev/null
1543+++ b/plugins/golang/templates/search.txt
1544diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
1545index 6f634d1baa4320bfbd08a70443d04a1a65cdda18..97941756d653d860d9506b4981bd81009e64295c 100644
1546--- a/plugins/gradle/gradle.plugin.zsh
1547+++ b/plugins/gradle/gradle.plugin.zsh
1548@@ -82,7 +82,7 @@ _gradlew_tasks () {
1549   if [ in_gradle ]; then
1550     _gradle_arguments
1551     if _gradle_does_task_list_need_generating; then
1552-     gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1553+     ./gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9:]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1554     fi
1555     compadd -X "==== Gradlew Tasks ====" `cat .gradletasknamecache`
1556   fi
1557diff --git a/plugins/gulp/gulp.plugin.zsh b/plugins/gulp/gulp.plugin.zsh
1558new file mode 100644
1559index 0000000000000000000000000000000000000000..6017c7b6023a5e5e9987e54af0d1c3fc278725b2
1560--- /dev/null
1561+++ b/plugins/gulp/gulp.plugin.zsh
1562@@ -0,0 +1,29 @@
1563+#!/usr/bin/env zsh
1564+
1565+#
1566+# gulp-autocompletion-zsh
1567+# 
1568+# Autocompletion for your gulp.js tasks
1569+#
1570+# Copyright(c) 2014 André König <andre.koenig@posteo.de>
1571+# MIT Licensed
1572+# 
1573+
1574+#
1575+# André König
1576+# Github: https://github.com/akoenig
1577+# Twitter: https://twitter.com/caiifr
1578+#
1579+
1580+#
1581+# Grabs all available tasks from the `gulpfile.js`
1582+# in the current directory.
1583+#
1584+function $$gulp_completion() {
1585+    compls=$(grep -Eo "gulp.task\(('(([a-zA-Z0-9]|-)*)',)" gulpfile.js 2>/dev/null | grep -Eo "'(([a-zA-Z0-9]|-)*)'" | sed s/"'"//g | sort)
1586+
1587+    completions=(${=compls})
1588+    compadd -- $completions
1589+}
1590+
1591+compdef $$gulp_completion gulp
1592diff --git a/plugins/jira/README.md b/plugins/jira/README.md
1593new file mode 100644
1594index 0000000000000000000000000000000000000000..efb8a743a6e6c4d07c01f9ab79075c89d7de5a17
1595--- /dev/null
1596+++ b/plugins/jira/README.md
1597@@ -0,0 +1,64 @@
1598+#  Jira plugin  #
1599+
1600+CLI support for JIRA interaction
1601+
1602+##  Description  ##
1603+
1604+This plugin provides command line tools for interacting with Atlassian's [JIRA](https://www.atlassian.com/software/jira) bug tracking software.
1605+
1606+The interaction is all done through the web. No local installation of JIRA is necessary.
1607+
1608+In this document, "JIRA" refers to the JIRA issue tracking server, and `jira` refers to the command this plugin supplies.
1609+
1610+##  Usage  ##
1611+
1612+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.
1613+
1614+```
1615+jira            # performs the default action
1616+
1617+jira new        # opens a new issue
1618+jira dashboard  # opens your JIRA dashboard
1619+jira reported [username]  # queries for issues reported by a user
1620+jira assigned [username]  # queries for issues assigned to a user
1621+jira ABC-123    # opens an existing issue
1622+jira ABC-123 m  # opens an existing issue for adding a comment
1623+```
1624+
1625+#### Debugging usage  ####
1626+
1627+These calling forms are for developers' use, and may change at any time.
1628+
1629+```
1630+jira dumpconfig   # displays the effective configuration
1631+```
1632+
1633+##  Setup  ##
1634+
1635+The URL for your JIRA instance is set by `$JIRA_URL` or a `.jira_url` file.
1636+
1637+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.
1638+
1639+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.
1640+
1641+For example:
1642+
1643+```
1644+cd to/my/project
1645+echo "https://jira.atlassian.com" >> .jira-url
1646+```
1647+
1648diff --git a/plugins/jira/_jira b/plugins/jira/_jira
1649index b0ea658e2f3ac23079fb19166509667407741ae2..03fe6a4993fb1a92a2fb0fad73c56f03d3453cc7 100644
1650--- a/plugins/jira/_jira
1651+++ b/plugins/jira/_jira
1652@@ -7,6 +7,7 @@ _1st_arguments=(
1653   'dashboard:open the dashboard'
1654   'reported:search for issues reported by a user'
1655   'assigned:search for issues assigned to a user'
1656+  'dumpconfig:display effective jira configuration'
1657 )
1658 
1659 _arguments -C \
1660diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
1661index 89559767f86b684ea0e47a69ea363e94acf11d12..341e23ec0e5cc42ea7d0bf28ef0abc05425998d5 100644
1662--- a/plugins/jira/jira.plugin.zsh
1663+++ b/plugins/jira/jira.plugin.zsh
1664@@ -1,35 +1,11 @@
1665 # CLI support for JIRA interaction
1666 #
1667-# Setup: 
1668-#   Add a .jira-url file in the base of your project
1669-#   You can also set $JIRA_URL in your .zshrc or put .jira-url in your home directory
1670-#   A .jira-url in the current directory takes precedence. 
1671-#   The same goes with .jira-prefix and $JIRA_PREFIX.
1672-#
1673-#   For example:
1674-#     cd to/my/project
1675-#     echo "https://name.jira.com" >> .jira-url
1676-#
1677-# Variables:
1678-#  $JIRA_RAPID_BOARD     - set to "true" if you use Rapid Board
1679-#  $JIRA_DEFAULT_ACTION  - action to do when `jira` is called witn no args
1680-#                          defaults to "new"
1681-#  $JIRA_NAME            - Your JIRA username. Used as default for assigned/reported
1682-#  $JIRA_PREFIX          - Prefix added to issue ID arguments
1683-#
1684-#
1685-# Usage: 
1686-#   jira            # Performs the default action
1687-#   jira new        # opens a new issue
1688-#   jira reported [username]
1689-#   jira assigned [username]
1690-#   jira dashboard
1691-#   jira ABC-123    # Opens an existing issue
1692-#   jira ABC-123 m  # Opens an existing issue for adding a comment
1693+# See README.md for details
1694 
1695 : ${JIRA_DEFAULT_ACTION:=new}
1696 
1697 function jira() {
1698+  emulate -L zsh
1699   local action=${1:=$JIRA_DEFAULT_ACTION}
1700 
1701   local jira_url jira_prefix
1702@@ -63,6 +39,12 @@ function jira() {
1703   elif [[ "$action" == "dashboard" ]]; then
1704     echo "Opening dashboard"
1705     open_command "${jira_url}/secure/Dashboard.jspa"
1706+  elif [[ "$action" == "dumpconfig" ]]; then
1707+    echo "JIRA_URL=$jira_url"
1708+    echo "JIRA_PREFIX=$jira_prefix"
1709+    echo "JIRA_NAME=$JIRA_NAME"
1710+    echo "JIRA_RAPID_BOARD=$JIRA_RAPID_BOARD"
1711+    echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
1712   else
1713     # Anything that doesn't match a special action is considered an issue name
1714     local issue_arg=$action
1715@@ -84,15 +66,17 @@ function jira() {
1716 
1717 function _jira_url_help() {
1718   cat << EOF
1719-JIRA url is not specified anywhere.
1720+error: JIRA URL is not specified anywhere.
1721+
1722 Valid options, in order of precedence:
1723   .jira-url file
1724   \$HOME/.jira-url file
1725-  JIRA_URL environment variable
1726+  \$JIRA_URL environment variable
1727 EOF
1728 }
1729 
1730 function _jira_query() {
1731+  emulate -L zsh
1732   local verb="$1"
1733   local jira_name lookup preposition query
1734   if [[ "${verb}" == "reported" ]]; then
1735@@ -102,12 +86,12 @@ function _jira_query() {
1736     lookup=assignee
1737     preposition=to
1738   else
1739-    echo "not a valid lookup: $verb" >&2
1740+    echo "error: not a valid lookup: $verb" >&2
1741     return 1
1742   fi
1743   jira_name=${2:=$JIRA_NAME}
1744   if [[ -z $jira_name ]]; then
1745-    echo "JIRA_NAME not specified" >&2
1746+    echo "error: JIRA_NAME not specified" >&2
1747     return 1
1748   fi
1749 
1750diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
1751index 68ec5fabd2fd5601d1cd4e43ecd7889660002170..595105d3c1c2355a23c571f4d7ae4e4103220d9b 100644
1752--- a/plugins/npm/npm.plugin.zsh
1753+++ b/plugins/npm/npm.plugin.zsh
1754@@ -12,3 +12,6 @@ alias npmS="npm i -S "
1755 # Install and save to dev-dependencies in your package.json
1756 # npmd is used by https://github.com/dominictarr/npmd
1757 alias npmD="npm i -D "
1758+# Execute command from node_modules folder based on current directory
1759+# i.e npmE gulp
1760+alias npmE='PATH="$(npm bin)":"$PATH"'
1761diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
1762index 390960fdcc162c6701fe0c066772f32d75460bb8..2cbb95977af17c2bc88a731b8e1e711e2139c860 100644
1763--- a/plugins/osx/osx.plugin.zsh
1764+++ b/plugins/osx/osx.plugin.zsh
1765@@ -5,29 +5,35 @@
1766 #       VERSION:  1.1.0
1767 # ------------------------------------------------------------------------------
1768 
1769-function tab() {
1770-  local command="cd \\\"$PWD\\\"; clear"
1771-  (( $# > 0 )) && command="${command}; $*"
1772-
1773-  the_app=$(
1774+function _omz_osx_get_frontmost_app() {
1775+  local the_app=$(
1776     osascript 2>/dev/null <<EOF
1777       tell application "System Events"
1778         name of first item of (every process whose frontmost is true)
1779       end tell
1780 EOF
1781   )
1782+  echo "$the_app"
1783+}
1784 
1785-  [[ "$the_app" == 'Terminal' ]] && {
1786-    osascript 2>/dev/null <<EOF
1787+function tab() {
1788+  # Must not have trailing semicolon, for iTerm compatibility
1789+  local command="cd \\\"$PWD\\\"; clear"
1790+  (( $# > 0 )) && command="${command}; $*"
1791+
1792+  local the_app=$(_omz_osx_get_frontmost_app)
1793+
1794+  if [[ "$the_app" == 'Terminal' ]]; then
1795+    # Discarding stdout to quash "tab N of window id XXX" output
1796+    osascript >/dev/null <<EOF
1797       tell application "System Events"
1798         tell process "Terminal" to keystroke "t" using command down
1799-        tell application "Terminal" to do script "${command}" in front window
1800       end tell
1801+      tell application "Terminal" to do script "${command}" in front window
1802 EOF
1803-  }
1804 
1805-  [[ "$the_app" == 'iTerm' ]] && {
1806-    osascript 2>/dev/null <<EOF
1807+  elif [[ "$the_app" == 'iTerm' ]]; then
1808+    osascript <<EOF
1809       tell application "iTerm"
1810         set current_terminal to current terminal
1811         tell current_terminal
1812@@ -35,29 +41,27 @@ EOF
1813           set current_session to current session
1814           tell current_session
1815             write text "${command}"
1816-            keystroke return
1817           end tell
1818         end tell
1819       end tell
1820 EOF
1821-  }
1822+
1823+  else
1824+    echo "tab: unsupported terminal app: $the_app"
1825+    false
1826+
1827+  fi
1828 }
1829 
1830 function vsplit_tab() {
1831-  local command="cd \\\"$PWD\\\""
1832+  local command="cd \\\"$PWD\\\"; clear"
1833   (( $# > 0 )) && command="${command}; $*"
1834 
1835-  the_app=$(
1836-    osascript 2>/dev/null <<EOF
1837-      tell application "System Events"
1838-        name of first item of (every process whose frontmost is true)
1839-      end tell
1840-EOF
1841-  )
1842+  local the_app=$(_omz_osx_get_frontmost_app)
1843 
1844-  [[ "$the_app" == 'iTerm' ]] && {
1845-    osascript 2>/dev/null <<EOF
1846-      tell application "iTerm" to activate
1847+  if [[ "$the_app" == 'iTerm' ]]; then
1848+    osascript <<EOF
1849+      -- tell application "iTerm" to activate
1850 
1851       tell application "System Events"
1852         tell process "iTerm"
1853@@ -65,26 +69,24 @@ EOF
1854             click
1855           end tell
1856         end tell
1857-        keystroke "${command}; clear;"
1858-        keystroke return
1859+        keystroke "${command} \n"
1860       end tell
1861 EOF
1862-  }
1863+
1864+  else
1865diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
1866index 6824836fc6c5c6502691d2618381d0591a90b765..39e38849450aac75951e0ceaffbc685cdb9bfaba 100644
1867--- a/plugins/rails/rails.plugin.zsh
1868+++ b/plugins/rails/rails.plugin.zsh
1869@@ -54,10 +54,12 @@ alias rdrs='rake db:reset'
1870 alias rdtc='rake db:test:clone'
1871 alias rdtp='rake db:test:prepare'
1872 alias rdmtc='rake db:migrate db:test:clone'
1873-
1874 alias rlc='rake log:clear'
1875 alias rn='rake notes'
1876 alias rr='rake routes'
1877+alias rrg='rake routes | grep'
1878+alias rt='rake test'
1879+
1880 
1881 # legacy stuff
1882 alias sstat='thin --stats "/thin/stats" start'
1883diff --git a/plugins/scw/README.md b/plugins/scw/README.md
1884new file mode 100644
1885index 0000000000000000000000000000000000000000..d2312c2e5cba0ead32f1459ed5ed574b81e14bc5
1886--- /dev/null
1887+++ b/plugins/scw/README.md
1888@@ -0,0 +1,7 @@
1889+## Scaleway CLI autocomplete plugin
1890+
1891+[scw](https://github.com/scaleway/scaleway-cli): Manage Bare Metal servers from Command Line (as easily as with Docker)
1892+
1893+- Adds autocomplete options for all `scw` commands.
1894+
1895+Maintainer : Manfred Touron ([@moul](https://github.com/moul))
1896diff --git a/plugins/scw/_scw b/plugins/scw/_scw
1897new file mode 100644
1898index 0000000000000000000000000000000000000000..f9fdf916e761728b398f7ed04f0399457d419026
1899--- /dev/null
1900+++ b/plugins/scw/_scw
1901@@ -0,0 +1,333 @@
1902+#compdef scw
1903+#
1904+# zsh completion for scw (http://scaleway.com)
1905+#
1906+# Inspired by https://github.com/felixr/docker-zsh-completion
1907+
1908+__scw_get_servers() {
1909+    local expl
1910+    declare -a servers
1911+    servers=(${(f)"$(_call_program commands scw _completion servers-names)"})
1912+    _describe -t servers "servers" servers
1913+}
1914+
1915+__scw_stoppedservers() {
1916+    __scw_get_servers
1917+}
1918+
1919+__scw_runningservers() {
1920+    __scw_get_servers
1921+}
1922+
1923+__scw_servers () {
1924+    __scw_get_servers
1925+}
1926+
1927+__scw_images () {
1928+    local expl
1929+    declare -a images
1930+    images=(${(f)"$(_call_program commands scw _completion images-names)"})
1931+    _describe -t images "images" images
1932+}
1933+
1934+__scw_images_and_snapshots () {
1935+    __scw_images
1936+    __scw_snapshots
1937+}
1938+
1939+__scw_snapshots () {
1940+    local expl
1941+    declare -a snapshots
1942+    snapshots=(${(f)"$(_call_program commands scw _completion --prefix snapshots-names)"})
1943+    _describe -t snapshots "snapshots" snapshots
1944+}
1945+
1946+__scw_bootscripts () {
1947+    local expl
1948+    declare -a bootscripts
1949+    bootscripts=(${(f)"$(_call_program commands scw _completion bootscripts-names)"})
1950+    _describe -t bootscripts "bootscripts" bootscripts
1951+}
1952+
1953+__scw_tags() {
1954+    __scw_images
1955+}
1956+
1957+__scw_repositories_with_tags() {
1958+    __scw_images
1959+}
1960+
1961+__scw_search() {
1962+    # declare -a scwsearch
1963+    local cache_policy
1964+    zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
1965+    if [[ -z "$cache_policy" ]]; then
1966+        zstyle ":completion:${curcontext}:" cache-policy __scw_caching_policy
1967+    fi
1968+
1969+    local searchterm cachename
1970+    searchterm="${words[$CURRENT]%/}"
1971+    cachename=_scw-search-$searchterm
1972+
1973+    local expl
1974+    local -a result
1975+    if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \
1976+        && ! _retrieve_cache ${cachename#_}; then
1977+        _message "Searching for ${searchterm}..."
1978+        result=(${${${(f)"$(_call_program commands scw search ${searchterm})"}%% *}[2,-1]})
1979+        _store_cache ${cachename#_} result
1980+    fi
1981+    _wanted scwsearch expl 'available images' compadd -a result
1982+}
1983+
1984+__scw_caching_policy()
1985+{
1986+  oldp=( "$1"(Nmh+1) )     # 1 hour
1987+  (( $#oldp ))
1988+}
1989+
1990+
1991+__scw_repositories () {
1992+    __scw_images
1993+}
1994+
1995+__scw_commands () {
1996+    # local -a  _scw_subcommands
1997+    local cache_policy
1998+
1999+    zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
2000+    if [[ -z "$cache_policy" ]]; then
2001diff --git a/plugins/stack/stack.plugin.zsh b/plugins/stack/stack.plugin.zsh
2002new file mode 100644
2003index 0000000000000000000000000000000000000000..a149208d0ab364ded6ce46c1ed19da75597737d9
2004--- /dev/null
2005+++ b/plugins/stack/stack.plugin.zsh
2006@@ -0,0 +1,37 @@
2007+function _stack_commands() {
2008+    local ret=1 state
2009+    _arguments ':subcommand:->subcommand' && ret=0
2010+
2011+    case $state in
2012+      subcommand)
2013+        subcommands=(
2014+          "build:Build the project(s) in this directory/configuration"
2015+          "install:Build executables and install to a user path"
2016+          "test:Build and test the project(s) in this directory/configuration"
2017+          "bench:Build and benchmark the project(s) in this directory/configuration"
2018+          "haddock:Generate haddocks for the project(s) in this directory/configuration"
2019+          "new:Create a brand new project"
2020+          "init:Initialize a stack project based on one or more stack packages"
2021+          "solver:Use a dependency solver to try and determine missing extra-deps"
2022+          "setup:Get the appropriate ghc for your project"
2023+          "path:Print out handy path information"
2024+          "unpack:Unpack one or more packages locally"
2025+          "update:Update the package index"
2026+          "upgrade:Upgrade to the latest stack (experimental)"
2027+          "upload:Upload a package to Hackage"
2028+          "dot:Visualize your project's dependency graph using Graphviz dot"
2029+          "exec:Execute a command"
2030+          "ghc:Run ghc"
2031+          "ghci:Run ghci in the context of project(s)"
2032+          "ide:Run ide-backend-client with the correct arguments"
2033+          "runghc:Run runghc"
2034+          "clean:Clean the local packages"
2035+          "docker:Subcommands specific to Docker use"
2036+        )
2037+        _describe -t subcommands 'stack subcommands' subcommands && ret=0
2038+    esac
2039+
2040+    return ret
2041+}
2042+
2043+compdef _stack_commands stack
2044diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
2045index e3ba39918af9345bb04801bb2c5dc5c6704d99b0..0ba8bed5be790fb1daf2749da215d275bf71add3 100644
2046--- a/plugins/sudo/sudo.plugin.zsh
2047+++ b/plugins/sudo/sudo.plugin.zsh
2048@@ -14,7 +14,11 @@
2049 
2050 sudo-command-line() {
2051     [[ -z $BUFFER ]] && zle up-history
2052-    [[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
2053+    if [[ $BUFFER == sudo\ * ]]; then
2054+        LBUFFER="${LBUFFER#sudo }"
2055+    else
2056+        LBUFFER="sudo $LBUFFER"
2057+    fi
2058 }
2059 zle -N sudo-command-line
2060 # Defined shortcut keys: [Esc] [Esc]
2061diff --git a/plugins/svn/svn.plugin.zsh b/plugins/svn/svn.plugin.zsh
2062index 9f7a4c6eb4721c57b5f6c1b710a052b494248dc9..816055afe956311ee22ca2b564bb7eb521b3a526 100644
2063--- a/plugins/svn/svn.plugin.zsh
2064+++ b/plugins/svn/svn.plugin.zsh
2065@@ -1,16 +1,17 @@
2066 # vim:ft=zsh ts=2 sw=2 sts=2
2067 #
2068 function svn_prompt_info() {
2069+  local _DISPLAY
2070   if in_svn; then
2071     if [ "x$SVN_SHOW_BRANCH" = "xtrue" ]; then
2072       unset SVN_SHOW_BRANCH
2073       _DISPLAY=$(svn_get_branch_name)
2074     else
2075       _DISPLAY=$(svn_get_repo_name)
2076+      _DISPLAY=$(omz_urldecode "${_DISPLAY}")
2077     fi
2078     echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
2079 $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"
2080-    unset _DISPLAY
2081   fi
2082 }
2083 
2084@@ -30,7 +31,7 @@ function svn_get_repo_name() {
2085 }
2086 
2087 function svn_get_branch_name() {
2088-  _DISPLAY=$(
2089+  local _DISPLAY=$(
2090     svn info 2> /dev/null | \
2091       awk -F/ \
2092       '/^URL:/ { \
2093@@ -49,7 +50,6 @@ function svn_get_branch_name() {
2094   else
2095     echo $_DISPLAY
2096   fi
2097-  unset _DISPLAY
2098 }
2099 
2100 function svn_get_rev_nr() {
2101@@ -60,7 +60,7 @@ function svn_get_rev_nr() {
2102 
2103 function svn_dirty_choose() {
2104   if in_svn; then
2105-    root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
2106+    local root=`svn info 2> /dev/null | sed -n 's/^Working Copy Root Path: //p'`
2107     if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
2108       # Grep exits with 0 when "One or more lines were selected", return "dirty".
2109       echo $1
2110@@ -77,7 +77,7 @@ function svn_dirty() {
2111 
2112 function svn_dirty_choose_pwd () {
2113   if in_svn; then
2114-    root=$PWD
2115+    local root=$PWD
2116     if $(svn status $root 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'); then
2117       # Grep exits with 0 when "One or more lines were selected", return "dirty".
2118       echo $1
2119diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
2120index 4ae70dfa751dc124c3cb47b83eb1f6c57c34b203..8c26333558987b8f9498e2de713bc7fefca8befc 100644
2121--- a/plugins/systemadmin/systemadmin.plugin.zsh
2122+++ b/plugins/systemadmin/systemadmin.plugin.zsh
2123@@ -140,12 +140,16 @@ d0() {
2124 
2125 # gather external ip address
2126 geteip() {
2127-    curl http://ifconfig.me
2128+    curl -s -S https://icanhazip.com
2129 }
2130 
2131 # determine local IP address
2132 getip() {
2133-    ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
2134+    if (( ${+commands[ip]} )); then
2135+        ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}'
2136+    else
2137+        ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
2138+    fi
2139 }
2140 
2141 # Clear zombie processes
2142diff --git a/plugins/taskwarrior/README.md b/plugins/taskwarrior/README.md
2143new file mode 100644
2144index 0000000000000000000000000000000000000000..053151e78c98cdecfcabd1c2c46b7bec5b169eb1
2145--- /dev/null
2146+++ b/plugins/taskwarrior/README.md
2147@@ -0,0 +1,13 @@
2148+# taskwarrior
2149+
2150+This plugin adds smart tab completion for [TaskWarrior](http://taskwarrior.org/).
2151+It uses the zsh tab completion script (`_task`) shipped with TaskWarrior for the
2152+completion definitions.
2153+
2154+The latest version pulled in from the official project is of January 1st, 2015.
2155+
2156+
2157+## Examples
2158+
2159+Typing `task [TAB]` will give you a list of commands, `task 66[TAB]` shows a
2160+list of available modifications for that task, etcetera.
2161diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
2162index 5cc2531526e051022dcb3b411bc8a342103eb127..afa30d45a14991d459056c0d2cecd187c568c933 100644
2163--- a/plugins/taskwarrior/_task
2164+++ b/plugins/taskwarrior/_task
2165@@ -1,9 +1,6 @@
2166 #compdef task
2167-# zsh completion for taskwarrior
2168 #
2169-# taskwarrior - a command line task list manager.
2170-#
2171-# Copyright 2010 - 2011 Johannes Schlatow
2172+# Copyright 2010 - 2015 Johannes Schlatow
2173 # Copyright 2009 P.C. Shyamshankar
2174 #
2175 # Permission is hereby granted, free of charge, to any person obtaining a copy
2176@@ -30,31 +27,40 @@ typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
2177 _task_projects=($(task _projects))
2178 _task_tags=($(task _tags))
2179 _task_ids=($(task _ids))
2180+_task_zshids=( ${(f)"$(task _zshids)"} )
2181 _task_config=($(task _config))
2182 _task_columns=($(task _columns))
2183 _task_modifiers=(
2184-	'before' \
2185-	'after' \
2186-	'none' \
2187-	'any' \
2188-	'is' \
2189-	'isnt' \
2190-	'has' \
2191-	'hasnt' \
2192-	'startswith' \
2193-	'endswith' \
2194-	'word' \
2195-	'noword'
2196+  'before' \
2197+  'after' \
2198+  'none' \
2199+  'any' \
2200+  'is' \
2201+  'isnt' \
2202+  'has' \
2203+  'hasnt' \
2204+  'startswith' \
2205+  'endswith' \
2206+  'word' \
2207+  'noword'
2208 )
2209 _task_conjunctions=(
2210-   'and' \
2211-   'or' \
2212-	'xor' \
2213-	'\)'
2214-	'\('
2215+  'and' \
2216+  'or' \
2217+  'xor' \
2218+  '\)' \
2219+  '\(' \
2220+  '<' \
2221+  '<=' \
2222+  '=' \
2223+  '!=' \
2224+  '>=' \
2225+  '>'
2226 )
2227-_task_cmds=($(task _commands))
2228-_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
2229+_task_cmds=($(task _commands; task _aliases))
2230+_task_zshcmds=( ${(f)"$(task _zshcommands)"} sentinel:sentinel:sentinel )
2231+
2232+_task_aliases=($(task _aliases))
2233 
2234 _task() {
2235     _arguments -s -S \
2236@@ -68,110 +74,130 @@ word=$'[^\0]#\0'
2237 # priorities
2238 local -a task_priorities
2239 _regex_words values 'task priorities' \
2240-	'H:High' \
2241-	'M:Middle' \
2242-	'L:Low'
2243+  'H:High' \
2244+  'M:Middle' \
2245+  'L:Low'
2246 task_priorities=("$reply[@]")
2247 
2248 # projects
2249 local -a task_projects
2250 task_projects=(
2251-	/"$word"/
2252-	":values:task projects:compadd -a _task_projects"
2253+  /"$word"/
2254+  ":values:task projects:compadd -a _task_projects"
2255 )
2256 
2257 local -a _task_dates
2258 _regex_words values 'task dates' \
2259-	'tod*ay:Today' \
2260-	'yes*terday:Yesterday' \
2261-	'tom*orrow:Tomorrow' \
2262-	'sow:Start of week' \
2263-	'soww:Start of work week' \
2264-	'socw:Start of calendar week' \
2265diff --git a/plugins/taskwarrior/taskwarrior.plugin.zsh b/plugins/taskwarrior/taskwarrior.plugin.zsh
2266index 5d1e6ffea23fabfa87ae3d3e2f81dd1082d85684..ab885943f14d72b569ecb8e38ebb8ade0d51d7d2 100644
2267--- a/plugins/taskwarrior/taskwarrior.plugin.zsh
2268+++ b/plugins/taskwarrior/taskwarrior.plugin.zsh
2269@@ -1,17 +1,3 @@
2270-################################################################################
2271-# Author: Pete Clark
2272-# Email: pete[dot]clark[at]gmail[dot]com
2273-# Version: 0.1 (05/24/2011)
2274-# License: WTFPL<http://sam.zoy.org/wtfpl/>
2275-#
2276-# This oh-my-zsh plugin adds smart tab completion for
2277-# TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion
2278-# script (_task) distributed with TaskWarrior for the completion definitions.
2279-#
2280-# Typing task [tabtab] will give you a list of current tasks, task 66[tabtab]
2281-# gives a list of available modifications for that task, etc.
2282-################################################################################
2283-
2284 zstyle ':completion:*:*:task:*' verbose yes
2285 zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u'
2286