3ad138a08aa3de1246cffde0b7187ffcd017298c

Author
Henry Yan <yanhonglei@gmail.com>
Committer
Henry Yan <yanhonglei@gmail.com>
Date

Message

Merge remote-tracking branch 'upstream/master'

* upstream/master: (35 commits)
  make README reflect latest changes
  URL Tools Plugin
  added a comment to the composer installation alias
  added Composer completition and aliases
  added two aliases to Symfony2 Plugin
  fix test aliases
  Missing comment line
  look for test/unit instead of test/units. #typo
  Correct error message.
  Clean up doc
  Jira ticket shortcut to browse existing issues or create a new issue.
  Add zeus plugin
  Make rvm prompt function a bit cleaner
  Fixing the rvm_prompt_info command, now it will not show empty parens if no rvm is currently being used
  Add link to gist
  Updated documentation for agnoster theme
  Use HISTFILE evironment variable directly rather than copying it
  added autojump plugin support for mac os x + port
  Colemak plugin
  Per directory history plugin
  ...

Diff

This diff is truncated to protect this page.

  1diff --git a/lib/rvm.zsh b/lib/rvm.zsh
  2index 597be1b33b2076c267b202527909f6e896c099bd..cb870a9bbca96bfa1f3a1d795510daf1ef7c63b4 100644
  3--- a/lib/rvm.zsh
  4+++ b/lib/rvm.zsh
  5@@ -1,7 +1,5 @@
  6 # get the name of the branch we are on
  7 function rvm_prompt_info() {
  8   ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return
  9-  echo "($ruby_version)"
 10+  [[ ! -z $ruby_version ]] && echo "($ruby_version)"
 11 }
 12-
 13-
 14diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
 15index 6f0edb062ac60bba4abc7b5fe84962ba286f8dee..d367863b86f2baff8892278b06259370e0f02164 100644
 16--- a/plugins/autojump/autojump.plugin.zsh
 17+++ b/plugins/autojump/autojump.plugin.zsh
 18@@ -3,6 +3,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
 19     . /usr/share/autojump/autojump.zsh
 20   elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
 21     . /etc/profile.d/autojump.zsh
 22+  elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
 23+    . /opt/local/etc/profile.d/autojump.zsh
 24   elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
 25     . `brew --prefix`/etc/autojump
 26   fi
 27diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 28index 1ca48089e17848c3fadaa76b23566b801bd19e24..2305c49796f58b4ae2e5b79943245f83b0e06448 100644
 29--- a/plugins/bundler/bundler.plugin.zsh
 30+++ b/plugins/bundler/bundler.plugin.zsh
 31@@ -6,7 +6,7 @@ alias bu="bundle update"
 32 
 33 # The following is based on https://github.com/gma/bundler-exec
 34 
 35-bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
 36+bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma)
 37 
 38 ## Functions
 39 
 40diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh
 41index 8336182d5d8692f609b04d0c9c9c385fc6de5367..d22d104017ecdddad5b670d1188140e6c39f2672 100644
 42--- a/plugins/cap/cap.plugin.zsh
 43+++ b/plugins/cap/cap.plugin.zsh
 44@@ -1,8 +1,30 @@
 45-function _cap_does_task_list_need_generating () {
 46-  if [ ! -f .cap_tasks~ ]; then return 0;
 47+stat -f%m . > /dev/null 2>&1
 48+if [ "$?" = 0 ]; then
 49+  stat_cmd=(stat -f%m)
 50+else
 51+  stat_cmd=(stat -L --format=%y)
 52+fi
 53+
 54+# Cache filename
 55+_cap_show_undescribed_tasks=0
 56+
 57+# Cache filename
 58+_cap_task_cache_file='.cap_task_cache'
 59+
 60+_cap_get_task_list () {
 61+  if [ ${_cap_show_undescribed_tasks} -eq 0 ]; then
 62+    cap -T | grep '^cap' | cut -d " " -f 2
 63+  else
 64+    cap -vT | grep '^cap' | cut -d " " -f 2
 65+  fi
 66+}
 67+
 68+_cap_does_task_list_need_generating () {
 69+
 70+  if [ ! -f ${_cap_task_cache_file} ]; then return 0;
 71   else
 72-    accurate=$(stat -f%m .cap_tasks~)
 73-    changed=$(stat -f%m config/deploy.rb)
 74+    accurate=$($stat_cmd $_cap_task_cache_file)
 75+    changed=$($stat_cmd config/deploy.rb)
 76     return $(expr $accurate '>=' $changed)
 77   fi
 78 }
 79@@ -10,12 +32,10 @@ function _cap_does_task_list_need_generating () {
 80 function _cap () {
 81   if [ -f config/deploy.rb ]; then
 82     if _cap_does_task_list_need_generating; then
 83-      echo "\nGenerating .cap_tasks~..." > /dev/stderr
 84-      cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
 85-> .cap_tasks~
 86+      _cap_get_task_list > ${_cap_task_cache_file}
 87     fi
 88-    compadd `cat .cap_tasks~`
 89+    compadd `cat ${_cap_task_cache_file}`
 90   fi
 91 }
 92 
 93-compctl -K _cap cap
 94+compdef _cap cap
 95diff --git a/plugins/colemak/colemak-less b/plugins/colemak/colemak-less
 96new file mode 100644
 97index 0000000000000000000000000000000000000000..e4ca4facd65707c1f2ada112fb8781664439e637
 98--- /dev/null
 99+++ b/plugins/colemak/colemak-less
100@@ -0,0 +1,6 @@
101+n    forw-line
102+e    back-line
103+k    repeat-search
104+\ek  repeat-search-all
105+K    reverse-search
106+\eK  reverse-search-all
107diff --git a/plugins/colemak/colemak.plugin.zsh b/plugins/colemak/colemak.plugin.zsh
108new file mode 100644
109index 0000000000000000000000000000000000000000..34d42c280423836a39582089b504d240718a3f35
110--- /dev/null
111+++ b/plugins/colemak/colemak.plugin.zsh
112@@ -0,0 +1,22 @@
113+# ctrl-j newline
114+bindkey '^n' accept-line
115+bindkey -a '^n' accept-line
116+
117+# another rotation to match qwerty
118+bindkey -a 'n' down-line-or-history
119+bindkey -a 'e' up-line-or-history
120+bindkey -a 'i' vi-forward-char
121+
122+# make qwerty
123+bindkey -a 'k' vi-repeat-search
124+bindkey -a 'K' vi-rev-repeat-search
125+bindkey -a 'u' vi-insert
126+bindkey -a 'U' vi-insert-bol
127+bindkey -a 'l' vi-undo-change
128+bindkey -a 'N' vi-join
129+
130+# spare
131+bindkey -a 'j' vi-forward-word-end
132+bindkey -a 'J' vi-forward-blank-word-end
133+
134+lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less
135diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
136new file mode 100644
137index 0000000000000000000000000000000000000000..c9b762d072ab2a3a0c7df36f76f91c6bc624da6b
138--- /dev/null
139+++ b/plugins/composer/composer.plugin.zsh
140@@ -0,0 +1,29 @@
141+# ------------------------------------------------------------------------------
142+#          FILE:  composer.plugin.zsh
143+#   DESCRIPTION:  oh-my-zsh composer plugin file.
144+#        AUTHOR:  Daniel Gomes (me@danielcsgomes.com)
145+#       VERSION:  1.0.0
146+# ------------------------------------------------------------------------------
147+
148+# Composer basic command completion
149+_composer_get_command_list () {
150+	composer --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'
151+}
152+
153+_composer () {
154+  if [ -f composer.json ]; then
155+    compadd `_composer_get_command_list`
156+  fi
157+}
158+
159+compdef _composer composer
160+
161+# Aliases
162+alias c='composer'
163+alias csu='composer self-update'
164+alias cu='composer update'
165+alias ci='composer install'
166+alias ccp='composer create-project'
167+
168+# install composer in the current directory
169+alias cget='curl -s https://getcomposer.org/installer | php'
170diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
171new file mode 100644
172index 0000000000000000000000000000000000000000..636e4619e37be6b64eea2ee1fed5d62bb0b8f98b
173--- /dev/null
174+++ b/plugins/jira/jira.plugin.zsh
175@@ -0,0 +1,22 @@
176+# To use: add a .jira-url file in the base of your project
177+# Setup: cd to/my/project
178+#        echo "https://name.jira.com" >> .jira-url
179+# Usage: jira           # opens a new issue
180+#        jira ABC-123   # Opens an existing issue
181+open_jira_issue () {
182+  if [ ! -f .jira-url ]; then
183+    echo "There is no .jira-url file in the current directory..."
184+    return 0;
185+  else
186+    jira_url=$(cat .jira-url);
187+    if [ -z "$1" ]; then
188+      echo "Opening new issue";
189+      `open $jira_url/secure/CreateIssue!default.jspa`;
190+    else
191+      echo "Opening issue #$1";
192+      `open $jira_url/issues/$1`;
193+    fi
194+  fi
195+}
196+
197+alias jira='open_jira_issue'
198diff --git a/plugins/laravel/_artisan b/plugins/laravel/_artisan
199new file mode 100644
200index 0000000000000000000000000000000000000000..8637514cfe97ccf0ce40d208b46c68ebbb8f86bb
201--- /dev/null
202+++ b/plugins/laravel/_artisan
203@@ -0,0 +1,40 @@
204+#compdef artisan
205+
206+# Laravel autocompletion
207+# Author: John Hamelink <john@johnhamelink.com>
208+#
209+# This plugin does the following:
210+#  - Adds aliases and autocompletion for artisan
211+#  - Adds aliases and autocompletion for bob
212+
213+local curcontext="$curcontext" state line _opts _bundles ret=1
214+_arguments -C \
215+    '1: :->cmds' \
216+    '*:: :->args' && ret=0
217+
218+case $state in
219+    cmds)
220+
221+    _values "Artisan command" \
222+        'session\:install[Create a session table]' \
223+        'migrate[Manage Migrations]' \
224+        'test[Run a test]' \
225+        'route\:\:call[Call a route in the CLI]' \
226+        'key\:\:generate[Generate a key]'
227+        ret=0
228+        ;;
229+    args)
230+        case $line[1] in
231+            migrate)
232+                _values \
233+                    'install[Create the Laravel migration table' \
234+                    'make[Create a migration]' \
235+                    'rollback[Roll back to the last migration operation]' \
236+                    'reset[Roll back all migrations that have ever run]'
237+                ret=0
238+                ;;
239+        esac
240+        ;;
241+esac
242+
243+return ret
244diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
245new file mode 100644
246index 0000000000000000000000000000000000000000..ed932ee89fae5965f74bdad6cd65a18cfa696640
247--- /dev/null
248+++ b/plugins/laravel/laravel.plugin.zsh
249@@ -0,0 +1,3 @@
250+#!zsh
251+alias artisan='php artisan'
252+alias bob='php artisan bob::build'
253diff --git a/plugins/nanoc/_nanoc b/plugins/nanoc/_nanoc
254new file mode 100644
255index 0000000000000000000000000000000000000000..fde07c3fccc5c8faae39916f8a7dd9e5edc43afe
256--- /dev/null
257+++ b/plugins/nanoc/_nanoc
258@@ -0,0 +1,44 @@
259+#compdef nanoc
260+#autoload
261+
262+# nanoc zsh completion - based on the homebrew zsh completion
263+# requires the 'nanoc' gem to be installed
264+
265+local -a _1st_arguments
266+_1st_arguments=(
267+  'autocompile:start the autocompiler'
268+  'compile:compile items of this site'
269+  'create-item:create an item'
270+  'create-layout:create a layout'
271+  'create-site:create a site'
272+  'deploy:deploy the compiled site'
273+  'help:show help'
274+  'prune:remove files not managed by nanoc from the output directory'
275+  'show-data:show data in this site'
276+  'show-plugins:show all available plugins'
277+  'show-rules:describe the rules for each item'
278+  'update:update the data stored by the data source to a newer version'
279+  'validate-css:validate the site’s CSS'
280+  'validate-html:validate the site’s HTML'
281+  'validate-links:validate links in site'
282+  'view:start the web server that serves static files'
283+  'watch:start the watcher'
284+)
285+
286+local expl
287+local -a pkgs installed_pkgs
288+
289+_arguments \
290+  '(--color)--color[enable color]' \
291+  '(--debug)--debug[enable debugging]' \
292+  '(--help)--help[show the help message and quit]' \
293+  '(--no-color)--no-color[disable color]' \
294+  '(--verbose)--verbose[make nanoc output more detailed]' \
295+  '(--version)--version[show version information and quit]' \
296+  '(--warn)--warn[enable warnings]' \
297+  '*:: :->subcmds' && return 0
298+
299+if (( CURRENT == 1 )); then
300+  _describe -t commands "nanoc subcommand" _1st_arguments
301+  return
302+fi
303diff --git a/plugins/nanoc/nanoc.plugin.zsh b/plugins/nanoc/nanoc.plugin.zsh
304new file mode 100644
305index 0000000000000000000000000000000000000000..5a5064613a999f01d98fea4ccc9f7a384e80460f
306--- /dev/null
307+++ b/plugins/nanoc/nanoc.plugin.zsh
308@@ -0,0 +1,9 @@
309+alias n='nanoc'
310+alias na='nanoc autocompile'
311+alias nco='nanoc compile'
312+alias nci='nanoc create_item'
313+alias ncl='nanoc create_layout'
314+alias ncs='nanoc create_site'
315+alias nd='nanoc deploy'
316+alias nv='nanoc view'
317+alias nw='nanoc watch'
318diff --git a/plugins/per-directory-history/per-directory-history.plugin.zsh b/plugins/per-directory-history/per-directory-history.plugin.zsh
319new file mode 100644
320index 0000000000000000000000000000000000000000..22383b8b96cf7ff31738fe4ebf3d9a8f28223e13
321--- /dev/null
322+++ b/plugins/per-directory-history/per-directory-history.plugin.zsh
323@@ -0,0 +1,148 @@
324+#!/usr/bin/env zsh
325+#
326+# This is a implementation of per directory history for zsh, some 
327+# implementations of which exist in bash[1,2].  It also implements 
328+# a per-directory-history-toggle-history function to change from using the 
329+# directory history to using the global history.  In both cases the history is 
330+# always saved to both the global history and the directory history, so the 
331+# toggle state will not effect the saved histories.  Being able to switch 
332+# between global and directory histories on the fly is a novel feature as far 
333+# as I am aware.
334+#
335+#-------------------------------------------------------------------------------
336+# Configuration
337+#-------------------------------------------------------------------------------
338+#
339+# HISTORY_BASE a global variable that defines the base directory in which the 
340+# directory histories are stored
341+#
342+#-------------------------------------------------------------------------------
343+# History
344+#-------------------------------------------------------------------------------
345+#
346+# The idea/inspiration for a per directory history is from Stewart MacArthur[1] 
347+# and Dieter[2], the implementation idea is from Bart Schaefer on the the zsh 
348+# mailing list[3].  The implementation is by Jim Hester in September 2012.
349+#
350+# [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
351+# [2]: http://dieter.plaetinck.be/per_directory_bash
352+# [3]: http://www.zsh.org/mla/users/1997/msg00226.html
353+#
354+################################################################################
355+#
356+# Copyright (c) 2012 Jim Hester
357+#
358+# This software is provided 'as-is', without any express or implied warranty.  
359+# In no event will the authors be held liable for any damages arising from the 
360+# use of this software.
361+#
362+# Permission is granted to anyone to use this software for any purpose, 
363+# including commercial applications, and to alter it and redistribute it 
364+# freely, subject to the following restrictions:
365+#
366+# 1. The origin of this software must not be misrepresented; you must not claim 
367+# that you wrote the original software. If you use this software in a product, 
368+# an acknowledgment in the product documentation would be appreciated but is 
369+# not required.
370+#
371+# 2. Altered source versions must be plainly marked as such, and must not be 
372+# misrepresented as being the original software.
373+#
374+# 3. This notice may not be removed or altered from any source distribution..
375+#
376+################################################################################
377+
378+#-------------------------------------------------------------------------------
379+# configuration, the base under which the directory histories are stored
380+#-------------------------------------------------------------------------------
381+
382+[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history"
383+
384+#-------------------------------------------------------------------------------
385+# toggle global/directory history used for searching - ctrl-G by default
386+#-------------------------------------------------------------------------------
387+
388+function per-directory-history-toggle-history() {
389+  if [[ $_per_directory_history_is_global == true ]]; then
390+    _per-directory-history-set-directory-history
391+    echo "using local history\n"
392+  else
393+    _per-directory-history-set-global-history
394+    echo "using global history\n"
395+  fi
396+  zle reset-prompt
397+}
398+
399+autoload per-directory-history-toggle-history
400+zle -N per-directory-history-toggle-history
401+bindkey '^G' per-directory-history-toggle-history
402+
403+#-------------------------------------------------------------------------------
404+# implementation details
405+#-------------------------------------------------------------------------------
406+
407+_per_directory_history_directory="$HISTORY_BASE${PWD:A}/history"
408+
409+function _per-directory-history-change-directory() {
410+  _per_directory_history_directory="$HISTORY_BASE${PWD:A}/history"
411+  mkdir -p ${_per_directory_history_directory:h}
412+  if [[ $_per_directory_history_is_global == false ]]; then
413+    #save to the global history
414+    fc -AI $HISTFILE
415+    #save history to previous file
416+    local prev="$HISTORY_BASE${OLDPWD:A}/history"
417+    mkdir -p ${prev:h}
418+    fc -AI $prev
419+
420+    #discard previous directory's history
421+    local original_histsize=$HISTSIZE
422+    HISTSIZE=0
423diff --git a/plugins/supervisor/_supervisorctl b/plugins/supervisor/_supervisorctl
424new file mode 100644
425index 0000000000000000000000000000000000000000..d159f20e07f9a384e47e4cc16b78cce80aeeeef6
426--- /dev/null
427+++ b/plugins/supervisor/_supervisorctl
428@@ -0,0 +1,136 @@
429+#compdef supervisorctl
430+
431+typeset -A opt_args
432+local context state line
433+
434+_supervisorctl() {
435+    _arguments -s -S \
436+        {--configuration,-c}"[configuration file path (default /etc/supervisor.conf)]:FILENAME:_files" \
437+        {--help,-h}"[print usage message and exit]:" \
438+        {--interactive,-i}"[start an interactive shell after executing commands]" \
439+        {--serverurl,-s}"[URL on which supervisord server is listening (default "http://localhost:9001").]" \
440+        {--username,-u}"[username to use for authentication with server]:USERNAME:_users" \
441+        {--password,-p}"[password to use for authentication with server]:PASSWORD:" \
442+        {--history-file,-r}"[keep a readline history (if readline is available)]:FILENAME:_files" \
443+        "*::supervisorctl commands:_supervisorctl_command"
444+}
445+
446+(( $+functions[_supervisorctl_command] )) ||
447+_supervisorctl_command() {
448+    local cmd ret=1
449+
450+    (( $+supervisorctl_cmds )) || _supervisorctl_cmds=(
451+        "add:Activates any updates in config for process/group" \
452+        "avail:Display all configured processes" \
453+        "clear:Clear process/multiple-process/all-process log files" \
454+        "exit:Exit the supervisor shell." \
455+        "fg:Connect to a process in foreground mode" \
456+        "maintail:tail of supervisor main log file" \
457+        "open:Connect to a remote supervisord process. (for UNIX domain socket, use unix:///socket/path)" \
458+        "pid:Get the PID of supervisord." \
459+        "quit:Exit the supervisor shell." \
460+        "reload:Restart the remote supervisord." \
461+        "remove:Removes process/group from active config" \
462+        "reread:Reload the daemon's configuration files" \
463+        "restart:Restart process or group." \
464+        "shutdown:Shut the remote supervisord down." \
465+        "start:Start process or groups." \
466+        "status:Get process status info." \
467+        "stop:Stop process or group." \
468+        "tail:tail of process stdout" \
469+        "update:Reload config and add/remove as necessary" \
470+        "version:Show the version of the remote supervisord process" \
471+        "help:Show help" \
472+        )
473+
474+    if (( CURRENT == 1 )); then
475+        _describe -t commands 'supervisorctl subcommand' _supervisorctl_cmds \
476+            || compadd "$@" - ${(s.:.)${(j.:.)_supervisorctl_syns}}
477+    else
478+        local curcontext="$curcontext"
479+
480+        cmd="${${_supervisorctl_cmds[(r)$words[1]:*]%%:*}:-${(k)_supervisorctl_syns[(r)(*:|)$words[1](:*|)]}}"
481+        if (( $#cmd )); then
482+            curcontext="${curcontext%:*:*}:supervisorctl-${cmd}:"
483+            _call_function ret _supervisorctl_$cmd || _message 'no more arguments'
484+        else
485+            _message "unknown supervisorctl command: $words[1]"
486+        fi
487+        return ret
488+    fi
489+}
490+
491+# get supervisor contoroll processes
492+(( $+functions[_get_supervisor_procs] )) ||
493+_get_supervisor_procs() {
494+    local cache_policy
495+    zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
496+    if [[ -z "$cache_policy" ]]; then
497+        zstyle ":completion:${curcontext}:" cache-policy _supervisor_procs_caching_policy
498+    fi
499+
500+    if ( [[ ${+_supervisor_procs} -eq 0 ]] || _cache_invalid supervisor_procs ) \
501+        && ! _retrieve_cache supervisor_procs; then
502+
503+        _supervisor_procs=(${${(f)"$(supervisorctl status >/dev/null 2>&1 | awk -F' ' '{print $1}')"}})
504+        _store_cache supervisor_procs _supervisor_procs
505+    fi
506+
507+    local expl
508+    _wanted supervisor_procs expl 'supervisor processes' compadd -a _supervisor_procs
509+}
510+
511+_supervisor_procs_caching_policy() {
512+    local -a oldp
513+    oldp=( "$1"(Nmw+1) )
514+    (( $#oldp ))
515+}
516+
517+(( $+functions[_supervisorctl_add] )) ||
518+_supervisorctl_add() {
519+    _arguments -s \
520+        "--help[use help system]" \
521+        "*::supervisorctl commands:_supervisorctl"
522+}
523+
524+(( $+functions[_supervisorctl_help] )) ||
525+_supervisorctl_help() {
526+    _arguments -s \
527+        "*:supervisorctl commands:_supervisorctl"
528diff --git a/plugins/supervisor/_supervisord b/plugins/supervisor/_supervisord
529new file mode 100644
530index 0000000000000000000000000000000000000000..34d27805dd1f9d1d3444786073c93e86c44eda31
531--- /dev/null
532+++ b/plugins/supervisor/_supervisord
533@@ -0,0 +1,32 @@
534+#compdef supervisord
535+
536+typeset -A opt_args
537+local context state line
538+
539+_arguments \
540+    {--configuration,-c}"[configuration file]:FILENAME:_files" \
541+    {--nodaemon,-n}"[run in the foreground (same as 'nodaemon true' in config file)]" \
542+    {--help,-h}"[print this usage message and exit]:" \
543+    {--user,-u}"[run supervisord as this user]:USER:_users" \
544+    {--umask,-m}"[use this umask for daemon subprocess (default is 022)]" \
545+    {--directory,-d}"[directory to chdir to when daemonized]" \
546+    {--logfile,-l}"[use FILENAME as logfile path]:FILENAME:_files" \
547+    {--logfile_maxbytes,-y}"[use BYTES to limit the max size of logfile]" \
548+    {--logfile_backups,-z}"[number of backups to keep when max bytes reached]" \
549+    {--loglevel,-e}"[use LEVEL as log level (debug,info,warn,error,critical)]:level:->levels" \
550+    {--pidfile,-j}"[write a pid file for the daemon process to FILENAME]:FILENAME:_files" \
551+    {--identifier,-i}"[identifier used for this instance of supervisord]" \
552+    {--childlogdir,-q}"[the log directory for child process logs]:child log directory:_files -/" \
553+    {--nocleanup,-k}"[prevent the process from performing cleanup (removal of old automatic child log files) at startup.]" \
554+    {--minfds,-a}"[the minimum number of file descriptors for start success]" \
555+    {--strip_ansi,-t}"[strip ansi escape codes from process output]" \
556+    "--minprocs[the minimum number of processes available for start success]" \
557+    "--profile_options[run supervisord under profiler and output results based on OPTIONS, which is a comma-sep'd list of 'cumulative', 'calls', and/or 'callers', e.g. 'cumulative,callers')]" \
558+    "*::args:_gnu_generic"
559+
560+case $state in
561+levels)
562+    levels=("debug" "info" "warn" "error" "critical")
563+    _describe -t levels 'supervisord levels' levels && return 0
564+    ;;
565+esac
566diff --git a/plugins/supervisor/supervisor.plugin.zsh b/plugins/supervisor/supervisor.plugin.zsh
567new file mode 100644
568index 0000000000000000000000000000000000000000..cf1997c5be62ffeebc99253cced7608415e38e4e
569--- /dev/null
570+++ b/plugins/supervisor/supervisor.plugin.zsh
571@@ -0,0 +1 @@
572+# DECLARION: This plugin was created by hhatto. What I did is just making a portal from https://bitbucket.org/hhatto/zshcompfunc4supervisor.
573diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
574index 644266841fe11393c8b253da3479f52383f7dfdf..223401298df2bbdeaffe9bff6716608b051c0716 100644
575--- a/plugins/symfony2/symfony2.plugin.zsh
576+++ b/plugins/symfony2/symfony2.plugin.zsh
577@@ -10,4 +10,8 @@ _symfony2 () {
578   fi
579 }
580 
581-compdef _symfony2 app/console
582+compdef _symfony2 app/console
583+
584+#Alias
585+alias sf2='php app/console'
586+alias sf2clear='php app/console cache:clear'
587diff --git a/plugins/urltools/urltools.plugin.zsh b/plugins/urltools/urltools.plugin.zsh
588new file mode 100644
589index 0000000000000000000000000000000000000000..0d29314d6790700a681af8c0d6ffde94e5303b47
590--- /dev/null
591+++ b/plugins/urltools/urltools.plugin.zsh
592@@ -0,0 +1,9 @@
593+# URL Tools
594+# Adds handy command line aliases useful for dealing with URLs
595+#
596+# Taken from:
597+# http://ruslanspivak.com/2010/06/02/urlencode-and-urldecode-from-a-command-line/
598+
599+alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
600+
601+alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
602diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
603index c47ab72114562251e4ca75f1395dcaea1abe2002..d29eb1dda85de0b8aa9416643166c5f4081d468b 100644
604--- a/plugins/vi-mode/vi-mode.plugin.zsh
605+++ b/plugins/vi-mode/vi-mode.plugin.zsh
606@@ -5,7 +5,12 @@ function zle-line-init zle-keymap-select {
607 zle -N zle-line-init
608 zle -N zle-keymap-select
609 
610+#changing mode clobbers the keybinds, so store the keybinds before and execute 
611+#them after
612+binds=`bindkey -L`
613 bindkey -v
614+for bind in ${(@f)binds}; do eval $bind; done
615+unset binds
616 
617 # if mode indicator wasn't setup by theme, define default
618 if [[ "$MODE_INDICATOR" == "" ]]; then
619diff --git a/plugins/zeus/README.md b/plugins/zeus/README.md
620new file mode 100644
621index 0000000000000000000000000000000000000000..4409943fe67fc9a8a6aea1d40060d45629312052
622--- /dev/null
623+++ b/plugins/zeus/README.md
624@@ -0,0 +1,41 @@
625+## zeus
626+**Maintainer:** [b4mboo](https://github.com/b4mboo)
627+
628+* `zi` aliases `zeus init`
629+* `zinit` aliases `zeus init`
630+
631+* `zs` aliases `zeus start`
632+* `ztart` aliases `zeus start`
633+
634+* `zc` aliases `zeus console`
635+* `zonsole` aliases `zeus console`
636+
637+* `zsr` aliases `zeus server`
638+* `zerver` aliases `zeus server`
639+
640+* `zr` aliases `zeus rake`
641+* `zake` aliases `zeus rake`
642+
643+* `zg` aliases `zeus generate`
644+* `zenerate` aliases `zeus generate`
645+
646+* `zrn` aliases `zeus runner`
647+* `zunner` aliases `zeus runner`
648+
649+* `zcu` aliases `zeus cucumber`
650+* `zucumber` aliases `zeus cucumber`
651+
652+* `zt` aliases `zeus test`
653+* `zest` aliases `zeus test`
654+
655+* `zu` aliases `zeus test test/unit/*`
656+* `zunits` aliases `zeus test test/unit/*`
657+
658+* `zf` aliases `zeus test test/functional/*`
659+* `zunctional` aliases `zeus test test/functional/*`
660+
661+* `za` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber`
662+* `zall` aliases `zeus test test/unit/*; zeus test test/functional/; zeus cucumber`
663+
664+* `zsw` aliases `rm .zeus.sock`
665+* `zweep` aliases `rm .zeus.sock`
666diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh
667new file mode 100644
668index 0000000000000000000000000000000000000000..2fc7e1ebf06033182b0483d8c99c0189451f7c96
669--- /dev/null
670+++ b/plugins/zeus/zeus.plugin.zsh
671@@ -0,0 +1,58 @@
672+# Some aliases for zeus. (See: https://github.com/burke/zeus)
673+# Zeus preloads your Rails environment and forks that process whenever
674+# needed. This effectively speeds up Rails' boot process to under 1 sec.
675+
676+# Always use bundler.
677+# Rails depends on bundler, so we can be pretty sure, that there are no
678+# problems with this command. For all the other aliases I provided an 
679+# alternative, in case people have conflicts with other plugins (e.g. suse).
680+alias zeus='bundle exec zeus'
681+
682+# Init
683+alias zi='zeus init'
684+alias zinit='zeus init'
685+
686+# Start
687+alias zs='zeus start'
688+alias ztart='zeus start'
689+
690+# Console
691+alias zc='zeus console'
692+alias zonsole='zeus console'
693+
694+# Server
695+alias zsr='zeus server'
696+alias zerver='zeus server'
697+
698+# Rake
699+alias zr='zeus rake'
700+alias zake='zeus rake'
701+
702+# Generate
703+alias zg='zeus generate'
704+alias zenerate='zeus generate'
705+
706+# Runner
707+alias zrn='zeus runner'
708+alias zunner='zeus runner'
709+
710+# Cucumber
711+alias zcu='zeus cucumber'
712+alias zucumber='zeus cucumber'
713+
714+# Test
715+alias zt='zeus test'
716+alias zest='zeus test'
717+
718+alias zu='zeus test test/unit/*'
719+alias zunits='zeus test test/unit/*'
720+
721+alias zf='zeus test test/functional/*'
722+alias zunctional='zeus test test/functional/*'
723+
724+alias za='zeus test test/unit/*; zeus test test/functional/; zeus cucumber'
725+alias zall='zeus test test/unit/*; zeus test test/functional/; zeus cucumber'
726+
727+# Clean up crashed zeus instances.
728+alias zsw='rm .zeus.sock'
729+alias zweep='rm .zeus.sock'
730diff --git a/themes/3den.zsh-theme b/themes/3den.zsh-theme
731new file mode 100644
732index 0000000000000000000000000000000000000000..1d2c7db7f182583189b42f71101a627c04d62c9d
733--- /dev/null
734+++ b/themes/3den.zsh-theme
735@@ -0,0 +1,7 @@
736+PROMPT=$'%{$fg[white]%}$(~/.rvm/bin/rvm-prompt) %{$fg_bold[cyan]%}%~%{$reset_color%}$(git_prompt_info) %{$fg[cyan]%}%D{[%I:%M:%S]}\
737+%{$fg_bold[green]%}%n$%{$reset_color%} '
738+
739+ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}("
740+ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
741+ZSH_THEME_GIT_PROMPT_DIRTY="*"
742+ZSH_THEME_GIT_PROMPT_CLEAN=""
743diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
744new file mode 100644
745index 0000000000000000000000000000000000000000..c3107c06c04fb42b0ca27b0a81b15854819969c6
746--- /dev/null
747+++ b/themes/agnoster.zsh-theme
748@@ -0,0 +1,115 @@
749+# vim:ft=zsh ts=2 sw=2 sts=2
750+#
751+# agnoster's Theme - https://gist.github.com/3712874
752+# A Powerline-inspired theme for ZSH
753+#
754+# # README
755+#
756+# In order for this theme to render correctly, you will need a
757+# [Powerline-patched font](https://gist.github.com/1595572).
758+#
759+# In addition, I recommend the
760+# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
761+# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -
762+# it has significantly better color fidelity.
763+#
764+# # Goals
765+#
766+# The aim of this theme is to only show you *relevant* information. Like most
767+# prompts, it will only show git information when in a git working directory.
768+# However, it goes a step further: everything from the current user and
769+# hostname to whether the last call exited with an error to whether background
770+# jobs are running in this shell will all be displayed automatically when
771+# appropriate.
772+
773+### Segment drawing
774+# A few utility functions to make it easy and re-usable to draw segmented prompts
775+
776+CURRENT_BG='NONE'
777+SEGMENT_SEPARATOR='⮀'
778+
779+# Begin a segment
780+# Takes two arguments, background and foreground. Both can be omitted,
781+# rendering default background/foreground.
782+prompt_segment() {
783+  local bg fg
784+  [[ -n $1 ]] && bg="%K{$1}" || bg="%k"
785+  [[ -n $2 ]] && fg="%F{$2}" || fg="%f"
786+  if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then
787+    echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} "
788+  else
789+    echo -n "%{$bg%}%{$fg%} "
790+  fi
791+  CURRENT_BG=$1
792+  [[ -n $3 ]] && echo -n $3
793+}
794+
795+# End the prompt, closing any open segments
796+prompt_end() {
797+  if [[ -n $CURRENT_BG ]]; then
798+    echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR"
799+  else
800+    echo -n "%{%k%}"
801+  fi
802+  echo -n "%{%f%}"
803+  CURRENT_BG=''
804+}
805+
806+### Prompt components
807+# Each component will draw itself, and hide itself if no information needs to be shown
808+
809+# Context: user@hostname (who am I and where am I)
810+prompt_context() {
811+  local user=`whoami`
812+
813+  if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
814+    prompt_segment black default "%(!.%{%F{yellow}%}.)$user@%m"
815+  fi
816+}
817+
818+# Git: branch/detached head, dirty status
819+prompt_git() {
820+  local ref dirty
821+  if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
822+    ZSH_THEME_GIT_PROMPT_DIRTY='±'
823+    dirty=$(parse_git_dirty)
824+    ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)"
825+    if [[ -n $dirty ]]; then
826+      prompt_segment yellow black
827+    else
828+      prompt_segment green black
829+    fi
830+    echo -n "${ref/refs\/heads\//⭠ }$dirty"
831+  fi
832+}
833+
834+# Dir: current working directory
835+prompt_dir() {
836+  prompt_segment blue black '%~'
837+}
838+
839+# Status:
840+# - was there an error
841+# - am I root
842+# - are there background jobs?
843+prompt_status() {
844+  local symbols
845+  symbols=()
846+  [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
847+  [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
848diff --git a/themes/jnrowe.zsh-theme b/themes/jnrowe.zsh-theme
849index 7c8a7082e96696931d797f1e847d7eeef2f4c581..bae88f7abc6269d4eea700a47d8cf270cdb1fa63 100644
850--- a/themes/jnrowe.zsh-theme
851+++ b/themes/jnrowe.zsh-theme
852@@ -2,15 +2,14 @@ autoload -U add-zsh-hook
853 autoload -Uz vcs_info
854 
855 zstyle ':vcs_info:*' actionformats \
856-    '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
857-zstyle ':vcs_info:*' formats \
858-    '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
859+       '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
860+zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f '
861 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
862 zstyle ':vcs_info:*' enable git
863 
864-add-zsh-hook precmd prompt_jnrowe_precmd
865+add-zsh-hook precmd prompt_vcs
866 
867-prompt_jnrowe_precmd () {
868+prompt_vcs () {
869     vcs_info
870 
871     if [ "${vcs_info_msg_0_}" = "" ]; then
872@@ -24,8 +23,16 @@ prompt_jnrowe_precmd () {
873     fi
874 }
875 
876+function {
877+    if [[ -n "$SSH_CLIENT" ]]; then
878+        PROMPT_HOST=" ($HOST)"
879+    else
880+        PROMPT_HOST=''
881+    fi
882+}
883+
884 local ret_status="%(?:%{$fg_bold[green]%}Ξ:%{$fg_bold[red]%}%S↑%s%?)"
885 
886-PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
887+PROMPT='${ret_status}%{$fg[blue]%}${PROMPT_HOST}%{$fg_bold[green]%}%p %{$fg_bold[yellow]%}%2~ ${vcs_info_msg_0_}${dir_status}%{$reset_color%} '
888 
889 #  vim: set ft=zsh ts=4 sw=4 et:
890diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
891index bbd705a1e8de80152e3577f1e3bd854b58e2185d..612901cbe5e122b8a3ac0ebe3b5e72b4c3948b58 100644
892--- a/tools/check_for_upgrade.sh
893+++ b/tools/check_for_upgrade.sh
894@@ -32,9 +32,10 @@ then
895       echo "[Oh My Zsh] Would you like to check for updates?"
896       echo "Type Y to update oh-my-zsh: \c"
897       read line
898-      if [ "$line" = Y ] || [ "$line" = y ]
899-      then
900+      if [ "$line" = Y ] || [ "$line" = y ]; then
901         _upgrade_zsh
902+      else
903+        _update_zsh_update
904       fi
905     fi
906   fi