From 5d90f58b37fd67184c4aed3d81a1d3703f8fe832 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Apr 2011 20:21:13 +0200 Subject: [PATCH 01/94] I should not have merged this here. --- plugins/git-svn/.gitignore | 1 - plugins/git-svn/git-svn.plugin.zsh | 10 ---------- 2 files changed, 11 deletions(-) delete mode 100644 plugins/git-svn/.gitignore delete mode 100644 plugins/git-svn/git-svn.plugin.zsh diff --git a/plugins/git-svn/.gitignore b/plugins/git-svn/.gitignore deleted file mode 100644 index bf5e1a14f..000000000 --- a/plugins/git-svn/.gitignore +++ /dev/null @@ -1 +0,0 @@ -git-svn-clone-externals diff --git a/plugins/git-svn/git-svn.plugin.zsh b/plugins/git-svn/git-svn.plugin.zsh deleted file mode 100644 index 062d63e05..000000000 --- a/plugins/git-svn/git-svn.plugin.zsh +++ /dev/null @@ -1,10 +0,0 @@ - -if ! [ -d "$ZSH/plugins/git-svn/git-svn-clone-externals" ] ;then - git clone https://github.com/andrep/git-svn-clone-externals.git -fi -export PATH="$ZSH/plugins/git-svn/git-svn-clone-externals:$PATH" - -function git_svn_update { - (cd "$ZSH/plugins/git-svn/git-svn-clone-externals" && \ - git pull origin master) -} From a183bcbc6d8d61bd9c1077b45d1c5b3239e96a71 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Thu, 14 Apr 2011 07:17:10 +0200 Subject: [PATCH 02/94] More comments --- plugins/emacs/emacs.plugin.zsh | 25 ++++++++++++++++++++++--- plugins/emacs/emacsclient.sh | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index bca79e70e..62d9fbccc 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -1,11 +1,30 @@ -# Use daemon capabilities of emacs 23 +# Emacs 23 daemon capability is a killing feature. +# One emacs process handles all your frames whether +# you use a frame opened in a terminal via a ssh connection or X frames +# opened on the same host. + +# Benefits are multiple +# - You don't have the cost of starting Emacs all the time anymore +# - Opening a file is as fast as Emacs does not have anything else to do. +# - You can share opened buffered across opened frames. +# - Configuration changes made at runtime are applied to all frames. + + if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then export EDITOR="$ZSH/plugins/emacs/emacsclient.sh" alias emacs="$EDITOR --no-wait" alias e=emacs + # same than M-x eval but from outside Emacs. + alias eeval="emacs --eval" + # create a new X frame + alias eframe='emacsclient --alternate-editor "" --create-frame' + + # to code all night long alias emasc=emacs alias emcas=emacs - # create a new X frame - alias emacs_frame='emacsclient --alternate-editor "" --create-frame' fi + +## Local Variables: +## mode: sh +## End: diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 3475926a6..b098fd24a 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -6,5 +6,6 @@ x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` if [ -z "$x" ] ;then emacsclient --alternate-editor "" --create-frame $@ else + # prevent creating another X frame if there is at least one present. emacsclient --alternate-editor "" $@ fi From 49c0a1381a7bd48464a1c33cac6e09770749f795 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Fri, 15 Apr 2011 18:13:01 +0200 Subject: [PATCH 03/94] - Fix pass of parameters - Add new function `ecd'. --- plugins/emacs/emacs.plugin.zsh | 18 +++++++++++++++++- plugins/emacs/emacsclient.sh | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 62d9fbccc..58043040e 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -1,6 +1,6 @@ # Emacs 23 daemon capability is a killing feature. # One emacs process handles all your frames whether -# you use a frame opened in a terminal via a ssh connection or X frames +# you use a frame opened in a terminal via a ssh connection or X frames # opened on the same host. # Benefits are multiple @@ -23,8 +23,24 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then # to code all night long alias emasc=emacs alias emcas=emacs + + # jump to the directory of the current buffer + function ecd { + local cmd="(let ((buf-name (buffer-file-name (window-buffer)))) + (if buf-name + (file-name-directory buf-name)))" + + local dir=`$EDITOR --eval "$cmd" | tr -d \"` + if [ -n "$dir" ] ;then + cd "$dir" + else + echo "can not deduce current buffer filename." >/dev/stderr + return 1 + fi + } fi + ## Local Variables: ## mode: sh ## End: diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index b098fd24a..7fc2ad202 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -4,8 +4,8 @@ x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` if [ -z "$x" ] ;then - emacsclient --alternate-editor "" --create-frame $@ + emacsclient --alternate-editor "" --create-frame "$@" else # prevent creating another X frame if there is at least one present. - emacsclient --alternate-editor "" $@ + emacsclient --alternate-editor "" "$@" fi From 9b29136ec65953004f064ec4a834ae7b1f2949e7 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Fri, 15 Apr 2011 18:21:22 +0200 Subject: [PATCH 04/94] Fix alias `eeval' --- plugins/emacs/emacs.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 58043040e..fc6b8865e 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -16,7 +16,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then alias e=emacs # same than M-x eval but from outside Emacs. - alias eeval="emacs --eval" + alias eeval="$EDITOR --eval" # create a new X frame alias eframe='emacsclient --alternate-editor "" --create-frame' From 6f1929f822d24c6cfc9cecf574cb21c6b3817bb5 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Fri, 15 Apr 2011 18:22:27 +0200 Subject: [PATCH 05/94] Fix indentation --- plugins/emacs/emacs.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index fc6b8865e..3e45e54d0 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -27,8 +27,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then # jump to the directory of the current buffer function ecd { local cmd="(let ((buf-name (buffer-file-name (window-buffer)))) - (if buf-name - (file-name-directory buf-name)))" + (if buf-name (file-name-directory buf-name)))" local dir=`$EDITOR --eval "$cmd" | tr -d \"` if [ -n "$dir" ] ;then From 574de93efbba22db0ec816ecec717d502dfa333e Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Tue, 6 Sep 2011 10:50:53 +0200 Subject: [PATCH 06/94] New function `efile` --- plugins/emacs/emacs.plugin.zsh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 3e45e54d0..737abe9d6 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -24,14 +24,22 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then alias emasc=emacs alias emcas=emacs - # jump to the directory of the current buffer + # Write to standard output the path to the file + # opened in the current buffer. + function efile { + local cmd="(buffer-file-name (window-buffer))" + $EDITOR --eval "$cmd" | tr -d \" + } + + # display the directory of the file + # opened in the the current buffer function ecd { local cmd="(let ((buf-name (buffer-file-name (window-buffer)))) (if buf-name (file-name-directory buf-name)))" local dir=`$EDITOR --eval "$cmd" | tr -d \"` if [ -n "$dir" ] ;then - cd "$dir" + echo "$dir" else echo "can not deduce current buffer filename." >/dev/stderr return 1 @@ -39,7 +47,6 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then } fi - ## Local Variables: ## mode: sh ## End: From 7066bf7c6b522af9147ebf03c00361c4c6490d42 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Mon, 10 Oct 2011 14:54:20 +0200 Subject: [PATCH 07/94] Fix builtin `ecd' when file path contains space characters. --- plugins/emacs/emacs.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 737abe9d6..e22f10740 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -31,13 +31,13 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then $EDITOR --eval "$cmd" | tr -d \" } - # display the directory of the file + # Write to standard output the directory of the file # opened in the the current buffer function ecd { local cmd="(let ((buf-name (buffer-file-name (window-buffer)))) (if buf-name (file-name-directory buf-name)))" - local dir=`$EDITOR --eval "$cmd" | tr -d \"` + local dir="$($EDITOR --eval $cmd | tr -d \")" if [ -n "$dir" ] ;then echo "$dir" else From 3a408f326f1436a81ae481610c76c8938903df4f Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Mon, 10 Oct 2011 18:04:13 +0200 Subject: [PATCH 08/94] Comment --- plugins/emacs/emacsclient.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 7fc2ad202..38d419813 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -1,9 +1,10 @@ #!/bin/sh -# Starts emacs daemon if not already started. - +# get list of available X windows. x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` + if [ -z "$x" ] ;then + # Create one if there is no X window yet. emacsclient --alternate-editor "" --create-frame "$@" else # prevent creating another X frame if there is at least one present. From a01b1fefe63101fdc36291d0ec2097bdc3994f22 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Mon, 10 Oct 2011 18:04:24 +0200 Subject: [PATCH 09/94] Do not overwrite EDITOR environment variable if already defined. --- plugins/emacs/emacs.plugin.zsh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index e22f10740..a3f0085a8 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -11,12 +11,16 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then - export EDITOR="$ZSH/plugins/emacs/emacsclient.sh" - alias emacs="$EDITOR --no-wait" + export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh" + + # set EDITOR if not already defined. + export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}" + + alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait" alias e=emacs # same than M-x eval but from outside Emacs. - alias eeval="$EDITOR --eval" + alias eeval="$EMACS_PLUGIN_LAUNCHER --eval" # create a new X frame alias eframe='emacsclient --alternate-editor "" --create-frame' @@ -28,7 +32,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then # opened in the current buffer. function efile { local cmd="(buffer-file-name (window-buffer))" - $EDITOR --eval "$cmd" | tr -d \" + "$EMACS_PLUGIN_LAUNCHER" --eval "$cmd" | tr -d \" } # Write to standard output the directory of the file @@ -37,7 +41,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then local cmd="(let ((buf-name (buffer-file-name (window-buffer)))) (if buf-name (file-name-directory buf-name)))" - local dir="$($EDITOR --eval $cmd | tr -d \")" + local dir="$($EMACS_PLUGIN_LAUNCHER --eval $cmd | tr -d \")" if [ -n "$dir" ] ;then echo "$dir" else From 68cec79d32baeb96efc357ba94c0bfe5b4059c90 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Mon, 30 Jan 2012 22:51:58 -0500 Subject: [PATCH 10/94] Added documentation to key bindings. Conflicts: lib/key-bindings.zsh --- lib/key-bindings.zsh | 50 -------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 5f499f3e8..e69de29bb 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -1,50 +0,0 @@ -# TODO: Explain what some of this does.. - -bindkey -e -bindkey '\ew' kill-region -bindkey -s '\el' "ls\n" -bindkey '^r' history-incremental-search-backward -bindkey "^[[5~" up-line-or-history -bindkey "^[[6~" down-line-or-history - -# make search up and down work, so partially type and hit up/down to find relevant stuff -bindkey '^[[A' up-line-or-search -bindkey '^[[B' down-line-or-search - -bindkey "^[[H" beginning-of-line -bindkey "^[[1~" beginning-of-line -bindkey "^[OH" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[[4~" end-of-line -bindkey "^[OF" end-of-line -bindkey ' ' magic-space # also do history expansion on space - -bindkey "^[[1;5C" forward-word -bindkey "^[[1;5D" backward-word - -bindkey '^[[Z' reverse-menu-complete - -# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ -bindkey '^?' backward-delete-char -bindkey "^[[3~" delete-char -bindkey "^[3;5~" delete-char -bindkey "\e[3~" delete-char - -# consider emacs keybindings: - -#bindkey -e ## emacs key bindings -# -#bindkey '^[[A' up-line-or-search -#bindkey '^[[B' down-line-or-search -#bindkey '^[^[[C' emacs-forward-word -#bindkey '^[^[[D' emacs-backward-word -# -#bindkey -s '^X^Z' '%-^M' -#bindkey '^[e' expand-cmd-path -#bindkey '^[^I' reverse-menu-complete -#bindkey '^X^N' accept-and-infer-next-history -#bindkey '^W' kill-region -#bindkey '^I' complete-word -## Fix weird sequence that rxvt produces -#bindkey -s '^[[Z' '\t' -# From f7708d4181374cfbd223e071f7253018f28e5509 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Mon, 30 Jan 2012 23:04:06 -0500 Subject: [PATCH 11/94] forgot to save before committing. doh --- lib/key-bindings.zsh | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index e69de29bb..195bbb38e 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -0,0 +1,54 @@ +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins +# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets + +bindkey -e # Use emacs key bindings + +bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark +bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls +bindkey -s '\e.' '..\n' # [Esc-.] - run command: .. (up directory) +bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. +bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history +bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history + +bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward +bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward + +bindkey '^[[H' beginning-of-line # [Home] - Go to beginning of line +bindkey '^[[1~' beginning-of-line # [Home] - Go to beginning of line +bindkey '^[OH' beginning-of-line # [Home] - Go to beginning of line +bindkey '^[[F' end-of-line # [End] - Go to end of line +bindkey '^[[4~' end-of-line # [End] - Go to end of line +bindkey '^[OF' end-of-line # [End] - Go to end of line + +bindkey ' ' magic-space # [Space] - do history expansion + +bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word +bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word + +bindkey '^[[Z' reverse-menu-complete # [TODO] - Perform menu completion, like menu-complete, except that if a menu completion is already in progress, move to the previous completion rather than the next. + +# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ +bindkey '^?' backward-delete-char # [Delete] - delete backward +bindkey '^[[3~' delete-char # [fn-Delete] - delete forward +bindkey '^[3;5~' delete-char # [TODO] - delete forward +bindkey '\e[3~' delete-char # [TODO] - delete forward + +# consider emacs keybindings: + +#bindkey -e ## emacs key bindings +# +#bindkey '^[[A' up-line-or-search +#bindkey '^[[B' down-line-or-search +#bindkey '^[^[[C' emacs-forward-word +#bindkey '^[^[[D' emacs-backward-word +# +#bindkey -s '^X^Z' '%-^M' +#bindkey '^[e' expand-cmd-path +#bindkey '^[^I' reverse-menu-complete +#bindkey '^X^N' accept-and-infer-next-history +#bindkey '^W' kill-region +#bindkey '^I' complete-word +## Fix weird sequence that rxvt produces +#bindkey -s '^[[Z' '\t' +# From 3839c6e9e62a2671b1d3f5662e4d2bc3984c3f9e Mon Sep 17 00:00:00 2001 From: Mat Schaffer Date: Sat, 17 Mar 2012 22:03:01 -0300 Subject: [PATCH 12/94] Don't clobber standard Esc+. behavior Esc+. works as "last arg" on both bash and zsh. Seems like a shame to introduce a new standard. Conflicts: lib/key-bindings.zsh --- lib/key-bindings.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 195bbb38e..8168c8d90 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -6,7 +6,6 @@ bindkey -e # Use emacs key bindings bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls -bindkey -s '\e.' '..\n' # [Esc-.] - run command: .. (up directory) bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history From ff0cafa14db5b728f823ee486ec1bf5a9d2725eb Mon Sep 17 00:00:00 2001 From: Felix Dreissig Date: Sun, 14 Oct 2012 00:07:47 +0200 Subject: [PATCH 13/94] Make sure the terminal is always in application mode when zle is active. --- lib/key-bindings.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 8168c8d90..a57b04122 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -2,6 +2,19 @@ # http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins # http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets +# Make sure that the terminal is in application mode when zle is active, since +# only then values from $terminfo are valid +if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then + function zle-line-init() { + echoti smkx + } + function zle-line-finish() { + echoti rmkx + } + zle -N zle-line-init + zle -N zle-line-finish +fi + bindkey -e # Use emacs key bindings bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark From 174c9177aa34b4c05bb5a1c6f637e6fa479a8e10 Mon Sep 17 00:00:00 2001 From: Felix Dreissig Date: Sun, 14 Oct 2012 02:32:48 +0200 Subject: [PATCH 14/94] Replace hardcoded key escape sequeneces with dynamic ones from terminfo. --- lib/key-bindings.zsh | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index a57b04122..4a00764da 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -20,31 +20,24 @@ bindkey -e # Use emacs key bindings bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line. -bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history -bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history +bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history +bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history -bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward -bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward +bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward +bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward -bindkey '^[[H' beginning-of-line # [Home] - Go to beginning of line -bindkey '^[[1~' beginning-of-line # [Home] - Go to beginning of line -bindkey '^[OH' beginning-of-line # [Home] - Go to beginning of line -bindkey '^[[F' end-of-line # [End] - Go to end of line -bindkey '^[[4~' end-of-line # [End] - Go to end of line -bindkey '^[OF' end-of-line # [End] - Go to end of line +bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line +bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line bindkey ' ' magic-space # [Space] - do history expansion bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word -bindkey '^[[Z' reverse-menu-complete # [TODO] - Perform menu completion, like menu-complete, except that if a menu completion is already in progress, move to the previous completion rather than the next. +bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards -# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~ -bindkey '^?' backward-delete-char # [Delete] - delete backward -bindkey '^[[3~' delete-char # [fn-Delete] - delete forward -bindkey '^[3;5~' delete-char # [TODO] - delete forward -bindkey '\e[3~' delete-char # [TODO] - delete forward +bindkey '^?' backward-delete-char # [Backspace] - delete backward +bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward # consider emacs keybindings: From ebeae4abe9b3ef2e626eb545e991bb5696c57de0 Mon Sep 17 00:00:00 2001 From: Sergey Lukin Date: Fri, 9 Nov 2012 23:53:22 +0200 Subject: [PATCH 15/94] Fix /bin/sh compatibility issue in install.sh --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index b080be3a1..0558c96ce 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -36,4 +36,4 @@ echo "\033[0;32m"' /____/ '"\033[0m echo "\n\n \033[0;32m....is now installed.\033[0m" /usr/bin/env zsh -source ~/.zshrc +. ~/.zshrc From 46ad7338333b57ce5966ca481d132d8626304d83 Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Tue, 18 Dec 2012 08:16:28 +0000 Subject: [PATCH 16/94] more catspeak --- plugins/lol/lol.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index ae065c12f..3b92533a8 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -36,3 +36,12 @@ alias nomnom='killall' alias byes='exit' alias cya='reboot' alias kthxbai='halt' + +alias pwned='ssh' + +alias hackzor='git init' +alias rulz='git push' +alias bringz='git pull' +alias moarhack='git checkout' +alias chicken='git add' + From c95b6d91f7e45ac4ca9a1ce2207db7d515ba450b Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Tue, 18 Dec 2012 08:47:04 +0000 Subject: [PATCH 17/94] git lol --- plugins/lol/lol.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh index 3b92533a8..1b32ec2e4 100644 --- a/plugins/lol/lol.plugin.zsh +++ b/plugins/lol/lol.plugin.zsh @@ -42,6 +42,9 @@ alias pwned='ssh' alias hackzor='git init' alias rulz='git push' alias bringz='git pull' -alias moarhack='git checkout' alias chicken='git add' +alias oanward='git commit -m' +alias ooanward='git commit -am' +alias letcat='git checkout' +alias violenz='git rebase' From ae1973de443525daeb87df9973ae83c6c9210cfe Mon Sep 17 00:00:00 2001 From: Ron Shapiro Date: Mon, 29 Apr 2013 10:18:32 -0400 Subject: [PATCH 18/94] plugged_in function --- plugins/battery/battery.plugin.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 0c7c9421f..785386a12 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -16,12 +16,16 @@ if [[ $(uname) == "Darwin" ]] ; then integer i=$(((currentcapacity/maxcapacity) * 100)) echo $i } + + function plugged_in() { + [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ] + } function battery_pct_remaining() { - if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then - battery_pct - else + if plugged_in ; then echo "External Power" + else + battery_pct fi } From 9ebdbec58979b077e4790387b5927c74ce7184ef Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 23 Aug 2013 21:58:29 -0500 Subject: [PATCH 19/94] gitfast: update to upstream v1.8.4 Signed-off-by: Felipe Contreras --- plugins/gitfast/_git | 163 +++++++++++-- plugins/gitfast/git-completion.bash | 301 ++++++++--------------- plugins/gitfast/git-prompt.sh | 362 ++++++++++++++++------------ 3 files changed, 449 insertions(+), 377 deletions(-) diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index cf8116d47..fac5e711e 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -2,18 +2,19 @@ # zsh completion wrapper for git # -# You need git's bash completion script installed somewhere, by default on the -# same directory as this script. +# Copyright (c) 2012-2013 Felipe Contreras # -# If your script is on ~/.git-completion.sh instead, you can configure it on -# your ~/.zshrc: +# You need git's bash completion script installed somewhere, by default it +# would be the location bash-completion uses. +# +# If your script is somewhere else, you can configure it on your ~/.zshrc: # # zstyle ':completion:*:*:git:*' script ~/.git-completion.sh # -# The recommended way to install this script is to copy to -# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file: +# The recommended way to install this script is to copy to '~/.zsh/_git', and +# then add the following to your ~/.zshrc file: # -# fpath=(~/.zsh/completion $fpath) +# fpath=(~/.zsh $fpath) complete () { @@ -21,8 +22,23 @@ complete () return 0 } +zstyle -T ':completion:*:*:git:*' tag-order && \ + zstyle ':completion:*:*:git:*' tag-order 'common-commands' + zstyle -s ":completion:*:*:git:*" script script -test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash +if [ -z "$script" ]; then + local -a locations + local e + locations=( + '/etc/bash_completion.d/git' # fedora, old debian + '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian + '/usr/share/bash-completion/git' # gentoo + $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash + ) + for e in $locations; do + test -f $e && script="$e" && break + done +fi ZSH_VERSION='' . "$script" __gitcomp () @@ -69,18 +85,131 @@ __gitcomp_file () compadd -Q -p "${2-}" -f -- ${=1} && _ret=0 } +__git_zsh_bash_func () +{ + emulate -L ksh + + local command=$1 + + local completion_func="_git_${command//-/_}" + declare -f $completion_func >/dev/null && $completion_func && return + + local expansion=$(__git_aliased_command "$command") + if [ -n "$expansion" ]; then + completion_func="_git_${expansion//-/_}" + declare -f $completion_func >/dev/null && $completion_func + fi +} + +__git_zsh_cmd_common () +{ + local -a list + list=( + add:'add file contents to the index' + bisect:'find by binary search the change that introduced a bug' + branch:'list, create, or delete branches' + checkout:'checkout a branch or paths to the working tree' + clone:'clone a repository into a new directory' + commit:'record changes to the repository' + diff:'show changes between commits, commit and working tree, etc' + fetch:'download objects and refs from another repository' + grep:'print lines matching a pattern' + init:'create an empty Git repository or reinitialize an existing one' + log:'show commit logs' + merge:'join two or more development histories together' + mv:'move or rename a file, a directory, or a symlink' + pull:'fetch from and merge with another repository or a local branch' + push:'update remote refs along with associated objects' + rebase:'forward-port local commits to the updated upstream head' + reset:'reset current HEAD to the specified state' + rm:'remove files from the working tree and from the index' + show:'show various types of objects' + status:'show the working tree status' + tag:'create, list, delete or verify a tag object signed with GPG') + _describe -t common-commands 'common commands' list && _ret=0 +} + +__git_zsh_cmd_alias () +{ + local -a list + list=(${${${(0)"$(git config -z --get-regexp '^alias\.')"}#alias.}%$'\n'*}) + _describe -t alias-commands 'aliases' list $* && _ret=0 +} + +__git_zsh_cmd_all () +{ + local -a list + emulate ksh -c __git_compute_all_commands + list=( ${=__git_all_commands} ) + _describe -t all-commands 'all commands' list && _ret=0 +} + +__git_zsh_main () +{ + local curcontext="$curcontext" state state_descr line + typeset -A opt_args + local -a orig_words + + orig_words=( ${words[@]} ) + + _arguments -C \ + '(-p --paginate --no-pager)'{-p,--paginate}'[pipe all output into ''less'']' \ + '(-p --paginate)--no-pager[do not pipe git output into a pager]' \ + '--git-dir=-[set the path to the repository]: :_directories' \ + '--bare[treat the repository as a bare repository]' \ + '(- :)--version[prints the git suite version]' \ + '--exec-path=-[path to where your core git programs are installed]:: :_directories' \ + '--html-path[print the path where git''s HTML documentation is installed]' \ + '--info-path[print the path where the Info files are installed]' \ + '--man-path[print the manpath (see `man(1)`) for the man pages]' \ + '--work-tree=-[set the path to the working tree]: :_directories' \ + '--namespace=-[set the git namespace]' \ + '--no-replace-objects[do not use replacement refs to replace git objects]' \ + '(- :)--help[prints the synopsis and a list of the most commonly used commands]: :->arg' \ + '(-): :->command' \ + '(-)*:: :->arg' && return + + case $state in + (command) + _alternative \ + 'alias-commands:alias:__git_zsh_cmd_alias' \ + 'common-commands:common:__git_zsh_cmd_common' \ + 'all-commands:all:__git_zsh_cmd_all' && _ret=0 + ;; + (arg) + local command="${words[1]}" __git_dir + + if (( $+opt_args[--bare] )); then + __git_dir='.' + else + __git_dir=${opt_args[--git-dir]} + fi + + (( $+opt_args[--help] )) && command='help' + + words=( ${orig_words[@]} ) + + __git_zsh_bash_func $command + ;; + esac +} + _git () { local _ret=1 - () { - emulate -L ksh - local cur cword prev - cur=${words[CURRENT-1]} - prev=${words[CURRENT-2]} - let cword=CURRENT-1 - __${service}_main - } - let _ret && _default -S '' && _ret=0 + local cur cword prev + + cur=${words[CURRENT]} + prev=${words[CURRENT-1]} + let cword=CURRENT-1 + + if (( $+functions[__${service}_zsh_main] )); then + __${service}_zsh_main + else + emulate ksh -c __${service}_main + fi + + let _ret && _default && _ret=0 return _ret } diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 93eba4675..5da920ecd 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -33,8 +33,6 @@ esac # returns location of .git repo __gitdir () { - # Note: this function is duplicated in git-prompt.sh - # When updating it, make sure you update the other one to match. if [ -z "${1-}" ]; then if [ -n "${__git_dir-}" ]; then echo "$__git_dir" @@ -53,19 +51,6 @@ __gitdir () fi } -__gitcomp_1 () -{ - local c IFS=$' \t\n' - for c in $1; do - c="$c$2" - case $c in - --*=*|*.) ;; - *) c="$c " ;; - esac - printf '%s\n' "$c" - done -} - # The following function is based on code from: # # bash_completion - programmable completion functions for bash 3.2+ @@ -195,8 +180,18 @@ _get_comp_words_by_ref () } fi -# Generates completion reply with compgen, appending a space to possible -# completion words, if necessary. +__gitcompadd () +{ + local i=0 + for x in $1; do + if [[ "$x" == "$3"* ]]; then + COMPREPLY[i++]="$2$x$4" + fi + done +} + +# Generates completion reply, appending a space to possible completion words, +# if necessary. # It accepts 1 to 4 arguments: # 1: List of possible completion words. # 2: A prefix to be added to each possible completion word (optional). @@ -208,19 +203,25 @@ __gitcomp () case "$cur_" in --*=) - COMPREPLY=() ;; *) - local IFS=$'\n' - COMPREPLY=($(compgen -P "${2-}" \ - -W "$(__gitcomp_1 "${1-}" "${4-}")" \ - -- "$cur_")) + local c i=0 IFS=$' \t\n' + for c in $1; do + c="$c${4-}" + if [[ $c == "$cur_"* ]]; then + case $c in + --*=*|*.) ;; + *) c="$c " ;; + esac + COMPREPLY[i++]="${2-}$c" + fi + done ;; esac } -# Generates completion reply with compgen from newline-separated possible -# completion words by appending a space to all of them. +# Generates completion reply from newline-separated possible completion words +# by appending a space to all of them. # It accepts 1 to 4 arguments: # 1: List of possible completion words, separated by a single newline. # 2: A prefix to be added to each possible completion word (optional). @@ -231,7 +232,7 @@ __gitcomp () __gitcomp_nl () { local IFS=$'\n' - COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}")) + __gitcompadd "$1" "${2-}" "${3-$cur}" "${4- }" } # Generates completion reply with compgen from newline-separated possible @@ -249,106 +250,50 @@ __gitcomp_file () # since tilde expansion is not applied. # This means that COMPREPLY will be empty and Bash default # completion will be used. - COMPREPLY=($(compgen -P "${2-}" -W "$1" -- "${3-$cur}")) + __gitcompadd "$1" "${2-}" "${3-$cur}" "" - # Tell Bash that compspec generates filenames. - compopt -o filenames 2>/dev/null + # use a hack to enable file mode in bash < 4 + compopt -o filenames +o nospace 2>/dev/null || + compgen -f /non-existing-dir/ > /dev/null } -__git_index_file_list_filter_compat () -{ - local path - - while read -r path; do - case "$path" in - ?*/*) echo "${path%%/*}/" ;; - *) echo "$path" ;; - esac - done -} - -__git_index_file_list_filter_bash () -{ - local path - - while read -r path; do - case "$path" in - ?*/*) - # XXX if we append a slash to directory names when using - # `compopt -o filenames`, Bash will append another slash. - # This is pretty stupid, and this the reason why we have to - # define a compatible version for this function. - echo "${path%%/*}" ;; - *) - echo "$path" ;; - esac - done -} - -# Process path list returned by "ls-files" and "diff-index --name-only" -# commands, in order to list only file names relative to a specified -# directory, and append a slash to directory names. -__git_index_file_list_filter () -{ - # Default to Bash >= 4.x - __git_index_file_list_filter_bash -} - -# Execute git ls-files, returning paths relative to the directory -# specified in the first argument, and using the options specified in -# the second argument. +# Execute 'git ls-files', unless the --committable option is specified, in +# which case it runs 'git diff-index' to find out the files that can be +# committed. It return paths relative to the directory specified in the first +# argument, and using the options specified in the second argument. __git_ls_files_helper () { ( test -n "${CDPATH+set}" && unset CDPATH - # NOTE: $2 is not quoted in order to support multiple options - cd "$1" && git ls-files --exclude-standard $2 + cd "$1" + if [ "$2" == "--committable" ]; then + git diff-index --name-only --relative HEAD + else + # NOTE: $2 is not quoted in order to support multiple options + git ls-files --exclude-standard $2 + fi ) 2>/dev/null } -# Execute git diff-index, returning paths relative to the directory -# specified in the first argument, and using the tree object id -# specified in the second argument. -__git_diff_index_helper () -{ - ( - test -n "${CDPATH+set}" && unset CDPATH - cd "$1" && git diff-index --name-only --relative "$2" - ) 2>/dev/null -} - # __git_index_files accepts 1 or 2 arguments: # 1: Options to pass to ls-files (required). -# Supported options are --cached, --modified, --deleted, --others, -# and --directory. # 2: A directory path (optional). # If provided, only files within the specified directory are listed. # Sub directories are never recursed. Path must have a trailing # slash. __git_index_files () { - local dir="$(__gitdir)" root="${2-.}" + local dir="$(__gitdir)" root="${2-.}" file if [ -d "$dir" ]; then - __git_ls_files_helper "$root" "$1" | __git_index_file_list_filter | - sort | uniq - fi -} - -# __git_diff_index_files accepts 1 or 2 arguments: -# 1) The id of a tree object. -# 2) A directory path (optional). -# If provided, only files within the specified directory are listed. -# Sub directories are never recursed. Path must have a trailing -# slash. -__git_diff_index_files () -{ - local dir="$(__gitdir)" root="${2-.}" - - if [ -d "$dir" ]; then - __git_diff_index_helper "$root" "$1" | __git_index_file_list_filter | - sort | uniq + __git_ls_files_helper "$root" "$1" | + while read -r file; do + case "$file" in + ?*/*) echo "${file%%/*}" ;; + *) echo "$file" ;; + esac + done | sort | uniq fi } @@ -424,14 +369,8 @@ __git_refs () done ;; *) - git ls-remote "$dir" HEAD ORIG_HEAD 'refs/tags/*' 'refs/heads/*' 'refs/remotes/*' 2>/dev/null | \ - while read -r hash i; do - case "$i" in - *^{}) ;; - refs/*) echo "${i#refs/*/}" ;; - *) echo "$i" ;; - esac - done + echo "HEAD" + git for-each-ref --format="%(refname:short)" -- "refs/remotes/$dir/" | sed -e "s#^$dir/##" ;; esac } @@ -549,44 +488,23 @@ __git_complete_revlist_file () } -# __git_complete_index_file requires 1 argument: the options to pass to -# ls-file +# __git_complete_index_file requires 1 argument: +# 1: the options to pass to ls-file +# +# The exception is --committable, which finds the files appropriate commit. __git_complete_index_file () { - local pfx cur_="$cur" + local pfx="" cur_="$cur" case "$cur_" in ?*/*) pfx="${cur_%/*}" cur_="${cur_##*/}" pfx="${pfx}/" - - __gitcomp_file "$(__git_index_files "$1" "$pfx")" "$pfx" "$cur_" - ;; - *) - __gitcomp_file "$(__git_index_files "$1")" "" "$cur_" ;; esac -} -# __git_complete_diff_index_file requires 1 argument: the id of a tree -# object -__git_complete_diff_index_file () -{ - local pfx cur_="$cur" - - case "$cur_" in - ?*/*) - pfx="${cur_%/*}" - cur_="${cur_##*/}" - pfx="${pfx}/" - - __gitcomp_file "$(__git_diff_index_files "$1" "$pfx")" "$pfx" "$cur_" - ;; - *) - __gitcomp_file "$(__git_diff_index_files "$1")" "" "$cur_" - ;; - esac + __gitcomp_file "$(__git_index_files "$1" "$pfx")" "$pfx" "$cur_" } __git_complete_file () @@ -614,7 +532,6 @@ __git_complete_remote_or_refspec () case "$cmd" in push) no_complete_refspec=1 ;; fetch) - COMPREPLY=() return ;; *) ;; @@ -630,7 +547,6 @@ __git_complete_remote_or_refspec () return fi if [ $no_complete_refspec = 1 ]; then - COMPREPLY=() return fi [ "$remote" = "." ] && remote= @@ -732,6 +648,7 @@ __git_list_porcelain_commands () cat-file) : plumbing;; check-attr) : plumbing;; check-ignore) : plumbing;; + check-mailmap) : plumbing;; check-ref-format) : plumbing;; checkout-index) : plumbing;; commit-tree) : plumbing;; @@ -951,7 +868,6 @@ _git_am () " return esac - COMPREPLY=() } _git_apply () @@ -971,7 +887,6 @@ _git_apply () " return esac - COMPREPLY=() } _git_add () @@ -1031,7 +946,6 @@ _git_bisect () __gitcomp_nl "$(__git_refs)" ;; *) - COMPREPLY=() ;; esac } @@ -1124,9 +1038,14 @@ _git_cherry () _git_cherry_pick () { + local dir="$(__gitdir)" + if [ -f "$dir"/CHERRY_PICK_HEAD ]; then + __gitcomp "--continue --quit --abort" + return + fi case "$cur" in --*) - __gitcomp "--edit --no-commit" + __gitcomp "--edit --no-commit --signoff --strategy= --mainline" ;; *) __gitcomp_nl "$(__git_refs)" @@ -1170,7 +1089,6 @@ _git_clone () return ;; esac - COMPREPLY=() } _git_commit () @@ -1182,13 +1100,6 @@ _git_commit () ;; esac - case "$prev" in - -c|-C) - __gitcomp_nl "$(__git_refs)" "" "${cur}" - return - ;; - esac - case "$cur" in --cleanup=*) __gitcomp "default strip verbatim whitespace @@ -1218,7 +1129,7 @@ _git_commit () esac if git rev-parse --verify --quiet HEAD >/dev/null; then - __git_complete_diff_index_file "HEAD" + __git_complete_index_file "--committable" else # This is the first commit __git_complete_index_file "--cached" @@ -1251,7 +1162,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary --no-prefix --src-prefix= --dst-prefix= --inter-hunk-context= --patience --histogram --minimal - --raw + --raw --word-diff --dirstat --dirstat= --dirstat-by-file --dirstat-by-file= --cumulative --diff-algorithm= @@ -1299,7 +1210,7 @@ _git_difftool () return ;; esac - __git_complete_file + __git_complete_revlist_file } __git_fetch_options=" @@ -1319,11 +1230,12 @@ _git_fetch () } __git_format_patch_options=" - --stdout --attach --no-attach --thread --thread= --output-directory + --stdout --attach --no-attach --thread --thread= --no-thread --numbered --start-number --numbered-files --keep-subject --signoff --signature --no-signature --in-reply-to= --cc= --full-index --binary --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix= --inline --suffix= --ignore-if-in-upstream --subject-prefix= + --output-directory --reroll-count --to= --quiet --notes " _git_format_patch () @@ -1354,7 +1266,6 @@ _git_fsck () return ;; esac - COMPREPLY=() } _git_gc () @@ -1365,7 +1276,6 @@ _git_gc () return ;; esac - COMPREPLY=() } _git_gitk () @@ -1442,7 +1352,6 @@ _git_init () return ;; esac - COMPREPLY=() } _git_ls_files () @@ -1578,7 +1487,6 @@ _git_mergetool () return ;; esac - COMPREPLY=() } _git_merge_base () @@ -1819,7 +1727,7 @@ __git_config_get_set_variables () _git_config () { case "$prev" in - branch.*.remote) + branch.*.remote|branch.*.pushremote) __gitcomp_nl "$(__git_remotes)" return ;; @@ -1827,11 +1735,19 @@ _git_config () __gitcomp_nl "$(__git_refs)" return ;; + branch.*.rebase) + __gitcomp "false true" + return + ;; + remote.pushdefault) + __gitcomp_nl "$(__git_remotes)" + return + ;; remote.*.fetch) local remote="${prev#remote.}" remote="${remote%.fetch}" if [ -z "$cur" ]; then - COMPREPLY=("refs/heads/") + __gitcomp_nl "refs/heads/" "" "" "" return fi __gitcomp_nl "$(__git_refs_remotes "$remote")" @@ -1866,6 +1782,10 @@ _git_config () " return ;; + diff.submodule) + __gitcomp "log short" + return + ;; help.format) __gitcomp "man info web html" return @@ -1891,7 +1811,6 @@ _git_config () return ;; *.*) - COMPREPLY=() return ;; esac @@ -1908,7 +1827,7 @@ _git_config () ;; branch.*.*) local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "remote merge mergeoptions rebase" "$pfx" "$cur_" + __gitcomp "remote pushremote merge mergeoptions rebase" "$pfx" "$cur_" return ;; branch.*) @@ -2039,7 +1958,6 @@ _git_config () core.fileMode core.fsyncobjectfiles core.gitProxy - core.ignoreCygwinFSTricks core.ignoreStat core.ignorecase core.logAllRefUpdates @@ -2061,13 +1979,14 @@ _git_config () core.whitespace core.worktree diff.autorefreshindex - diff.statGraphWidth diff.external diff.ignoreSubmodules diff.mnemonicprefix diff.noprefix diff.renameLimit diff.renames + diff.statGraphWidth + diff.submodule diff.suppressBlankEmpty diff.tool diff.wordRegex @@ -2202,6 +2121,7 @@ _git_config () receive.fsckObjects receive.unpackLimit receive.updateserverinfo + remote.pushdefault remotes. repack.usedeltabaseoffset rerere.autoupdate @@ -2272,7 +2192,6 @@ _git_remote () __gitcomp "$c" ;; *) - COMPREPLY=() ;; esac } @@ -2356,7 +2275,7 @@ _git_show () return ;; esac - __git_complete_file + __git_complete_revlist_file } _git_show_branch () @@ -2388,8 +2307,6 @@ _git_stash () *) if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then __gitcomp "$subcommands" - else - COMPREPLY=() fi ;; esac @@ -2402,14 +2319,12 @@ _git_stash () __gitcomp "--index --quiet" ;; show,--*|drop,--*|branch,--*) - COMPREPLY=() ;; show,*|apply,*|drop,*|pop,*|branch,*) __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ | sed -n -e 's/:.*//p')" ;; *) - COMPREPLY=() ;; esac fi @@ -2419,7 +2334,7 @@ _git_submodule () { __git_has_doubledash && return - local subcommands="add status init update summary foreach sync" + local subcommands="add status init deinit update summary foreach sync" if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then case "$cur" in --*) @@ -2451,7 +2366,7 @@ _git_svn () --no-metadata --use-svm-props --use-svnsync-props --log-window-size= --no-checkout --quiet --repack-flags --use-log-author --localtime - --ignore-paths= $remote_opts + --ignore-paths= --include-paths= $remote_opts " local init_opts=" --template= --shared= --trunk= --tags= @@ -2526,7 +2441,6 @@ _git_svn () __gitcomp "--revision= --parent" ;; *) - COMPREPLY=() ;; esac fi @@ -2551,13 +2465,10 @@ _git_tag () case "$prev" in -m|-F) - COMPREPLY=() ;; -*|tag) if [ $f = 1 ]; then __gitcomp_nl "$(__git_tags)" - else - COMPREPLY=() fi ;; *) @@ -2579,9 +2490,10 @@ __git_main () i="${words[c]}" case "$i" in --git-dir=*) __git_dir="${i#--git-dir=}" ;; + --git-dir) ((c++)) ; __git_dir="${words[c]}" ;; --bare) __git_dir="." ;; --help) command="help"; break ;; - -c) c=$((++c)) ;; + -c|--work-tree|--namespace) ((c++)) ;; -*) ;; *) command="$i"; break ;; esac @@ -2599,6 +2511,7 @@ __git_main () --exec-path --exec-path= --html-path + --man-path --info-path --work-tree= --namespace= @@ -2693,35 +2606,19 @@ if [[ -n ${ZSH_VERSION-} ]]; then compadd -Q -p "${2-}" -f -- ${=1} && _ret=0 } - __git_zsh_helper () - { - emulate -L ksh - local cur cword prev - cur=${words[CURRENT-1]} - prev=${words[CURRENT-2]} - let cword=CURRENT-1 - __${service}_main - } - _git () { - emulate -L zsh - local _ret=1 - __git_zsh_helper - let _ret && _default -S '' && _ret=0 + local _ret=1 cur cword prev + cur=${words[CURRENT]} + prev=${words[CURRENT-1]} + let cword=CURRENT-1 + emulate ksh -c __${service}_main + let _ret && _default && _ret=0 return _ret } compdef _git git gitk return -elif [[ -n ${BASH_VERSION-} ]]; then - if ((${BASH_VERSINFO[0]} < 4)); then - # compopt is not supported - __git_index_file_list_filter () - { - __git_index_file_list_filter_compat - } - fi fi __git_func_wrap () diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh index 65f8368f1..a81ef5a48 100644 --- a/plugins/gitfast/git-prompt.sh +++ b/plugins/gitfast/git-prompt.sh @@ -3,7 +3,7 @@ # Copyright (C) 2006,2007 Shawn O. Pearce # Distributed under the GNU General Public License, version 2.0. # -# This script allows you to see the current branch in your prompt. +# This script allows you to see repository status in your prompt. # # To enable: # @@ -13,23 +13,27 @@ # 3a) Change your PS1 to call __git_ps1 as # command-substitution: # Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' -# ZSH: PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ ' +# ZSH: setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ ' # the optional argument will be used as format string. -# 3b) Alternatively, if you are using bash, __git_ps1 can be -# used for PROMPT_COMMAND with two parameters,
 and
-#        , which are strings you would put in $PS1 before
-#        and after the status string generated by the git-prompt
-#        machinery.  e.g.
-#           PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
-#        will show username, at-sign, host, colon, cwd, then
-#        various status string, followed by dollar and SP, as
-#        your prompt.
+#    3b) Alternatively, for a slightly faster prompt, __git_ps1 can
+#        be used for PROMPT_COMMAND in Bash or for precmd() in Zsh
+#        with two parameters, 
 and , which are strings
+#        you would put in $PS1 before and after the status string
+#        generated by the git-prompt machinery.  e.g.
+#        Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
+#          will show username, at-sign, host, colon, cwd, then
+#          various status string, followed by dollar and SP, as
+#          your prompt.
+#        ZSH:  precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
+#          will show username, pipe, then various status string,
+#          followed by colon, cwd, dollar and SP, as your prompt.
 #        Optionally, you can supply a third argument with a printf
 #        format string to finetune the output of the branch status
 #
-# The argument to __git_ps1 will be displayed only if you are currently
-# in a git repository.  The %s token will be the name of the current
-# branch.
+# The repository status will be displayed only if you are currently in a
+# git repository. The %s token is the placeholder for the shown status.
+#
+# The prompt status always includes the current branch name.
 #
 # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
 # unstaged (*) and staged (+) changes will be shown next to the branch
@@ -77,31 +81,8 @@
 #
 # If you would like a colored hint about the current dirty state, set
 # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
-# the colored output of "git status -sb".
-
-# __gitdir accepts 0 or 1 arguments (i.e., location)
-# returns location of .git repo
-__gitdir ()
-{
-	# Note: this function is duplicated in git-completion.bash
-	# When updating it, make sure you update the other one to match.
-	if [ -z "${1-}" ]; then
-		if [ -n "${__git_dir-}" ]; then
-			echo "$__git_dir"
-		elif [ -n "${GIT_DIR-}" ]; then
-			test -d "${GIT_DIR-}" || return 1
-			echo "$GIT_DIR"
-		elif [ -d .git ]; then
-			echo .git
-		else
-			git rev-parse --git-dir 2>/dev/null
-		fi
-	elif [ -d "$1/.git" ]; then
-		echo "$1/.git"
-	else
-		echo "$1"
-	fi
-}
+# the colored output of "git status -sb" and are available only when
+# using __git_ps1 for PROMPT_COMMAND or precmd.
 
 # stores the divergence from upstream in $p
 # used by GIT_PS1_SHOWUPSTREAM
@@ -124,7 +105,7 @@ __git_ps1_show_upstream ()
 			fi
 			;;
 		svn-remote.*.url)
-			svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
+			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
 			svn_url_pattern+="\\|$value"
 			upstream=svn+git # default upstream is SVN if available, else git
 			;;
@@ -146,10 +127,11 @@ __git_ps1_show_upstream ()
 	svn*)
 		# get the upstream from the "git-svn-id: ..." in a commit message
 		# (git-svn uses essentially the same procedure internally)
-		local svn_upstream=($(git log --first-parent -1 \
+		local -a svn_upstream
+		svn_upstream=($(git log --first-parent -1 \
 					--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null))
 		if [[ 0 -ne ${#svn_upstream[@]} ]]; then
-			svn_upstream=${svn_upstream[ ${#svn_upstream[@]} - 2 ]}
+			svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]}
 			svn_upstream=${svn_upstream%@*}
 			local n_stop="${#svn_remote[@]}"
 			for ((n=1; n <= n_stop; n++)); do
@@ -222,6 +204,51 @@ __git_ps1_show_upstream ()
 
 }
 
+# Helper function that is meant to be called from __git_ps1.  It
+# injects color codes into the appropriate gitstring variables used
+# to build a gitstring.
+__git_ps1_colorize_gitstring ()
+{
+	if [[ -n ${ZSH_VERSION-} ]]; then
+		local c_red='%F{red}'
+		local c_green='%F{green}'
+		local c_lblue='%F{blue}'
+		local c_clear='%f'
+	else
+		# Using \[ and \] around colors is necessary to prevent
+		# issues with command line editing/browsing/completion!
+		local c_red='\[\e[31m\]'
+		local c_green='\[\e[32m\]'
+		local c_lblue='\[\e[1;34m\]'
+		local c_clear='\[\e[0m\]'
+	fi
+	local bad_color=$c_red
+	local ok_color=$c_green
+	local flags_color="$c_lblue"
+
+	local branch_color=""
+	if [ $detached = no ]; then
+		branch_color="$ok_color"
+	else
+		branch_color="$bad_color"
+	fi
+	c="$branch_color$c"
+
+	z="$c_clear$z"
+	if [ "$w" = "*" ]; then
+		w="$bad_color$w"
+	fi
+	if [ -n "$i" ]; then
+		i="$ok_color$i"
+	fi
+	if [ -n "$s" ]; then
+		s="$flags_color$s"
+	fi
+	if [ -n "$u" ]; then
+		u="$bad_color$u"
+	fi
+	r="$c_clear$r"
+}
 
 # __git_ps1 accepts 0 or 1 arguments (i.e., format string)
 # when called from PS1 using command substitution
@@ -254,39 +281,83 @@ __git_ps1 ()
 		;;
 	esac
 
-	local g="$(__gitdir)"
-	if [ -z "$g" ]; then
+	local repo_info rev_parse_exit_code
+	repo_info="$(git rev-parse --git-dir --is-inside-git-dir \
+		--is-bare-repository --is-inside-work-tree \
+		--short HEAD 2>/dev/null)"
+	rev_parse_exit_code="$?"
+
+	if [ -z "$repo_info" ]; then
 		if [ $pcmode = yes ]; then
 			#In PC mode PS1 always needs to be set
 			PS1="$ps1pc_start$ps1pc_end"
 		fi
-	else
-		local r=""
-		local b=""
+		return
+	fi
+
+	local short_sha
+	if [ "$rev_parse_exit_code" = "0" ]; then
+		short_sha="${repo_info##*$'\n'}"
+		repo_info="${repo_info%$'\n'*}"
+	fi
+	local inside_worktree="${repo_info##*$'\n'}"
+	repo_info="${repo_info%$'\n'*}"
+	local bare_repo="${repo_info##*$'\n'}"
+	repo_info="${repo_info%$'\n'*}"
+	local inside_gitdir="${repo_info##*$'\n'}"
+	local g="${repo_info%$'\n'*}"
+
+	local r=""
+	local b=""
+	local step=""
+	local total=""
+	if [ -d "$g/rebase-merge" ]; then
+		read b 2>/dev/null <"$g/rebase-merge/head-name"
+		read step 2>/dev/null <"$g/rebase-merge/msgnum"
+		read total 2>/dev/null <"$g/rebase-merge/end"
 		if [ -f "$g/rebase-merge/interactive" ]; then
 			r="|REBASE-i"
-			b="$(cat "$g/rebase-merge/head-name")"
-		elif [ -d "$g/rebase-merge" ]; then
-			r="|REBASE-m"
-			b="$(cat "$g/rebase-merge/head-name")"
 		else
-			if [ -d "$g/rebase-apply" ]; then
-				if [ -f "$g/rebase-apply/rebasing" ]; then
-					r="|REBASE"
-				elif [ -f "$g/rebase-apply/applying" ]; then
-					r="|AM"
-				else
-					r="|AM/REBASE"
-				fi
-			elif [ -f "$g/MERGE_HEAD" ]; then
-				r="|MERGING"
-			elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
-				r="|CHERRY-PICKING"
-			elif [ -f "$g/BISECT_LOG" ]; then
-				r="|BISECTING"
+			r="|REBASE-m"
+		fi
+	else
+		if [ -d "$g/rebase-apply" ]; then
+			read step 2>/dev/null <"$g/rebase-apply/next"
+			read total 2>/dev/null <"$g/rebase-apply/last"
+			if [ -f "$g/rebase-apply/rebasing" ]; then
+				read b 2>/dev/null <"$g/rebase-apply/head-name"
+				r="|REBASE"
+			elif [ -f "$g/rebase-apply/applying" ]; then
+				r="|AM"
+			else
+				r="|AM/REBASE"
 			fi
+		elif [ -f "$g/MERGE_HEAD" ]; then
+			r="|MERGING"
+		elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
+			r="|CHERRY-PICKING"
+		elif [ -f "$g/REVERT_HEAD" ]; then
+			r="|REVERTING"
+		elif [ -f "$g/BISECT_LOG" ]; then
+			r="|BISECTING"
+		fi
 
-			b="$(git symbolic-ref HEAD 2>/dev/null)" || {
+		if [ -n "$b" ]; then
+			:
+		elif [ -h "$g/HEAD" ]; then
+			# symlink symbolic ref
+			b="$(git symbolic-ref HEAD 2>/dev/null)"
+		else
+			local head=""
+			if ! read head 2>/dev/null <"$g/HEAD"; then
+				if [ $pcmode = yes ]; then
+					PS1="$ps1pc_start$ps1pc_end"
+				fi
+				return
+			fi
+			# is it a symbolic ref?
+			b="${head#ref: }"
+			if [ "$head" = "$b" ]; then
 				detached=yes
 				b="$(
 				case "${GIT_PS1_DESCRIBE_STYLE-}" in
@@ -300,100 +371,75 @@ __git_ps1 ()
 					git describe --tags --exact-match HEAD ;;
 				esac 2>/dev/null)" ||
 
-				b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." ||
-				b="unknown"
+				b="$short_sha..."
 				b="($b)"
-			}
-		fi
-
-		local w=""
-		local i=""
-		local s=""
-		local u=""
-		local c=""
-		local p=""
-
-		if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
-			if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
-				c="BARE:"
-			else
-				b="GIT_DIR!"
 			fi
-		elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
-			if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
-			   [ "$(git config --bool bash.showDirtyState)" != "false" ]
-			then
-				git diff --no-ext-diff --quiet --exit-code || w="*"
-				if git rev-parse --quiet --verify HEAD >/dev/null; then
-					git diff-index --cached --quiet HEAD -- || i="+"
-				else
-					i="#"
-				fi
-			fi
-			if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then
-				git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$"
-			fi
-
-			if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
-			   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
-			   [ -n "$(git ls-files --others --exclude-standard)" ]
-			then
-				u="%%"
-			fi
-
-			if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
-				__git_ps1_show_upstream
-			fi
-		fi
-
-		local f="$w$i$s$u"
-		if [ $pcmode = yes ]; then
-			local gitstring=
-			if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
-				local c_red='\e[31m'
-				local c_green='\e[32m'
-				local c_lblue='\e[1;34m'
-				local c_clear='\e[0m'
-				local bad_color=$c_red
-				local ok_color=$c_green
-				local branch_color="$c_clear"
-				local flags_color="$c_lblue"
-				local branchstring="$c${b##refs/heads/}"
-
-				if [ $detached = no ]; then
-					branch_color="$ok_color"
-				else
-					branch_color="$bad_color"
-				fi
-
-				# Setting gitstring directly with \[ and \] around colors
-				# is necessary to prevent wrapping issues!
-				gitstring="\[$branch_color\]$branchstring\[$c_clear\]"
-
-				if [ -n "$w$i$s$u$r$p" ]; then
-					gitstring="$gitstring "
-				fi
-				if [ "$w" = "*" ]; then
-					gitstring="$gitstring\[$bad_color\]$w"
-				fi
-				if [ -n "$i" ]; then
-					gitstring="$gitstring\[$ok_color\]$i"
-				fi
-				if [ -n "$s" ]; then
-					gitstring="$gitstring\[$flags_color\]$s"
-				fi
-				if [ -n "$u" ]; then
-					gitstring="$gitstring\[$bad_color\]$u"
-				fi
-				gitstring="$gitstring\[$c_clear\]$r$p"
-			else
-				gitstring="$c${b##refs/heads/}${f:+ $f}$r$p"
-			fi
-			gitstring=$(printf -- "$printf_format" "$gitstring")
-			PS1="$ps1pc_start$gitstring$ps1pc_end"
-		else
-			# NO color option unless in PROMPT_COMMAND mode
-			printf -- "$printf_format" "$c${b##refs/heads/}${f:+ $f}$r$p"
 		fi
 	fi
+
+	if [ -n "$step" ] && [ -n "$total" ]; then
+		r="$r $step/$total"
+	fi
+
+	local w=""
+	local i=""
+	local s=""
+	local u=""
+	local c=""
+	local p=""
+
+	if [ "true" = "$inside_gitdir" ]; then
+		if [ "true" = "$bare_repo" ]; then
+			c="BARE:"
+		else
+			b="GIT_DIR!"
+		fi
+	elif [ "true" = "$inside_worktree" ]; then
+		if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
+		   [ "$(git config --bool bash.showDirtyState)" != "false" ]
+		then
+			git diff --no-ext-diff --quiet --exit-code || w="*"
+			if [ -n "$short_sha" ]; then
+				git diff-index --cached --quiet HEAD -- || i="+"
+			else
+				i="#"
+			fi
+		fi
+		if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
+		   [ -r "$g/refs/stash" ]; then
+			s="$"
+		fi
+
+		if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
+		   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
+		   git ls-files --others --exclude-standard --error-unmatch -- '*' >/dev/null 2>/dev/null
+		then
+			u="%${ZSH_VERSION+%}"
+		fi
+
+		if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
+			__git_ps1_show_upstream
+		fi
+	fi
+
+	local z="${GIT_PS1_STATESEPARATOR-" "}"
+
+	# NO color option unless in PROMPT_COMMAND mode
+	if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
+		__git_ps1_colorize_gitstring
+	fi
+
+	local f="$w$i$s$u"
+	local gitstring="$c${b##refs/heads/}${f:+$z$f}$r$p"
+
+	if [ $pcmode = yes ]; then
+		if [[ -n ${ZSH_VERSION-} ]]; then
+			gitstring=$(printf -- "$printf_format" "$gitstring")
+		else
+			printf -v gitstring -- "$printf_format" "$gitstring"
+		fi
+		PS1="$ps1pc_start$gitstring$ps1pc_end"
+	else
+		printf -- "$printf_format" "$gitstring"
+	fi
 }

From dd220152be26163c93ed1c0f9f98e7bad0653941 Mon Sep 17 00:00:00 2001
From: Dimitri Jorge 
Date: Sun, 1 Sep 2013 18:20:08 +0200
Subject: [PATCH 20/94] Add autocompletion plugin for meteor command

---
 plugins/meteor/_meteor | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 plugins/meteor/_meteor

diff --git a/plugins/meteor/_meteor b/plugins/meteor/_meteor
new file mode 100644
index 000000000..c90ed6caf
--- /dev/null
+++ b/plugins/meteor/_meteor
@@ -0,0 +1,32 @@
+#compdef meteor
+#autoload
+
+# Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
+# Original author: Dimitri JORGE (https://github.com/jorge-d)
+
+local -a _1st_arguments
+_1st_arguments=(
+  'run:[Default] Run this project in local development mode'
+  'create:Create a new project'
+  'update:Upgrade this project to the latest version of Meteor'
+  'add:Add a package to this project'
+  'remove:Remove a package from this project'
+  'list:List available packages'
+  'help:Display Meteor help'
+  'bundle:Pack this project up into a tarball'
+  'mongo:Connect to the Mongo database for the specified site'
+  'deploy:Deploy this project to Meteor'
+  'logs:Show logs for specified site'
+  'reset:Reset the project state. Erases the local database.'
+  'test-packages:Test one or more packages'
+)
+
+if (( CURRENT == 2 )); then
+  _describe -t commands "meteor subcommand" _1st_arguments
+  return
+fi
+
+case "$words[2]" in
+    help)
+      _describe -t commands "brew subcommand" _1st_arguments
+esac
\ No newline at end of file

From 90b83b81017bbf55d5c10e6bced835f6d184499d Mon Sep 17 00:00:00 2001
From: Dimitri Jorge 
Date: Sun, 1 Sep 2013 19:23:21 +0200
Subject: [PATCH 21/94] Add completion for package add and remove

---
 plugins/meteor/_meteor | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/plugins/meteor/_meteor b/plugins/meteor/_meteor
index c90ed6caf..cd7fc304f 100644
--- a/plugins/meteor/_meteor
+++ b/plugins/meteor/_meteor
@@ -4,6 +4,13 @@
 # Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
 # Original author: Dimitri JORGE (https://github.com/jorge-d)
 
+_meteor_all_packages() {
+  packages=(`meteor list | cut -d" " -f1`)
+}
+_meteor_installed_packages() {
+  installed_packages=(`meteor list --using`)
+}
+
 local -a _1st_arguments
 _1st_arguments=(
   'run:[Default] Run this project in local development mode'
@@ -21,6 +28,9 @@ _1st_arguments=(
   'test-packages:Test one or more packages'
 )
 
+local expl
+local -a packages installed_packages
+
 if (( CURRENT == 2 )); then
   _describe -t commands "meteor subcommand" _1st_arguments
   return
@@ -28,5 +38,11 @@ fi
 
 case "$words[2]" in
     help)
-      _describe -t commands "brew subcommand" _1st_arguments
+      _describe -t commands "meteor subcommand" _1st_arguments ;;
+    remove)
+      _meteor_installed_packages
+      _wanted installed_packages expl 'installed packages' compadd -a installed_packages ;;
+    add)
+      _meteor_all_packages
+      _wanted packages expl 'all packages' compadd -a packages ;;
 esac
\ No newline at end of file

From 190fcdffa7bc413dc7a9ebef4a6eaed37beb6896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20M=C4=83gheru=C8=99an-Stanciu?=
 
Date: Wed, 9 Oct 2013 16:42:28 +0200
Subject: [PATCH 22/94] Added a completion plugin for the new aws-cli tool

It also supports quickly switching AWS profiles defined in
~/.aws/config using the asp alias
---
 plugins/aws/aws.plugin.zsh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 plugins/aws/aws.plugin.zsh

diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
new file mode 100644
index 000000000..3f7fb1995
--- /dev/null
+++ b/plugins/aws/aws.plugin.zsh
@@ -0,0 +1,17 @@
+export AWS_HOME=~/.aws
+
+function agp {
+  echo $AWS_DEFAULT_PROFILE
+  
+}
+function asp {
+  export AWS_DEFAULT_PROFILE=$1
+    export RPROMPT=""
+    
+}
+function aws_profiles {
+  reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
+}
+
+compctl -K aws_profiles asp
+source `which aws_zsh_completer.sh`

From 3ca3c5a126a937dc6d6d3daba241f9a0f5a4c2f2 Mon Sep 17 00:00:00 2001
From: Wes Morgan 
Date: Mon, 14 Oct 2013 09:59:20 -0600
Subject: [PATCH 23/94] don't clobber existing RBENV_ROOT & follow Homebrew's
 default behavior

---
 plugins/rbenv/rbenv.plugin.zsh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
index 78f76c3a3..57ae2ca1f 100644
--- a/plugins/rbenv/rbenv.plugin.zsh
+++ b/plugins/rbenv/rbenv.plugin.zsh
@@ -10,12 +10,18 @@ FOUND_RBENV=0
 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
 if _homebrew-installed && _rbenv-from-homebrew-installed ; then
     rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
+    if [[ $RBENV_ROOT = '' ]]; then 
+      RBENV_ROOT="$HOME/.rbenv"
+    fi
 fi
 
 for rbenvdir in "${rbenvdirs[@]}" ; do
   if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
     FOUND_RBENV=1
-    export RBENV_ROOT=$rbenvdir
+    if [[ $RBENV_ROOT = '' ]]; then
+      RBENV_ROOT=$rbenvdir
+    fi
+    export RBENV_ROOT
     export PATH=${rbenvdir}/bin:$PATH
     eval "$(rbenv init --no-rehash - zsh)"
 

From c9f2c947e4bdc94676aeaf989ba16dbe35aa45ee Mon Sep 17 00:00:00 2001
From: Stefan Tatschner 
Date: Fri, 29 Nov 2013 14:24:14 +0100
Subject: [PATCH 24/94] Added/modified some useful aliases.

---
 lib/aliases.zsh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/aliases.zsh b/lib/aliases.zsh
index 9b3709172..517e4daf7 100644
--- a/lib/aliases.zsh
+++ b/lib/aliases.zsh
@@ -6,6 +6,11 @@ alias po='popd'
 alias ...='cd ../..'
 alias -- -='cd -'
 
+# Prevent headaches
+alias cp='cp -v'
+alias rm='rm -v'
+alias mv='mv -v'
+
 # Super user
 alias _='sudo'
 alias please='sudo'
@@ -17,9 +22,9 @@ alias history='fc -l 1'
 
 # List direcory contents
 alias lsa='ls -lah'
-alias l='ls -la'
-alias ll='ls -l'
-alias la='ls -lA'
+alias l='ls -lah'
+alias ll='ls -lh'
+alias la='ls -lAh'
 alias sl=ls # often screw this up
 
 alias afind='ack-grep -il'

From be6b1b3b8fda01bebc499e02b6945eaddaf45b84 Mon Sep 17 00:00:00 2001
From: Foivos 
Date: Sun, 8 Dec 2013 07:11:33 +0200
Subject: [PATCH 25/94] Improve comments

---
 templates/zshrc.zsh-template | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index b2cad20e8..869bd52c3 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -11,13 +11,13 @@ ZSH_THEME="robbyrussell"
 # alias zshconfig="mate ~/.zshrc"
 # alias ohmyzsh="mate ~/.oh-my-zsh"
 
-# Set to this to use case-sensitive completion
+# Set this to use case-sensitive completion
 # CASE_SENSITIVE="true"
 
 # Uncomment this to disable bi-weekly auto-update checks
 # DISABLE_AUTO_UPDATE="true"
 
-# Uncomment to change how often before auto-updates occur? (in days)
+# Uncomment to change how often to auto-update? (in days)
 # export UPDATE_ZSH_DAYS=13
 
 # Uncomment following line if you want to disable colors in ls
@@ -37,9 +37,9 @@ ZSH_THEME="robbyrussell"
 # much faster.
 # DISABLE_UNTRACKED_FILES_DIRTY="true"
 
-# Uncomment following line if you want to  shown in the command execution time stamp 
-# in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|
-# yyyy-mm-dd
+# Uncomment following line if you want to the command execution time stamp shown 
+# in the history command output.
+# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
 # HIST_STAMPS="mm/dd/yyyy"
 
 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)

From e97811913b9349349e35853a8c2fe3e93cabacd9 Mon Sep 17 00:00:00 2001
From: Foivos 
Date: Sun, 8 Dec 2013 07:16:40 +0200
Subject: [PATCH 26/94] Improve comments

---
 templates/zshrc.zsh-template | 1 -
 1 file changed, 1 deletion(-)

diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index 869bd52c3..c2254d055 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -66,4 +66,3 @@ export PATH=$HOME/bin:/usr/local/bin:$PATH
 
 # ssh
 # export SSH_KEY_PATH="~/.ssh/dsa_id"
-

From 0185d9920b7d6c380277a4a15c9e4818df41700a Mon Sep 17 00:00:00 2001
From: Eduardo San Martin Morote 
Date: Mon, 9 Dec 2013 08:54:38 +0100
Subject: [PATCH 27/94] catimg plugin allow to print an image to the stdout
 using convert

---
 plugins/catimg/catimg.plugin.zsh |  16 ++++++
 plugins/catimg/catimg.sh         |  87 +++++++++++++++++++++++++++++++
 plugins/catimg/colors.png        | Bin 0 -> 353 bytes
 3 files changed, 103 insertions(+)
 create mode 100644 plugins/catimg/catimg.plugin.zsh
 create mode 100755 plugins/catimg/catimg.sh
 create mode 100644 plugins/catimg/colors.png

diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
new file mode 100644
index 000000000..01e81eca7
--- /dev/null
+++ b/plugins/catimg/catimg.plugin.zsh
@@ -0,0 +1,16 @@
+################################################################################
+# catimg script by Eduardo San Martin Morote aka Posva                         #
+# http://posva.net                                                             #
+#                                                                              #
+# Ouput the content of an image to the stdout using the 256 colors of the      #
+# terminal.                                                                    #
+# Github: https://github.com/posva/catimg                                      #
+################################################################################
+
+if [[ -x  `which convert` ]]; then
+  function catimg() {
+    source $(dirname $0)/catimg.sh $@
+  }
+else
+  echo "catimg need convert (ImageMagick) to work)"
+fi
diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
new file mode 100755
index 000000000..f9e067e34
--- /dev/null
+++ b/plugins/catimg/catimg.sh
@@ -0,0 +1,87 @@
+################################################################################
+# catimg script by Eduardo San Martin Morote aka Posva                         #
+# http://posva.net                                                             #
+#                                                                              #
+# Ouput the content of an image to the stdout using the 256 colors of the      #
+# terminal.                                                                    #
+# Github: https://github.com/posva/catimg                                      #
+################################################################################
+
+function help() {
+  echo "Usage catimg [-h] [-w width] [-c char] img"
+  echo "By default char is \"  \" and w is the terminal width"
+}
+
+# VARIABLES
+COLOR_FILE=$(dirname $0)/colors.png
+CHAR="  "
+
+WIDTH=""
+IMG=""
+
+while getopts qw:c:h opt; do
+  case "$opt" in
+    w) WIDTH="$OPTARG" ;;
+    c) CHAR="$OPTARG" ;;
+    h) help; exit ;;
+    *) help ; exit 1;;
+    esac
+  done
+
+while [ "$1" ]; do
+  IMG="$1"
+  shift
+done
+
+if [ "$IMG" = "" -o ! -f "$IMG" ]; then
+  help
+  exit 1
+fi
+
+if [ ! "$WIDTH" ]; then
+  COLS=$(expr $(tput cols) "/" $(echo -n "$CHAR" | wc -c))
+else
+  COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
+fi
+WIDTH=$(convert ${IMG} -print "%w\n" /dev/null)
+if [ "$WIDTH" -gt "$COLS" ]; then
+  WIDTH=$COLS
+fi
+
+REMAP=""
+if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
+  REMAP="-remap $COLOR_FILE"
+else
+  echo "The version of convert is too old, don't expect good results :(" >&2
+  #convert "$IMG" -colors 256 PNG8:tmp.png
+  #IMG="tmp.png"
+fi
+
+# Display the image
+convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
+sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
+while read R G B f; do
+  if [ ! "$R" = "NO" ]; then
+    if [ "$R" -eq "$G" -a "$G" -eq "$B" ]; then
+      ((
+      I++,
+      IDX = 232 + R * 23 / 255
+      ))
+    else
+      ((
+      I++,
+      IDX = 16
+      + R * 5 / 255 * 36
+      + G * 5 / 255 * 6
+      + B * 5 / 255
+      ))
+    fi
+    #echo "$R,$G,$B: $IDX"
+    echo -ne "\e[48;5;${IDX}m${CHAR}"
+  else
+    (( I++ ))
+    echo -ne "\e[0m${CHAR}"
+  fi
+  # New lines
+  (( $I % $WIDTH )) || echo -e "\e[0m"
+done
diff --git a/plugins/catimg/colors.png b/plugins/catimg/colors.png
new file mode 100644
index 0000000000000000000000000000000000000000..5f2c8126bc0d8911a9de5d3ffbd4e37372b41671
GIT binary patch
literal 353
zcmV-n0iOPeP)
zV|@Gn{~G8ykjRV#PQCxH|Hm1Kz--RQKmY&$#Kd628_Utk00000NkvXXu0mjflf#Hs

literal 0
HcmV?d00001


From cbd63f220dff93ad6c9d00734949106443a5b03b Mon Sep 17 00:00:00 2001
From: Andy Fleming 
Date: Mon, 9 Dec 2013 19:38:27 +0000
Subject: [PATCH 28/94] Fix for virtualenv support - fixes #2328, fixes #2297,
 resolves #2319

---
 themes/af-magic.zsh-theme | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 4cf282590..cd90b106e 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -27,7 +27,12 @@ eval my_gray='$FG[237]'
 eval my_orange='$FG[214]'
 
 # right prompt
-PROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
+if type "virtualenv_prompt" > /dev/null
+then
+	RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
+else
+	RPROMPT='$my_gray%n@%m%{$reset_color%}%'
+fi
 
 # git settings
 ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"

From 349fa15b187a1b2c411db90f2022013caf3479e8 Mon Sep 17 00:00:00 2001
From: Eduardo San Martin Morote 
Date: Mon, 9 Dec 2013 22:07:19 +0100
Subject: [PATCH 29/94] Fixed a dirs bug for catimg

---
 plugins/catimg/catimg.plugin.zsh | 2 +-
 plugins/catimg/catimg.sh         | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
index 01e81eca7..ee721cd03 100644
--- a/plugins/catimg/catimg.plugin.zsh
+++ b/plugins/catimg/catimg.plugin.zsh
@@ -9,7 +9,7 @@
 
 if [[ -x  `which convert` ]]; then
   function catimg() {
-    source $(dirname $0)/catimg.sh $@
+    source $ZSH/plugins/catimg/catimg.sh $@
   }
 else
   echo "catimg need convert (ImageMagick) to work)"
diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
index f9e067e34..c05fddcd4 100755
--- a/plugins/catimg/catimg.sh
+++ b/plugins/catimg/catimg.sh
@@ -43,7 +43,7 @@ if [ ! "$WIDTH" ]; then
 else
   COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
 fi
-WIDTH=$(convert ${IMG} -print "%w\n" /dev/null)
+WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
 if [ "$WIDTH" -gt "$COLS" ]; then
   WIDTH=$COLS
 fi
@@ -58,6 +58,7 @@ else
 fi
 
 # Display the image
+I=0
 convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
 sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
 while read R G B f; do

From 44b23ae194a1580a6af6d692e4ba268d61828929 Mon Sep 17 00:00:00 2001
From: Eduardo San Martin Morote 
Date: Mon, 9 Dec 2013 22:18:20 +0100
Subject: [PATCH 30/94] catimg: fix exit without using source supresses errors
 from convert whilen converting, as they are usually just warnings

---
 plugins/catimg/catimg.plugin.zsh | 2 +-
 plugins/catimg/catimg.sh         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
index ee721cd03..70ef9a63c 100644
--- a/plugins/catimg/catimg.plugin.zsh
+++ b/plugins/catimg/catimg.plugin.zsh
@@ -9,7 +9,7 @@
 
 if [[ -x  `which convert` ]]; then
   function catimg() {
-    source $ZSH/plugins/catimg/catimg.sh $@
+    zsh $ZSH/plugins/catimg/catimg.sh $@
   }
 else
   echo "catimg need convert (ImageMagick) to work)"
diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
index c05fddcd4..cd0f2e333 100755
--- a/plugins/catimg/catimg.sh
+++ b/plugins/catimg/catimg.sh
@@ -59,7 +59,7 @@ fi
 
 # Display the image
 I=0
-convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- |
+convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
 sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
 while read R G B f; do
   if [ ! "$R" = "NO" ]; then

From c05a28a7d9c5ca86b66b0fdf2f509e07b2a7b616 Mon Sep 17 00:00:00 2001
From: Andy Fleming 
Date: Tue, 10 Dec 2013 00:11:22 +0000
Subject: [PATCH 31/94] typo fix

---
 themes/af-magic.zsh-theme | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index cd90b106e..f40aa284a 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -27,7 +27,7 @@ eval my_gray='$FG[237]'
 eval my_orange='$FG[214]'
 
 # right prompt
-if type "virtualenv_prompt" > /dev/null
+if type "virtualenv_prompt_info" > /dev/null
 then
 	RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
 else

From fdfc90705242841d7491bb945c35a3601d1c8996 Mon Sep 17 00:00:00 2001
From: Mikhail Nikalyukin 
Date: Fri, 6 Dec 2013 12:20:38 +0200
Subject: [PATCH 32/94] Add rdmtc alias for rails plugin.

---
 plugins/rails/rails.plugin.zsh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index 23d15a9a1..4a96754e4 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -51,6 +51,7 @@ alias rds='rake db:seed'
 alias rdd='rake db:drop'
 alias rdtc='rake db:test:clone'
 alias rdtp='rake db:test:prepare'
+alias rdmtc='rake db:migrate db:test:clone'
 
 alias rlc='rake log:clear'
 alias rn='rake notes'

From e41b6acd2a34bd2ad2a092b94629c95b1f932f82 Mon Sep 17 00:00:00 2001
From: chuancong 
Date: Thu, 19 Dec 2013 11:24:38 -0800
Subject: [PATCH 33/94] Add support to command "show"

---
 plugins/pip/_pip | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/pip/_pip b/plugins/pip/_pip
index 967da48ca..7c1238db7 100644
--- a/plugins/pip/_pip
+++ b/plugins/pip/_pip
@@ -20,6 +20,7 @@ _1st_arguments=(
   'bundle:create pybundles (archives containing multiple packages)'
   'freeze:output all currently installed packages (exact versions) to stdout'
   'help:show available commands'
+  'show:show information about installed packages'
   'install:install packages'
   'search:search PyPI'
   'uninstall:uninstall packages'
@@ -76,4 +77,7 @@ case "$words[1]" in
   uninstall)
     _pip_installed
     _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
+  show)
+    _pip_installed
+    _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
 esac

From f6bb74e452590c18b8545cb444a998448c7ae4f0 Mon Sep 17 00:00:00 2001
From: Konstantin Haase 
Date: Fri, 27 Dec 2013 14:25:06 +0100
Subject: [PATCH 34/94] add chruby info to gallois theme

---
 themes/gallois.zsh-theme | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
index d624e3afc..1ff86b54c 100644
--- a/themes/gallois.zsh-theme
+++ b/themes/gallois.zsh-theme
@@ -18,7 +18,11 @@ else
   if which rbenv &> /dev/null; then
     RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
   else
-    RPS1='$(git_custom_status) $EPS1'
+    if which chruby_prompt_info &> /dev/null; then
+      RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1'
+    else
+      RPS1='$(git_custom_status) $EPS1'
+    fi
   fi
 fi
 

From bbbff94cca497103d0f9854f9d8a67b9049f59c9 Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 31 Dec 2013 00:35:57 +0100
Subject: [PATCH 35/94] Fixes rvm_prompt_info() in lib/rvm.zsh

---
 lib/rvm.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rvm.zsh b/lib/rvm.zsh
index e8744e61e..d14b45632 100644
--- a/lib/rvm.zsh
+++ b/lib/rvm.zsh
@@ -2,7 +2,7 @@
 function rvm_prompt_info() {
   [ -f $HOME/.rvm/bin/rvm-prompt ] || return
   local rvm_prompt
-  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
+  rvm_prompt=$(eval "$HOME/.rvm/bin/rvm-prompt $ZSH_THEME_RVM_PROMPT_OPTIONS" 2>/dev/null)
   [[ "${rvm_prompt}x" == "x" ]] && return
   echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 }

From 468b24a8d54f294ab9802cac3801ba580c5c4397 Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 31 Dec 2013 01:06:14 +0100
Subject: [PATCH 36/94] Returns false when rvm is not found.

---
 lib/rvm.zsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/rvm.zsh b/lib/rvm.zsh
index d14b45632..04d116397 100644
--- a/lib/rvm.zsh
+++ b/lib/rvm.zsh
@@ -1,8 +1,8 @@
 # get the name of the ruby version
 function rvm_prompt_info() {
-  [ -f $HOME/.rvm/bin/rvm-prompt ] || return
+  [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
   local rvm_prompt
   rvm_prompt=$(eval "$HOME/.rvm/bin/rvm-prompt $ZSH_THEME_RVM_PROMPT_OPTIONS" 2>/dev/null)
-  [[ "${rvm_prompt}x" == "x" ]] && return
+  [[ "${rvm_prompt}x" == "x" ]] && return 1
   echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 }

From ae6ded5ad795a7f4174bc10a5a02e1c0502e1352 Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 31 Dec 2013 01:15:35 +0100
Subject: [PATCH 37/94] Returns false when rbenv is not found.

---
 lib/rbenv.zsh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh
index a8b6c323c..f58074b83 100644
--- a/lib/rbenv.zsh
+++ b/lib/rbenv.zsh
@@ -1,2 +1,4 @@
 # using the rbenv plugin will override this with a real implementation
-function rbenv_prompt_info() {}
+function rbenv_prompt_info() {
+  return 1
+}

From 7aa766168cead04f677b4828cc5c837f823f7cd7 Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 31 Dec 2013 01:44:51 +0100
Subject: [PATCH 38/94] Adds chruby_prompt_info dummy function.

---
 lib/chruby.zsh | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 lib/chruby.zsh

diff --git a/lib/chruby.zsh b/lib/chruby.zsh
new file mode 100644
index 000000000..b78d04f86
--- /dev/null
+++ b/lib/chruby.zsh
@@ -0,0 +1,4 @@
+# using the chruby plugin will override this with a real implementation
+function chruby_prompt_info() {
+  return 1
+}

From 8a887c505282b771193ac3ee6df05a1fa3f8426a Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 31 Dec 2013 02:11:02 +0100
Subject: [PATCH 39/94] Joins ruby prompt files and adds ruby_prompt_info.

---
 lib/chruby.zsh       |  4 ----
 lib/rbenv.zsh        |  4 ----
 lib/ruby_prompts.zsh | 22 ++++++++++++++++++++++
 lib/rvm.zsh          |  8 --------
 4 files changed, 22 insertions(+), 16 deletions(-)
 delete mode 100644 lib/chruby.zsh
 delete mode 100644 lib/rbenv.zsh
 create mode 100644 lib/ruby_prompts.zsh
 delete mode 100644 lib/rvm.zsh

diff --git a/lib/chruby.zsh b/lib/chruby.zsh
deleted file mode 100644
index b78d04f86..000000000
--- a/lib/chruby.zsh
+++ /dev/null
@@ -1,4 +0,0 @@
-# using the chruby plugin will override this with a real implementation
-function chruby_prompt_info() {
-  return 1
-}
diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh
deleted file mode 100644
index f58074b83..000000000
--- a/lib/rbenv.zsh
+++ /dev/null
@@ -1,4 +0,0 @@
-# using the rbenv plugin will override this with a real implementation
-function rbenv_prompt_info() {
-  return 1
-}
diff --git a/lib/ruby_prompts.zsh b/lib/ruby_prompts.zsh
new file mode 100644
index 000000000..287b3ff0a
--- /dev/null
+++ b/lib/ruby_prompts.zsh
@@ -0,0 +1,22 @@
+# get the name of the rvm ruby version
+function rvm_prompt_info() {
+  [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
+  local rvm_prompt
+  rvm_prompt=$(eval "$HOME/.rvm/bin/rvm-prompt $ZSH_THEME_RVM_PROMPT_OPTIONS" 2>/dev/null)
+  [[ "${rvm_prompt}x" == "x" ]] && return 1
+  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
+}
+
+# using the rbenv plugin will override this with a real implementation
+function rbenv_prompt_info() {
+  return 1
+}
+
+# using the chruby plugin will override this with a real implementation
+function chruby_prompt_info() {
+  return 1
+}
+
+function ruby_prompt_info() {
+  echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
+}
diff --git a/lib/rvm.zsh b/lib/rvm.zsh
deleted file mode 100644
index 04d116397..000000000
--- a/lib/rvm.zsh
+++ /dev/null
@@ -1,8 +0,0 @@
-# get the name of the ruby version
-function rvm_prompt_info() {
-  [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
-  local rvm_prompt
-  rvm_prompt=$(eval "$HOME/.rvm/bin/rvm-prompt $ZSH_THEME_RVM_PROMPT_OPTIONS" 2>/dev/null)
-  [[ "${rvm_prompt}x" == "x" ]] && return 1
-  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
-}

From c6aacf611d51f7c00d216f77c3b32174cc3bed9c Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 31 Dec 2013 02:45:09 +0100
Subject: [PATCH 40/94] Refactors ruby_prompts.zsh

---
 lib/ruby_prompts.zsh | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/lib/ruby_prompts.zsh b/lib/ruby_prompts.zsh
index 287b3ff0a..2ef334d5f 100644
--- a/lib/ruby_prompts.zsh
+++ b/lib/ruby_prompts.zsh
@@ -7,13 +7,9 @@ function rvm_prompt_info() {
   echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 }
 
-# using the rbenv plugin will override this with a real implementation
-function rbenv_prompt_info() {
-  return 1
-}
-
-# using the chruby plugin will override this with a real implementation
-function chruby_prompt_info() {
+# using the chruby and/or rbenv plugins will override
+# these with real implementations
+function chruby_prompt_info rbenv_prompt_info {
   return 1
 }
 

From 9ce1b6289aebc8e19b8bb25e4f7ac1cbc84e83de Mon Sep 17 00:00:00 2001
From: Brice Dutheil 
Date: Sat, 4 Jan 2014 22:06:09 +0100
Subject: [PATCH 41/94] new faster SVN plugin

---
 .../svn-fast-info/svn-fast-info.plugin.zsh    | 64 +++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 plugins/svn-fast-info/svn-fast-info.plugin.zsh

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
new file mode 100644
index 000000000..d8fc53989
--- /dev/null
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -0,0 +1,64 @@
+# vim:ft=zsh ts=2 sw=2 sts=2
+#
+# Faster alternative to the current SVN plugin implementation.
+#
+# Works with svn 1.6, 1.7, 1.8.
+# Use `svn_prompt_info` method to enquire the svn data.
+# It's faster because his efficient use of svn (single svn call) done in the `parse_svn` function
+# Also changed prompt suffix *after* the svn dirty marker
+#
+# *** IMPORTANT *** DO NO USE with the simple svn plugin, this plugin acts as a replacement of it.
+
+function parse_svn() {
+    info=$(svn info 2> /dev/null) || return
+    in_svn=true
+	repo_need_upgrade="$(svn_repo_need_upgrade $info)"
+    svn_branch_name="$(svn_get_branch_name $info)"
+    svn_dirty="$(svn_dirty_choose)"
+    svn_repo_name="$(svn_get_repo_name $info)"
+    svn_rev="$(svn_get_revision $info)"
+}
+
+function svn_prompt_info() {
+    eval parse_svn
+
+    if [ ${in_svn} ]; then
+        echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
+$ZSH_THEME_REPO_NAME_COLOR${svn_branch_name}\
+$ZSH_PROMPT_BASE_COLOR${svn_dirty}\
+$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX\
+$ZSH_PROMPT_BASE_COLOR"
+    fi
+}
+
+
+function svn_repo_need_upgrade() {
+	info=$1
+	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
+	[ "${info}" = "E155036" ] && echo "upgrade repo with svn upgrade"
+}
+
+function svn_get_branch_name() {
+	info=$1
+	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
+    echo $info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$' | read SVN_URL
+    echo $SVN_URL
+}
+
+function svn_get_repo_name() {
+	info=$1
+	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
+    echo $info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
+    echo $info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
+}
+
+function svn_get_revision() {
+	info=$1
+	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
+    echo $info 2> /dev/null | sed -n s/Revision:\ //p
+}
+
+function svn_dirty_choose() {
+    svn status | grep -E '^\s*[ACDIM!?L]' > /dev/null 2>/dev/null && echo $ZSH_THEME_SVN_PROMPT_DIRTY && return
+    echo $ZSH_THEME_SVN_PROMPT_CLEAN
+}
\ No newline at end of file

From 72392a2c27386706c78efe1ace9b84e602d9d1ff Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Mon, 6 Jan 2014 09:57:09 +0100
Subject: [PATCH 42/94] Adds all other dummy implementations.

---
 lib/ruby_prompts.zsh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/ruby_prompts.zsh b/lib/ruby_prompts.zsh
index 2ef334d5f..9ca6e1fc7 100644
--- a/lib/ruby_prompts.zsh
+++ b/lib/ruby_prompts.zsh
@@ -1,3 +1,10 @@
+function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
+  rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
+  virtualenv_prompt_info {
+  return 1
+}
+
+# oh-my-zsh supports an rvm prompt by default
 # get the name of the rvm ruby version
 function rvm_prompt_info() {
   [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
@@ -7,12 +14,8 @@ function rvm_prompt_info() {
   echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 }
 
-# using the chruby and/or rbenv plugins will override
-# these with real implementations
-function chruby_prompt_info rbenv_prompt_info {
-  return 1
-}
-
+# use this to enable users to see their ruby version, no matter which
+# version management system they use
 function ruby_prompt_info() {
   echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
 }

From 082607c165c6ae16b7b059e941c8bfa3eddabbb8 Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Mon, 6 Jan 2014 09:57:23 +0100
Subject: [PATCH 43/94] Adds documentation.

---
 lib/ruby_prompts.zsh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/ruby_prompts.zsh b/lib/ruby_prompts.zsh
index 9ca6e1fc7..1aaf9de17 100644
--- a/lib/ruby_prompts.zsh
+++ b/lib/ruby_prompts.zsh
@@ -1,3 +1,15 @@
+# *_prompt_info functions for usage in your prompt
+#
+# Plugin creators, please add your *_prompt_info function to the list
+# of dummy implementations to help theme creators not receiving errors
+# without the need of implementing conditional clauses.
+#
+# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
+# git_prompt_info, bzr_prompt_info and nvm_prompt_info
+
+# Dummy implementations that return false to prevent command_not_found
+# errors with themes, that implement these functions
+# Real implementations will be used when the respective plugins are loaded
 function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
   rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
   virtualenv_prompt_info {

From 85fde31991dc04f34450390e7d20992a7334c90a Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Mon, 6 Jan 2014 09:58:40 +0100
Subject: [PATCH 44/94] Renames the file to prompt_info_functions.zsh

---
 lib/{ruby_prompts.zsh => prompt_info_functions.zsh} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename lib/{ruby_prompts.zsh => prompt_info_functions.zsh} (100%)

diff --git a/lib/ruby_prompts.zsh b/lib/prompt_info_functions.zsh
similarity index 100%
rename from lib/ruby_prompts.zsh
rename to lib/prompt_info_functions.zsh

From 2d6d9d525fbf791affef71e2d7fd0a0f2cd0c30c Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Mon, 6 Jan 2014 09:59:50 +0100
Subject: [PATCH 45/94] Fixes RPROMPT in af-magic.zsh-theme

---
 themes/af-magic.zsh-theme | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 4cf282590..f241efb6a 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -27,7 +27,7 @@ eval my_gray='$FG[237]'
 eval my_orange='$FG[214]'
 
 # right prompt
-PROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
+RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
 
 # git settings
 ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"

From 1304ed8d2521e452615bcf7563700018443f5470 Mon Sep 17 00:00:00 2001
From: Brice Dutheil 
Date: Mon, 6 Jan 2014 14:09:40 +0100
Subject: [PATCH 46/94] Report the SVN need upgrade

This happen when subversion 1.7+ is used on a repository created with subversion up to 1.6
---
 plugins/svn-fast-info/svn-fast-info.plugin.zsh | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index d8fc53989..1027bcac2 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -10,7 +10,7 @@
 # *** IMPORTANT *** DO NO USE with the simple svn plugin, this plugin acts as a replacement of it.
 
 function parse_svn() {
-    info=$(svn info 2> /dev/null) || return
+	info=$(svn info 2>&1) || return; # capture stdout and stdout
     in_svn=true
 	repo_need_upgrade="$(svn_repo_need_upgrade $info)"
     svn_branch_name="$(svn_get_branch_name $info)"
@@ -22,7 +22,13 @@ function parse_svn() {
 function svn_prompt_info() {
     eval parse_svn
 
-    if [ ${in_svn} ]; then
+	if [ ! -z $repo_need_upgrade ]; then
+		echo $ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX$ZSH_PROMPT_BASE_COLOR\
+$repo_need_upgrade\
+$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR
+	fi
+
+    if [[ ${in_svn} == true && -z $repo_need_upgrade ]]; then
         echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
 $ZSH_THEME_REPO_NAME_COLOR${svn_branch_name}\
 $ZSH_PROMPT_BASE_COLOR${svn_dirty}\
@@ -34,8 +40,8 @@ $ZSH_PROMPT_BASE_COLOR"
 
 function svn_repo_need_upgrade() {
 	info=$1
-	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-	[ "${info}" = "E155036" ] && echo "upgrade repo with svn upgrade"
+	[ -z "${info}" ] && info=$(svn info 2>&1)
+	if grep -q "E155036" <<< $info; then echo "E155036: upgrade repo with svn upgrade"; fi
 }
 
 function svn_get_branch_name() {
@@ -61,4 +67,4 @@ function svn_get_revision() {
 function svn_dirty_choose() {
     svn status | grep -E '^\s*[ACDIM!?L]' > /dev/null 2>/dev/null && echo $ZSH_THEME_SVN_PROMPT_DIRTY && return
     echo $ZSH_THEME_SVN_PROMPT_CLEAN
-}
\ No newline at end of file
+}

From 642ae64bc50f93739ca280e8dcb1d6dbb5932f58 Mon Sep 17 00:00:00 2001
From: Brice Dutheil 
Date: Tue, 7 Jan 2014 02:10:34 +0100
Subject: [PATCH 47/94] Inline `parse_svn` to avoid leaky state

As noted in review, `in_svn` is not properly reset to false. This is better anyway to not leak state.
---
 .../svn-fast-info/svn-fast-info.plugin.zsh    | 38 +++++++++----------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index 1027bcac2..e75f21599 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -9,18 +9,14 @@
 #
 # *** IMPORTANT *** DO NO USE with the simple svn plugin, this plugin acts as a replacement of it.
 
-function parse_svn() {
-	info=$(svn info 2>&1) || return; # capture stdout and stdout
-    in_svn=true
-	repo_need_upgrade="$(svn_repo_need_upgrade $info)"
-    svn_branch_name="$(svn_get_branch_name $info)"
-    svn_dirty="$(svn_dirty_choose)"
-    svn_repo_name="$(svn_get_repo_name $info)"
-    svn_rev="$(svn_get_revision $info)"
-}
-
 function svn_prompt_info() {
-    eval parse_svn
+	info=$(svn info 2>&1) || return; # capture stdout and stdout
+	in_svn=true
+	repo_need_upgrade="$(svn_repo_need_upgrade $info)"
+	svn_branch_name="$(svn_get_branch_name $info)"
+	svn_dirty="$(svn_dirty_choose)"
+	svn_repo_name="$(svn_get_repo_name $info)"
+	svn_rev="$(svn_get_revision $info)"
 
 	if [ ! -z $repo_need_upgrade ]; then
 		echo $ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX$ZSH_PROMPT_BASE_COLOR\
@@ -28,13 +24,13 @@ $repo_need_upgrade\
 $ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR
 	fi
 
-    if [[ ${in_svn} == true && -z $repo_need_upgrade ]]; then
-        echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
+	if [[ ${in_svn} == true && -z $repo_need_upgrade ]]; then
+		echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
 $ZSH_THEME_REPO_NAME_COLOR${svn_branch_name}\
 $ZSH_PROMPT_BASE_COLOR${svn_dirty}\
 $ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX\
 $ZSH_PROMPT_BASE_COLOR"
-    fi
+	fi
 }
 
 
@@ -47,24 +43,24 @@ function svn_repo_need_upgrade() {
 function svn_get_branch_name() {
 	info=$1
 	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-    echo $info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$' | read SVN_URL
-    echo $SVN_URL
+	echo $info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$' | read SVN_URL
+	echo $SVN_URL
 }
 
 function svn_get_repo_name() {
 	info=$1
 	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-    echo $info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
-    echo $info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
+	echo $info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
+	echo $info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
 }
 
 function svn_get_revision() {
 	info=$1
 	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-    echo $info 2> /dev/null | sed -n s/Revision:\ //p
+	echo $info 2> /dev/null | sed -n s/Revision:\ //p
 }
 
 function svn_dirty_choose() {
-    svn status | grep -E '^\s*[ACDIM!?L]' > /dev/null 2>/dev/null && echo $ZSH_THEME_SVN_PROMPT_DIRTY && return
-    echo $ZSH_THEME_SVN_PROMPT_CLEAN
+	svn status | grep -E '^\s*[ACDIM!?L]' > /dev/null 2>/dev/null && echo $ZSH_THEME_SVN_PROMPT_DIRTY && return
+	echo $ZSH_THEME_SVN_PROMPT_CLEAN
 }

From 8bf8e1ecf9eeb4117b1196a5fd02d788979f05f7 Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 7 Jan 2014 10:07:02 +0100
Subject: [PATCH 48/94] Heavy refactor of svn-fast-info

---
 .../svn-fast-info/svn-fast-info.plugin.zsh    | 88 +++++++++++--------
 1 file changed, 50 insertions(+), 38 deletions(-)

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index e75f21599..2183010ba 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -1,4 +1,4 @@
-# vim:ft=zsh ts=2 sw=2 sts=2
+# vim:ft=zsh ts=2 sw=2 sts=2 et
 #
 # Faster alternative to the current SVN plugin implementation.
 #
@@ -10,57 +10,69 @@
 # *** IMPORTANT *** DO NO USE with the simple svn plugin, this plugin acts as a replacement of it.
 
 function svn_prompt_info() {
-	info=$(svn info 2>&1) || return; # capture stdout and stdout
-	in_svn=true
-	repo_need_upgrade="$(svn_repo_need_upgrade $info)"
-	svn_branch_name="$(svn_get_branch_name $info)"
-	svn_dirty="$(svn_dirty_choose)"
-	svn_repo_name="$(svn_get_repo_name $info)"
-	svn_rev="$(svn_get_revision $info)"
+  local info
+  info=$(svn info 2>&1) || return 1; # capture stdout and stderr
+  local repo_need_upgrade=$(svn_repo_need_upgrade $info)
 
-	if [ ! -z $repo_need_upgrade ]; then
-		echo $ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX$ZSH_PROMPT_BASE_COLOR\
-$repo_need_upgrade\
-$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR
-	fi
-
-	if [[ ${in_svn} == true && -z $repo_need_upgrade ]]; then
-		echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_PREFIX\
-$ZSH_THEME_REPO_NAME_COLOR${svn_branch_name}\
-$ZSH_PROMPT_BASE_COLOR${svn_dirty}\
-$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_SVN_PROMPT_SUFFIX\
-$ZSH_PROMPT_BASE_COLOR"
-	fi
+  if [ -n $repo_need_upgrade ]; then
+    printf '%s%s%s%s%s%s%s\n' \
+      $ZSH_PROMPT_BASE_COLOR \
+      $ZSH_THEME_SVN_PROMPT_PREFIX \
+      $ZSH_PROMPT_BASE_COLOR \
+      $repo_need_upgrade \
+      $ZSH_PROMPT_BASE_COLOR \
+      $ZSH_THEME_SVN_PROMPT_SUFFIX \
+      $ZSH_PROMPT_BASE_COLOR \
+  else
+    # something left for you to fix -
+    # repo name and rev aren't used here, did you forget them?
+    # especially since you set a repo name color
+    # if the prompt is alright this way, leave it as is and just
+    # delete the comment. The functions itself could stay imo,
+    # gives others the chance to use them.
+    printf '%s%s%s%s%s%s%s%s%s\n' \
+      $ZSH_PROMPT_BASE_COLOR \
+      $ZSH_THEME_SVN_PROMPT_PREFIX \
+      $ZSH_THEME_REPO_NAME_COLOR \
+      $(svn_get_branch_name $info)
+      ${svn_branch_name}\
+      $ZSH_PROMPT_BASE_COLOR
+      $(svn_dirty_choose $info)
+      $ZSH_PROMPT_BASE_COLOR
+      $ZSH_THEME_SVN_PROMPT_SUFFIX\
+      $ZSH_PROMPT_BASE_COLOR
+  fi
 }
 
-
 function svn_repo_need_upgrade() {
-	info=$1
-	[ -z "${info}" ] && info=$(svn info 2>&1)
-	if grep -q "E155036" <<< $info; then echo "E155036: upgrade repo with svn upgrade"; fi
+  grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
+    echo "E155036: upgrade repo with svn upgrade"
 }
 
 function svn_get_branch_name() {
-	info=$1
-	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-	echo $info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$' | read SVN_URL
-	echo $SVN_URL
+  echo ${1:-$(svn info 2> /dev/null)} |\
+    grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' |\
+    egrep -o '[^/]+$'
 }
 
 function svn_get_repo_name() {
-	info=$1
-	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-	echo $info | sed -n 's/Repository\ Root:\ .*\///p' | read SVN_ROOT
-	echo $info | sed -n "s/URL:\ .*$SVN_ROOT\///p"
+  # I think this can be further cleaned up as well, not sure how,
+  # as I can't test it
+  local svn_root
+  local info=${1:-$(svn info 2> /dev/null)}
+  echo $info | sed 's/Repository\ Root:\ .*\///p' | read svn_root
+  echo $info | sed "s/URL:\ .*$svn_root\///p"
 }
 
 function svn_get_revision() {
-	info=$1
-	[ -z "${info}" ] && info=$(svn info 2> /dev/null)
-	echo $info 2> /dev/null | sed -n s/Revision:\ //p
+  # does this work as it should?
+  echo ${1:-$(svn info 2> /dev/null)} | sed 's/Revision: //p'
 }
 
 function svn_dirty_choose() {
-	svn status | grep -E '^\s*[ACDIM!?L]' > /dev/null 2>/dev/null && echo $ZSH_THEME_SVN_PROMPT_DIRTY && return
-	echo $ZSH_THEME_SVN_PROMPT_CLEAN
+  if svn status | grep -E '^\s*[ACDIM!?L]' &> /dev/null; then
+    echo $ZSH_THEME_SVN_PROMPT_DIRTY
+  else
+    echo $ZSH_THEME_SVN_PROMPT_CLEAN
+  fi
 }

From b0b79e0abae5f1d228e16c36174bad2bf7ba5fee Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Tue, 7 Jan 2014 19:08:20 +0100
Subject: [PATCH 49/94] No need to eval in rvm_prompt_info!

Just activate word-splitting.
---
 lib/prompt_info_functions.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
index 1aaf9de17..335c02a3d 100644
--- a/lib/prompt_info_functions.zsh
+++ b/lib/prompt_info_functions.zsh
@@ -21,7 +21,7 @@ function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
 function rvm_prompt_info() {
   [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
   local rvm_prompt
-  rvm_prompt=$(eval "$HOME/.rvm/bin/rvm-prompt $ZSH_THEME_RVM_PROMPT_OPTIONS" 2>/dev/null)
+  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
   [[ "${rvm_prompt}x" == "x" ]] && return 1
   echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
 }

From 8ede6c6af3b3f11d9b688e4bf9c97be8a54c6c4d Mon Sep 17 00:00:00 2001
From: Brice Dutheil 
Date: Wed, 8 Jan 2014 02:50:58 +0100
Subject: [PATCH 50/94] Added further cleanup and svn status information

---
 .../svn-fast-info/svn-fast-info.plugin.zsh    | 64 +++++++++----------
 1 file changed, 30 insertions(+), 34 deletions(-)

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index 2183010ba..2d43d365b 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -14,7 +14,7 @@ function svn_prompt_info() {
   info=$(svn info 2>&1) || return 1; # capture stdout and stderr
   local repo_need_upgrade=$(svn_repo_need_upgrade $info)
 
-  if [ -n $repo_need_upgrade ]; then
+  if [[ -n $repo_need_upgrade ]]; then
     printf '%s%s%s%s%s%s%s\n' \
       $ZSH_PROMPT_BASE_COLOR \
       $ZSH_THEME_SVN_PROMPT_PREFIX \
@@ -22,57 +22,53 @@ function svn_prompt_info() {
       $repo_need_upgrade \
       $ZSH_PROMPT_BASE_COLOR \
       $ZSH_THEME_SVN_PROMPT_SUFFIX \
-      $ZSH_PROMPT_BASE_COLOR \
+      $ZSH_PROMPT_BASE_COLOR
   else
-    # something left for you to fix -
-    # repo name and rev aren't used here, did you forget them?
-    # especially since you set a repo name color
-    # if the prompt is alright this way, leave it as is and just
-    # delete the comment. The functions itself could stay imo,
-    # gives others the chance to use them.
-    printf '%s%s%s%s%s%s%s%s%s\n' \
+    printf '%s%s%s %s%s:%s%s%s%s%s' \
       $ZSH_PROMPT_BASE_COLOR \
       $ZSH_THEME_SVN_PROMPT_PREFIX \
-      $ZSH_THEME_REPO_NAME_COLOR \
-      $(svn_get_branch_name $info)
-      ${svn_branch_name}\
-      $ZSH_PROMPT_BASE_COLOR
-      $(svn_dirty_choose $info)
-      $ZSH_PROMPT_BASE_COLOR
-      $ZSH_THEME_SVN_PROMPT_SUFFIX\
+      \
+      "$(svn_status_info $info)" \
+      $ZSH_PROMPT_BASE_COLOR \
+      \
+      $ZSH_THEME_BRANCH_NAME_COLOR \
+      $(svn_get_branch_name $info) \
+      $ZSH_PROMPT_BASE_COLOR \
+      \
+      $(svn_get_revision $info) \
+      $ZSH_PROMPT_BASE_COLOR \
+      \
+      $ZSH_THEME_SVN_PROMPT_SUFFIX \
       $ZSH_PROMPT_BASE_COLOR
   fi
 }
 
+
 function svn_repo_need_upgrade() {
   grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
     echo "E155036: upgrade repo with svn upgrade"
 }
 
 function svn_get_branch_name() {
-  echo ${1:-$(svn info 2> /dev/null)} |\
-    grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' |\
-    egrep -o '[^/]+$'
+  grep '^URL:' <<< "${1:-$(svn info 2> /dev/null)}" | egrep -o '(tags|branches)/[^/]+|trunk'	
 }
 
-function svn_get_repo_name() {
-  # I think this can be further cleaned up as well, not sure how,
-  # as I can't test it
-  local svn_root
-  local info=${1:-$(svn info 2> /dev/null)}
-  echo $info | sed 's/Repository\ Root:\ .*\///p' | read svn_root
-  echo $info | sed "s/URL:\ .*$svn_root\///p"
+function svn_get_repo_root_name() {
+  grep '^Repository\ Root:' <<< "${1:-$(svn info 2> /dev/null)}" | sed 's#.*/##'
 }
 
 function svn_get_revision() {
-  # does this work as it should?
-  echo ${1:-$(svn info 2> /dev/null)} | sed 's/Revision: //p'
+  echo "${1:-$(svn info 2> /dev/null)}" | sed -n 's/Revision: //p'
 }
 
-function svn_dirty_choose() {
-  if svn status | grep -E '^\s*[ACDIM!?L]' &> /dev/null; then
-    echo $ZSH_THEME_SVN_PROMPT_DIRTY
-  else
-    echo $ZSH_THEME_SVN_PROMPT_CLEAN
-  fi
+function svn_status_info() {
+  local svn_status_string="$ZSH_THEME_SVN_PROMPT_CLEAN"
+  local svn_status="$(svn status 2> /dev/null)";
+  if grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
+  if grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"; fi
+  if grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
+  if grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"; fi
+  if grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
+  if grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DIRTY:-'!'}"; fi
+  echo $svn_status_string
 }

From f66ab7f98f9be0486b3a55858d9466232fc97ef6 Mon Sep 17 00:00:00 2001
From: Brice Dutheil 
Date: Wed, 8 Jan 2014 03:04:54 +0100
Subject: [PATCH 51/94] Renamed the methods of this script

---
 .../svn-fast-info/svn-fast-info.plugin.zsh    | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index 2d43d365b..a12007ec6 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -4,12 +4,10 @@
 #
 # Works with svn 1.6, 1.7, 1.8.
 # Use `svn_prompt_info` method to enquire the svn data.
-# It's faster because his efficient use of svn (single svn call) done in the `parse_svn` function
-# Also changed prompt suffix *after* the svn dirty marker
-#
-# *** IMPORTANT *** DO NO USE with the simple svn plugin, this plugin acts as a replacement of it.
+# It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
+# It displays the current status of the local files (added, deleted, modified, replaced, or else...)
 
-function svn_prompt_info() {
+function svn_fast_info() {
   local info
   info=$(svn info 2>&1) || return 1; # capture stdout and stderr
   local repo_need_upgrade=$(svn_repo_need_upgrade $info)
@@ -32,10 +30,10 @@ function svn_prompt_info() {
       $ZSH_PROMPT_BASE_COLOR \
       \
       $ZSH_THEME_BRANCH_NAME_COLOR \
-      $(svn_get_branch_name $info) \
+      $(svn_current_branch_name $info) \
       $ZSH_PROMPT_BASE_COLOR \
       \
-      $(svn_get_revision $info) \
+      $(svn_current_revision $info) \
       $ZSH_PROMPT_BASE_COLOR \
       \
       $ZSH_THEME_SVN_PROMPT_SUFFIX \
@@ -43,21 +41,20 @@ function svn_prompt_info() {
   fi
 }
 
-
 function svn_repo_need_upgrade() {
   grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
     echo "E155036: upgrade repo with svn upgrade"
 }
 
-function svn_get_branch_name() {
+function svn_current_branch_name() {
   grep '^URL:' <<< "${1:-$(svn info 2> /dev/null)}" | egrep -o '(tags|branches)/[^/]+|trunk'	
 }
 
-function svn_get_repo_root_name() {
+function svn_repo_root_name() {
   grep '^Repository\ Root:' <<< "${1:-$(svn info 2> /dev/null)}" | sed 's#.*/##'
 }
 
-function svn_get_revision() {
+function svn_current_revision() {
   echo "${1:-$(svn info 2> /dev/null)}" | sed -n 's/Revision: //p'
 }
 

From ca129bb55085cf93510346dcd70b1190b87d5bc0 Mon Sep 17 00:00:00 2001
From: Brice Dutheil 
Date: Fri, 10 Jan 2014 14:03:10 +0100
Subject: [PATCH 52/94] Renames main plugin function to `svn_prompt_info`

---
 plugins/svn-fast-info/svn-fast-info.plugin.zsh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index a12007ec6..ea19bcea0 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -6,8 +6,10 @@
 # Use `svn_prompt_info` method to enquire the svn data.
 # It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
 # It displays the current status of the local files (added, deleted, modified, replaced, or else...)
+#
+# Use as a drop-in replacement of the svn plugin not as complementary plugin
 
-function svn_fast_info() {
+function svn_prompt_info() {
   local info
   info=$(svn info 2>&1) || return 1; # capture stdout and stderr
   local repo_need_upgrade=$(svn_repo_need_upgrade $info)

From a6671919ab2a5b0732dbc07d6f8becd9346917da Mon Sep 17 00:00:00 2001
From: LFDM <1986gh@gmail.com>
Date: Fri, 10 Jan 2014 22:52:18 +0100
Subject: [PATCH 53/94] Fixes _rails_command

Changes precedence of the conditional clause, more recent versions come
first now. Fixes problems when users update their app and still have
the old rails files inside of their file tree.
Closes #2405 - check the discussion there for further info.
---
 plugins/rails/rails.plugin.zsh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index 23d15a9a1..210fdfcf7 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -1,10 +1,10 @@
 function _rails_command () {
-  if [ -e "script/server" ]; then
-    ruby script/$@
+  if [ -e "bin/rails" ]; then
+    bin/rails $@
   elif [ -e "script/rails" ]; then
     ruby script/rails $@
-  elif [ -e "bin/rails" ]; then
-    bin/rails $@
+  elif [ -e "script/server" ]; then
+    ruby script/$@
   else
     rails $@
   fi

From 23e57c177c44b3177c0545acaf9f6211db78f774 Mon Sep 17 00:00:00 2001
From: Tomas Pelka 
Date: Thu, 16 Jan 2014 12:15:41 +0100
Subject: [PATCH 54/94] Adding commit hash to branch name in my favorit
 rjk-repos theme.

---
 themes/rkj-repos.zsh-theme | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme
index 4ab3bc757..6289427c2 100644
--- a/themes/rkj-repos.zsh-theme
+++ b/themes/rkj-repos.zsh-theme
@@ -18,8 +18,11 @@ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂"
 ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈"
 
 function mygit() {
-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
-  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX"
+  ref1=$(git symbolic-ref HEAD 2> /dev/null) || return
+  ref2=$(git rev-parse HEAD | head -c 6) || return
+  ref="$ref1 %{$fg[grey]%}$ref2"
+  #ref=$(git symbolic-ref HEAD 2> /dev/null) $(git rev-parse HEAD | head -c 6) || return
+  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
 }
 
 function retcode() {}

From 3d41804fbce109a09f8d9549e875b428621cd85b Mon Sep 17 00:00:00 2001
From: Christoph Heer 
Date: Fri, 24 Jan 2014 23:01:35 +0100
Subject: [PATCH 55/94] Improve virtualenv prompt in steeef theme

---
 themes/steeef.zsh-theme | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme
index 312229e9f..e0080b8a5 100644
--- a/themes/steeef.zsh-theme
+++ b/themes/steeef.zsh-theme
@@ -8,7 +8,7 @@
 # http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
 
 function virtualenv_info {
-    [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
+    [ $VIRTUAL_ENV ] && echo '('$fg[blue]`basename $VIRTUAL_ENV`%{$reset_color%}') '
 }
 PR_GIT_UPDATE=1
 
@@ -87,7 +87,7 @@ function steeef_precmd {
         else
             FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})"
         fi
-        zstyle ':vcs_info:*:prompt:*' formats       "${FMT_BRANCH}"
+        zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH} "
 
         vcs_info 'prompt'
         PR_GIT_UPDATE=
@@ -96,5 +96,5 @@ function steeef_precmd {
 add-zsh-hook precmd steeef_precmd
 
 PROMPT=$'
-%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_
-$(virtualenv_info)$ '
+%{$purple%}%n%{$reset_color%} at %{$orange%}%m%{$reset_color%} in %{$limegreen%}%~%{$reset_color%} $vcs_info_msg_0_$(virtualenv_info)%{$reset_color%}
+$ '

From 78ffa71cb6ecb40ec8ca97d5fb9682ceb74a05b7 Mon Sep 17 00:00:00 2001
From: mrbfrank 
Date: Tue, 28 Jan 2014 18:02:40 -0600
Subject: [PATCH 56/94] updated url to latest powerline-patched fonts

clearing up some confusion in issue#1906
---
 themes/agnoster.zsh-theme | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 01cdc80e5..a0d60ea88 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -6,7 +6,7 @@
 # # README
 #
 # In order for this theme to render correctly, you will need a
-# [Powerline-patched font](https://gist.github.com/1595572).
+# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
 #
 # In addition, I recommend the
 # [Solarized theme](https://github.com/altercation/solarized/) and, if you're

From 7daaa188da6255ef89f3076ad70370dd31762437 Mon Sep 17 00:00:00 2001
From: mrbfrank 
Date: Tue, 28 Jan 2014 21:54:00 -0600
Subject: [PATCH 57/94] corrected branch character
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

changed ± to 
---
 themes/agnoster.zsh-theme | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index a0d60ea88..a5c47f9b5 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -90,7 +90,7 @@ prompt_git() {
     zstyle ':vcs_info:*' formats ' %u%c'
     zstyle ':vcs_info:*' actionformats '%u%c'
     vcs_info
-    echo -n "${ref/refs\/heads\//± }${vcs_info_msg_0_}"
+    echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_}"
   fi
 }
 

From 685ea4a36162a0bca9b0176b268c25e45023e97e Mon Sep 17 00:00:00 2001
From: mrbfrank 
Date: Wed, 29 Jan 2014 13:35:21 -0600
Subject: [PATCH 58/94] theme agnoster: remove trailing space

re-implemented expired pull request https://github.com/robbyrussell/oh-my-zsh/pull/1759
---
 themes/agnoster.zsh-theme | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index a5c47f9b5..85b846cb5 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -88,9 +88,9 @@ prompt_git() {
     zstyle ':vcs_info:*' stagedstr '✚'
     zstyle ':vcs_info:git:*' unstagedstr '●'
     zstyle ':vcs_info:*' formats ' %u%c'
-    zstyle ':vcs_info:*' actionformats '%u%c'
+    zstyle ':vcs_info:*' actionformats ' %u%c'
     vcs_info
-    echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_}"
+    echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }"
   fi
 }
 

From 4d83da770a85f4d2e6b0e0990cb83c925de128bd Mon Sep 17 00:00:00 2001
From: Felds Liscia 
Date: Thu, 30 Jan 2014 15:04:09 -0200
Subject: [PATCH 59/94] highlight the username when root

---
 themes/ys.zsh-theme | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/themes/ys.zsh-theme b/themes/ys.zsh-theme
index 43c101c2a..a44f295f4 100644
--- a/themes/ys.zsh-theme
+++ b/themes/ys.zsh-theme
@@ -32,3 +32,16 @@ PROMPT="
 ${git_info} \
 %{$fg[white]%}[%*]
 %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
+
+if [[ "$(whoami)" == "root" ]]; then
+PROMPT="
+%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
+%{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \
+%{$fg[white]%}at \
+%{$fg[green]%}$(box_name) \
+%{$fg[white]%}in \
+%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
+${git_info} \
+%{$fg[white]%}[%*]
+%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
+fi

From f3f0a54259f384c35dad48a40d6e931df079b3c9 Mon Sep 17 00:00:00 2001
From: Ed Lui 
Date: Tue, 11 Feb 2014 22:45:41 -0500
Subject: [PATCH 60/94] Updated _brew zsh autocompletion to latest Homebrew
 upstream

---
 plugins/brew/_brew | 75 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 59 insertions(+), 16 deletions(-)

diff --git a/plugins/brew/_brew b/plugins/brew/_brew
index d4306f223..9eb3bb557 100644
--- a/plugins/brew/_brew
+++ b/plugins/brew/_brew
@@ -11,10 +11,25 @@ _brew_installed_formulae() {
   installed_formulae=(`brew list`)
 }
 
+_brew_installed_taps() {
+  installed_taps=(`brew tap`)
+}
+
+_brew_outdated_formulae() {
+  outdated_formulae=(`brew outdated`)
+}
+
+_brew_running_services() {
+  running_services=(`brew services list | awk '{print $1}'`)
+}
+
 local -a _1st_arguments
 _1st_arguments=(
+  'audit:check formulae for Homebrew coding style'
+  'bundle:look for a Brewfile and run each line as a brew command'
   'cat:display formula file for a formula'
   'cleanup:uninstall unused and old versions of packages'
+  'commands:show a list of commands'
   'create:create a new formula'
   'deps:list dependencies and dependants of a formula'
   'doctor:audits your installation for common issues'
@@ -22,27 +37,38 @@ _1st_arguments=(
   'home:visit the homepage of a formula or the brew project'
   'info:information about a formula'
   'install:install a formula'
+  'reinstall:install a formula anew; re-using its current options'
   'link:link a formula'
   'list:list files in a formula or not-installed formulae'
   'log:git commit log for a formula'
   'missing:check all installed formuale for missing dependencies.'
-  'options:display install options specific to formula.'
-  'outdated:list formulas for which a newer version is available'
+  'outdated:list formulae for which a newer version is available'
+  'pin:pin specified formulae'
   'prune:remove dead links'
-  'reinstall:reinstall a formula'
   'remove:remove a formula'
   'search:search for a formula (/regex/ or string)'
   'server:start a local web app that lets you browse formulae (requires Sinatra)'
-  'services:manage background services via launchctl'
+  'services:small wrapper around `launchctl` for supported formulae'
+  'tap:tap a new formula repository from GitHub, or list existing taps'
   'unlink:unlink a formula'
+  'unpin:unpin specified formulae'
+  'untap:remove a tapped repository'
   'update:freshen up links'
   'upgrade:upgrade outdated formulae'
-  'uses:show formulas which depend on a formula'
-  'versions:show all available formula versions'
+  'uses:show formulae which depend on a formula'
+)
+
+local -a _service_arguments
+_service_arguments=(
+  'cleanup:get rid of stale services and unused plists'
+  'list:list all services managed by `brew services`'
+  'restart:gracefully restart selected service'
+  'start:start selected service'
+  'stop:stop selected service'
 )
 
 local expl
-local -a formulae installed_formulae
+local -a formulae installed_formulae installed_taps outdated_formulae running_services
 
 _arguments \
   '(-v)-v[verbose]' \
@@ -61,24 +87,41 @@ if (( CURRENT == 1 )); then
 fi
 
 case "$words[1]" in
-  search|-S)
-    _arguments \
-      '(--macports)--macports[search the macports repository]' \
-      '(--fink)--fink[search the fink repository]' ;;
+  install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
+    _brew_all_formulae
+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
   list|ls)
     _arguments \
       '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+      '(--pinned)--pinned[list all versions of pinned formulae]' \
       '(--versions)--versions[list all installed versions of a formula]' \
-      '1: :->forms' &&  return 0
+      '1: :->forms' && return 0
 
       if [[ "$state" == forms ]]; then
         _brew_installed_formulae
         _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
       fi ;;
-  install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
-    _brew_all_formulae
-    _wanted formulae expl 'all formulae' compadd -a formulae ;;
-  reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
+  remove|rm|uninstall|unlink|cleanup|link|ln|pin|unpin)
     _brew_installed_formulae
     _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
+  search|-S)
+    _arguments \
+      '(--macports)--macports[search the macports repository]' \
+      '(--fink)--fink[search the fink repository]' ;;
+  services)
+    if [[ -n "$words[2]" ]]; then
+      case "$words[2]" in
+        restart|start|stop)
+          _brew_running_services
+          _wanted running_services expl 'running services' compadd -a running_services ;;
+      esac
+    else
+      _describe -t commands "brew services subcommand" _service_arguments
+    fi ;;
+  untap)
+    _brew_installed_taps
+    _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
+  upgrade)
+    _brew_outdated_formulae
+    _wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
 esac

From 2078e7d4deac2546deea6b707837b39c535eaa78 Mon Sep 17 00:00:00 2001
From: Luke Steensen 
Date: Wed, 12 Feb 2014 20:09:44 -0600
Subject: [PATCH 61/94] remove duplicate 'go' plugin, symlink to 'golang'

---
 plugins/go/go.plugin.zsh | 152 +--------------------------------------
 1 file changed, 1 insertion(+), 151 deletions(-)
 mode change 100644 => 120000 plugins/go/go.plugin.zsh

diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
deleted file mode 100644
index 23afa9656..000000000
--- a/plugins/go/go.plugin.zsh
+++ /dev/null
@@ -1,151 +0,0 @@
-# install in /etc/zsh/zshrc or your personal .zshrc
-
-# gc
-prefixes=(5 6 8)
-for p in $prefixes; do
-	compctl -g "*.${p}" ${p}l
-	compctl -g "*.go" ${p}g
-done
-
-# standard go tools
-compctl -g "*.go" gofmt
-
-# gccgo
-compctl -g "*.go" gccgo
-
-# go tool
-__go_tool_complete() {
-  typeset -a commands build_flags
-  commands+=(
-    'build[compile packages and dependencies]'
-    'clean[remove object files]'
-    'doc[run godoc on package sources]'
-    'fix[run go tool fix on packages]'
-    'fmt[run gofmt on package sources]'
-    'get[download and install packages and dependencies]'
-    'help[display help]'
-    'install[compile and install packages and dependencies]'
-    'list[list packages]'
-    'run[compile and run Go program]'
-    'test[test packages]'
-    'tool[run specified go tool]'
-    'version[print Go version]'
-    'vet[run go tool vet on packages]'
-  )
-  if (( CURRENT == 2 )); then
-    # explain go commands
-    _values 'go tool commands' ${commands[@]}
-    return
-  fi
-  build_flags=(
-    '-a[force reinstallation of packages that are already up-to-date]'
-    '-n[print the commands but do not run them]'
-    "-p[number of parallel builds]:number"
-    '-x[print the commands]'
-    "-work[print temporary directory name and keep it]"
-    "-gcflags[flags for 5g/6g/8g]:flags"
-    "-ldflags[flags for 5l/6l/8l]:flags"
-    "-gccgoflags[flags for gccgo]:flags"
-  )
-  __go_list() {
-      local expl importpaths
-      declare -a importpaths
-      importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
-      _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
-  }
-  case ${words[2]} in
-  clean|doc)
-      _arguments -s -w : '*:importpaths:__go_list'
-      ;;
-  fix|fmt|list|vet)
-      _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
-      ;;
-  install)
-      _arguments -s -w : ${build_flags[@]} \
-        "-v[show package names]" \
-	'*:importpaths:__go_list'
-      ;;
-  get)
-      _arguments -s -w : \
-        ${build_flags[@]}
-      ;;
-  build)
-      _arguments -s -w : \
-        ${build_flags[@]} \
-        "-v[show package names]" \
-        "-o[output file]:file:_files" \
-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
-      ;;
-  test)
-      _arguments -s -w : \
-        ${build_flags[@]} \
-        "-c[do not run, compile the test binary]" \
-        "-i[do not run, install dependencies]" \
-        "-v[print test output]" \
-        "-x[print the commands]" \
-        "-short[use short mode]" \
-        "-parallel[number of parallel tests]:number" \
-        "-cpu[values of GOMAXPROCS to use]:number list" \
-        "-run[run tests and examples matching regexp]:regexp" \
-        "-bench[run benchmarks matching regexp]:regexp" \
-        "-benchtime[run each benchmark during n seconds]:duration" \
-        "-timeout[kill test after that duration]:duration" \
-        "-cpuprofile[write CPU profile to file]:file:_files" \
-        "-memprofile[write heap profile to file]:file:_files" \
-        "-memprofilerate[set heap profiling rate]:number" \
-        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
-      ;;
-  help)
-      _values "${commands[@]}" \
-        'gopath[GOPATH environment variable]' \
-        'importpath[description of import paths]' \
-        'remote[remote import path syntax]' \
-        'testflag[description of testing flags]' \
-        'testfunc[description of testing functions]'
-      ;;
-  run)
-      _arguments -s -w : \
-          ${build_flags[@]} \
-          '*:file:_path_files -g "*.go"'
-      ;;
-  tool)
-      if (( CURRENT == 3 )); then
-          _values "go tool" $(go tool)
-          return
-      fi
-      case ${words[3]} in
-      [568]g)
-          _arguments -s -w : \
-              '-I[search for packages in DIR]:includes:_path_files -/' \
-              '-L[show full path in file:line prints]' \
-              '-S[print the assembly language]' \
-              '-V[print the compiler version]' \
-              '-e[no limit on number of errors printed]' \
-              '-h[panic on an error]' \
-              '-l[disable inlining]' \
-              '-m[print optimization decisions]' \
-              '-o[file specify output file]:file' \
-              '-p[assumed import path for this code]:importpath' \
-              '-u[disable package unsafe]' \
-              "*:file:_files -g '*.go'"
-          ;;
-      [568]l)
-          local O=${words[3]%l}
-          _arguments -s -w : \
-              '-o[file specify output file]:file' \
-              '-L[search for packages in DIR]:includes:_path_files -/' \
-              "*:file:_files -g '*.[ao$O]'"
-          ;;
-      dist)
-          _values "dist tool" banner bootstrap clean env install version
-          ;;
-      *)
-          # use files by default
-          _files
-          ;;
-      esac
-      ;;
-  esac
-}
-
-compdef __go_tool_complete go
diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
new file mode 120000
index 000000000..cf943e2e1
--- /dev/null
+++ b/plugins/go/go.plugin.zsh
@@ -0,0 +1 @@
+../golang/golang.plugin.zsh
\ No newline at end of file

From aa9db3e8f9e03156f350b5d32fdf5dfde76a6038 Mon Sep 17 00:00:00 2001
From: Luke Steensen 
Date: Wed, 12 Feb 2014 20:13:00 -0600
Subject: [PATCH 62/94] update golang plugin to match official version

---
 plugins/golang/golang.plugin.zsh | 34 +++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
index e60c4afe4..18bcaaff2 100644
--- a/plugins/golang/golang.plugin.zsh
+++ b/plugins/golang/golang.plugin.zsh
@@ -1,9 +1,10 @@
-# From : http://golang.org/misc/zsh/go?m=text
+# install in /etc/zsh/zshrc or your personal .zshrc
+
 # gc
 prefixes=(5 6 8)
 for p in $prefixes; do
-    compctl -g "*.${p}" ${p}l
-    compctl -g "*.go" ${p}g
+	compctl -g "*.${p}" ${p}l
+	compctl -g "*.go" ${p}g
 done
 
 # standard go tools
@@ -19,6 +20,7 @@ __go_tool_complete() {
     'build[compile packages and dependencies]'
     'clean[remove object files]'
     'doc[run godoc on package sources]'
+    'env[print Go environment information]'
     'fix[run go tool fix on packages]'
     'fmt[run gofmt on package sources]'
     'get[download and install packages and dependencies]'
@@ -39,12 +41,17 @@ __go_tool_complete() {
   build_flags=(
     '-a[force reinstallation of packages that are already up-to-date]'
     '-n[print the commands but do not run them]'
-    "-p[number of parallel builds]:number"
+    '-p[number of parallel builds]:number'
+    '-race[enable data race detection]'
     '-x[print the commands]'
-    "-work[print temporary directory name and keep it]"
-    "-gcflags[flags for 5g/6g/8g]:flags"
-    "-ldflags[flags for 5l/6l/8l]:flags"
-    "-gccgoflags[flags for gccgo]:flags"
+    '-work[print temporary directory name and keep it]'
+    '-ccflags[flags for 5c/6c/8c]:flags'
+    '-gcflags[flags for 5g/6g/8g]:flags'
+    '-ldflags[flags for 5l/6l/8l]:flags'
+    '-gccgoflags[flags for gccgo]:flags'
+    '-compiler[name of compiler to use]:name'
+    '-installsuffix[suffix to add to package directory]:suffix'
+    '-tags[list of build tags to consider satisfied]:tags'
   )
   __go_list() {
       local expl importpaths
@@ -62,7 +69,7 @@ __go_tool_complete() {
   install)
       _arguments -s -w : ${build_flags[@]} \
         "-v[show package names]" \
-    '*:importpaths:__go_list'
+        '*:importpaths:__go_list'
       ;;
   get)
       _arguments -s -w : \
@@ -87,7 +94,10 @@ __go_tool_complete() {
         "-cpu[values of GOMAXPROCS to use]:number list" \
         "-run[run tests and examples matching regexp]:regexp" \
         "-bench[run benchmarks matching regexp]:regexp" \
-        "-benchtime[run each benchmark during n seconds]:duration" \
+        "-benchmem[print memory allocation stats]" \
+        "-benchtime[run each benchmark until taking this long]:duration" \
+        "-blockprofile[write goroutine blocking profile to file]:file" \
+        "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \
         "-timeout[kill test after that duration]:duration" \
         "-cpuprofile[write CPU profile to file]:file:_files" \
         "-memprofile[write heap profile to file]:file:_files" \
@@ -97,7 +107,7 @@ __go_tool_complete() {
   help)
       _values "${commands[@]}" \
         'gopath[GOPATH environment variable]' \
-        'importpath[description of import paths]' \
+        'packages[description of package lists]' \
         'remote[remote import path syntax]' \
         'testflag[description of testing flags]' \
         'testfunc[description of testing functions]'
@@ -147,4 +157,4 @@ __go_tool_complete() {
   esac
 }
 
-compdef __go_tool_complete go
\ No newline at end of file
+compdef __go_tool_complete go

From f6f3e9301940dc21680aa50156355c8dba61b441 Mon Sep 17 00:00:00 2001
From: Emanuele Zattin 
Date: Thu, 13 Feb 2014 10:32:52 +0100
Subject: [PATCH 63/94] Improve oneline logs

Add decorate and color to the normal oneline and add a new alias for graph oneline logs.
---
 plugins/git/git.plugin.zsh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 1285a3247..2b5983f33 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -62,8 +62,10 @@ alias glgg='git log --graph --max-count=10'
 compdef _git glgg=git-log
 alias glgga='git log --graph --decorate --all'
 compdef _git glgga=git-log
-alias glo='git log --oneline'
+alias glo='git log --oneline --decorate --color'
 compdef _git glo=git-log
+alias glog='git log --oneline --decorate --color --graph'
+compdef _git glog=git-log
 alias gss='git status -s'
 compdef _git gss=git-status
 alias ga='git add'

From 354593e9b2b3a7ec3a0840eeadbc7d760cdd7263 Mon Sep 17 00:00:00 2001
From: Igor Timoshenko 
Date: Fri, 14 Feb 2014 14:54:28 +0000
Subject: [PATCH 64/94] Added Yii basic command completion

---
 plugins/yii/yii.plugin.zsh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 plugins/yii/yii.plugin.zsh

diff --git a/plugins/yii/yii.plugin.zsh b/plugins/yii/yii.plugin.zsh
new file mode 100644
index 000000000..b816160f0
--- /dev/null
+++ b/plugins/yii/yii.plugin.zsh
@@ -0,0 +1,17 @@
+# Yii basic command completion
+
+_yii_get_command_list () {
+	protected/yiic | awk '/^ - [a-z]+/ { print $2 }'
+}
+
+_yii () {
+  if [ -f protected/yiic ]; then
+    compadd `_yii_get_command_list`
+  fi
+}
+
+compdef _yii protected/yiic
+compdef _yii yiic
+
+# Aliases
+alias yiic='protected/yiic'

From b0fbe0d11ac60074b4fdc20e332bc2db3e0c0066 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?= 
Date: Thu, 12 Dec 2013 23:27:22 +0100
Subject: [PATCH 65/94] Avoid evaluating special chars in $LINE on title
 command (fixes #2234)

---
 lib/termsupport.zsh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 80319e1a8..6eba8f69a 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -27,9 +27,8 @@ function omz_termsupport_preexec {
   emulate -L zsh
   setopt extended_glob
   local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
-  local LINE="${2:gs/$/\\$}"
-  LINE="${LINE:gs/%/%%}"
-  title "$CMD" "%100>...>$LINE%<<"
+  local LINE="${2}"
+  title "$CMD" '%100>...>$LINE%<<'
 }
 
 autoload -U add-zsh-hook

From b73ced397fc74618d92f748e2744e65f901b368f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?= 
Date: Sat, 14 Dec 2013 02:13:18 +0100
Subject: [PATCH 66/94] Use single quotes also in $LINE definiton

---
 lib/termsupport.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 6eba8f69a..d3d8c967f 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -27,7 +27,7 @@ function omz_termsupport_preexec {
   emulate -L zsh
   setopt extended_glob
   local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
-  local LINE="${2}"
+  local LINE='${2}'
   title "$CMD" '%100>...>$LINE%<<'
 }
 

From 3e5de21dc5b71e332a1526ae14beb662a66d6e26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?= 
Date: Sat, 14 Dec 2013 04:30:29 +0100
Subject: [PATCH 67/94] Revert previous commit, escape %

---
 lib/termsupport.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index d3d8c967f..623bf1f09 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -27,7 +27,7 @@ function omz_termsupport_preexec {
   emulate -L zsh
   setopt extended_glob
   local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
-  local LINE='${2}'
+  local LINE="${2:gs/%/%%}"
   title "$CMD" '%100>...>$LINE%<<'
 }
 

From a951600b4e81d73d71a098e48aa8d296be853bc9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?= 
Date: Mon, 16 Dec 2013 09:24:24 +0100
Subject: [PATCH 68/94] Avoid 'title:parse error' with single quotes in $CMD
 Fixes #2182

---
 lib/termsupport.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 623bf1f09..5f2fe63d4 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -28,7 +28,7 @@ function omz_termsupport_preexec {
   setopt extended_glob
   local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
   local LINE="${2:gs/%/%%}"
-  title "$CMD" '%100>...>$LINE%<<'
+  title '$CMD' '%100>...>$LINE%<<'
 }
 
 autoload -U add-zsh-hook

From 7a546362d35d6c74f9c301aa477594fdf2cc1bfc Mon Sep 17 00:00:00 2001
From: Chris Jones 
Date: Fri, 21 Feb 2014 22:47:56 -0800
Subject: [PATCH 69/94] Much needed PEP8 love. Use spaces, not tabs.

---
 plugins/git-prompt/gitstatus.py | 88 +++++++++++++++++++--------------
 1 file changed, 51 insertions(+), 37 deletions(-)

diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
index ee6fab9bd..6d64e8277 100644
--- a/plugins/git-prompt/gitstatus.py
+++ b/plugins/git-prompt/gitstatus.py
@@ -1,20 +1,30 @@
 #!/usr/bin/env python
 # -*- coding: UTF-8 -*-
+from subprocess import Popen, PIPE
+import re
 
 # change those symbols to whatever you prefer
-symbols = {'ahead of': '↑', 'behind': '↓', 'staged':'♦', 'changed':'‣', 'untracked':'…', 'clean':'⚡', 'unmerged':'≠', 'sha1':':'}
+symbols = {
+    'ahead of': '↑',
+    'behind': '↓',
+    'staged': '♦',
+    'changed': '‣',
+    'untracked': '…',
+    'clean': '⚡',
+    'unmerged': '≠',
+    'sha1': ':'
+}
 
-from subprocess import Popen, PIPE
-
-output,error = Popen(['git','status'], stdout=PIPE, stderr=PIPE).communicate()
+output, error = Popen(
+    ['git', 'status'], stdout=PIPE, stderr=PIPE).communicate()
 
 if error:
-	import sys
-	sys.exit(0)
+    import sys
+    sys.exit(0)
 lines = output.splitlines()
 
-import re
-behead_re = re.compile(r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
+behead_re = re.compile(
+    r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
 diverge_re = re.compile(r"^# and have (\d+) and (\d+) different")
 
 status = ''
@@ -23,46 +33,50 @@ changed = re.compile(r'^# Changed but not updated:$', re.MULTILINE)
 untracked = re.compile(r'^# Untracked files:$', re.MULTILINE)
 unmerged = re.compile(r'^# Unmerged paths:$', re.MULTILINE)
 
+
 def execute(*command):
-	out, err = Popen(stdout=PIPE, stderr=PIPE, *command).communicate()
-	if not err:
-		nb = len(out.splitlines())
-	else:
-		nb = '?'
-	return nb
+    out, err = Popen(stdout=PIPE, stderr=PIPE, *command).communicate()
+    if not err:
+        nb = len(out.splitlines())
+    else:
+        nb = '?'
+    return nb
 
 if staged.search(output):
-	nb = execute(['git','diff','--staged','--name-only','--diff-filter=ACDMRT'])
-	status += '%s%s' % (symbols['staged'], nb)
+    nb = execute(
+        ['git', 'diff', '--staged', '--name-only', '--diff-filter=ACDMRT'])
+    status += '%s%s' % (symbols['staged'], nb)
 if unmerged.search(output):
-	nb = execute(['git','diff', '--staged','--name-only', '--diff-filter=U'])
-	status += '%s%s' % (symbols['unmerged'], nb)
+    nb = execute(['git', 'diff', '--staged', '--name-only', '--diff-filter=U'])
+    status += '%s%s' % (symbols['unmerged'], nb)
 if changed.search(output):
-	nb = execute(['git','diff','--name-only', '--diff-filter=ACDMRT'])
-	status += '%s%s' % (symbols['changed'], nb)
+    nb = execute(['git', 'diff', '--name-only', '--diff-filter=ACDMRT'])
+    status += '%s%s' % (symbols['changed'], nb)
 if untracked.search(output):
-## 		nb = len(Popen(['git','ls-files','--others','--exclude-standard'],stdout=PIPE).communicate()[0].splitlines())
-## 		status += "%s" % (symbols['untracked']*(nb//3 + 1), )
-	status += symbols['untracked']
+    status += symbols['untracked']
 if status == '':
-	status = symbols['clean']
+    status = symbols['clean']
 
 remote = ''
 
 bline = lines[0]
 if bline.find('Not currently on any branch') != -1:
-	branch = symbols['sha1']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1]
+    branch = symbols['sha1'] + Popen([
+        'git',
+        'rev-parse',
+        '--short',
+        'HEAD'], stdout=PIPE).communicate()[0][:-1]
 else:
-	branch = bline.split(' ')[3]
-	bstatusline = lines[1]
-	match = behead_re.match(bstatusline)
-	if match:
-		remote = symbols[match.groups()[0]]
-		remote += match.groups()[2]
-	elif lines[2:]:
-		div_match = diverge_re.match(lines[2])
-	 	if div_match:
-			remote = "{behind}{1}{ahead of}{0}".format(*div_match.groups(), **symbols)
-
-print '\n'.join([branch,remote,status])
+    branch = bline.split(' ')[3]
+    bstatusline = lines[1]
+    match = behead_re.match(bstatusline)
+    if match:
+        remote = symbols[match.groups()[0]]
+        remote += match.groups()[2]
+    elif lines[2:]:
+        div_match = diverge_re.match(lines[2])
+        if div_match:
+            remote = "{behind}{1}{ahead of}{0}".format(
+                *div_match.groups(), **symbols)
 
+print('\n'.join([branch, remote, status]))

From c397000b3b0c1cf3bceb95dfc5fcdaf1844aa751 Mon Sep 17 00:00:00 2001
From: Chris Jones 
Date: Fri, 21 Feb 2014 22:48:38 -0800
Subject: [PATCH 70/94] grab last item in list which is the branch instead of
 relying on position.

---
 plugins/git-prompt/gitstatus.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
index 6d64e8277..ef894bff2 100644
--- a/plugins/git-prompt/gitstatus.py
+++ b/plugins/git-prompt/gitstatus.py
@@ -67,7 +67,7 @@ if bline.find('Not currently on any branch') != -1:
         '--short',
         'HEAD'], stdout=PIPE).communicate()[0][:-1]
 else:
-    branch = bline.split(' ')[3]
+    branch = bline.split(' ')[-1]
     bstatusline = lines[1]
     match = behead_re.match(bstatusline)
     if match:

From 8309b0a19baa351d643194f897d59de7b3d3b3dd Mon Sep 17 00:00:00 2001
From: Eduardo San Martin Morote 
Date: Sun, 23 Feb 2014 10:07:26 +0100
Subject: [PATCH 71/94] Verification of convert inside the function

Depending on when the path is declared this solution would work in any case
---
 plugins/catimg/catimg.plugin.zsh | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
index 70ef9a63c..cb92f5986 100644
--- a/plugins/catimg/catimg.plugin.zsh
+++ b/plugins/catimg/catimg.plugin.zsh
@@ -7,10 +7,11 @@
 # Github: https://github.com/posva/catimg                                      #
 ################################################################################
 
-if [[ -x  `which convert` ]]; then
-  function catimg() {
+
+function catimg() {
+  if [[ -x  `which convert` ]]; then
     zsh $ZSH/plugins/catimg/catimg.sh $@
-  }
-else
-  echo "catimg need convert (ImageMagick) to work)"
-fi
+  else
+    echo "catimg need convert (ImageMagick) to work)"
+  fi
+}

From f139401485ba389cbec5c83357e8827b1c53447b Mon Sep 17 00:00:00 2001
From: Josh Burns 
Date: Fri, 28 Feb 2014 01:26:17 +1100
Subject: [PATCH 72/94] add gem build alias

---
 plugins/gem/gem.plugin.zsh | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 plugins/gem/gem.plugin.zsh

diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
new file mode 100644
index 000000000..5b14fe7d0
--- /dev/null
+++ b/plugins/gem/gem.plugin.zsh
@@ -0,0 +1 @@
+alias gb="gem build *.gemspec"
\ No newline at end of file

From da573f635648efb07603d7172bb08c2f271e1164 Mon Sep 17 00:00:00 2001
From: Josh Burns 
Date: Fri, 28 Feb 2014 01:26:54 +1100
Subject: [PATCH 73/94] add gem push alias

---
 plugins/gem/gem.plugin.zsh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
index 5b14fe7d0..ca2900353 100644
--- a/plugins/gem/gem.plugin.zsh
+++ b/plugins/gem/gem.plugin.zsh
@@ -1 +1,2 @@
-alias gb="gem build *.gemspec"
\ No newline at end of file
+alias gemb="gem build *.gemspec"
+alias gemp="gem push *.gem"
\ No newline at end of file

From fdbf0cbe4687c32846764695fabdf4acdb63a62f Mon Sep 17 00:00:00 2001
From: Josh Burns 
Date: Fri, 28 Feb 2014 01:32:01 +1100
Subject: [PATCH 74/94] gem push alias and gem yank alias

---
 plugins/gem/gem.plugin.zsh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
index ca2900353..938f5c993 100644
--- a/plugins/gem/gem.plugin.zsh
+++ b/plugins/gem/gem.plugin.zsh
@@ -1,2 +1,7 @@
 alias gemb="gem build *.gemspec"
-alias gemp="gem push *.gem"
\ No newline at end of file
+alias gemp="gem push *.gem"
+
+# gemy GEM 0.0.0 = gem yank GEM -v 0.0.0
+function gemy {
+	gem yank $1 -v $2
+}
\ No newline at end of file

From 6dcdfe61e2005728ff7e1e48d452de4b38294799 Mon Sep 17 00:00:00 2001
From: Michael Nikitochkin 
Date: Thu, 27 Feb 2014 11:52:21 +0200
Subject: [PATCH 75/94] :panda_face: Added simulator alias for Xcode plugin

It is often required to start simulator without Xcode.
---
 plugins/xcode/xcode.plugin.zsh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh
index f137253f3..4816ab0ed 100644
--- a/plugins/xcode/xcode.plugin.zsh
+++ b/plugins/xcode/xcode.plugin.zsh
@@ -16,3 +16,4 @@ function xcsel {
 
 alias xcb='xcodebuild'
 alias xcp='xcode-select --print-path'
+alias simulator='open $(xcode-select  -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'

From 5ba96e9a053514d6beb25e5c27cf4af746f142ef Mon Sep 17 00:00:00 2001
From: Kaiwen Xu 
Date: Sun, 2 Mar 2014 03:59:27 -0500
Subject: [PATCH 76/94] Fixed sublime plugin behaviors.

- Fixed subl search path order in Mac because Sublime Text 3 is named
  Sublime Text.app by default instead of Sublime Text 3.app and they are
  mostly likely to be placed in /Applications instead of
  $HOME/Applications.
- Fixed sublime text binary path in Linux. The sublime_text binary
  installed by Ubuntu installer is placed in /opt/sublime_text/sublime_text
  instead of /usr/bin/sublime_text.
- Use zsh's built-in process detach syntax instead of nohup.
---
 plugins/sublime/sublime.plugin.zsh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index 566279183..6ca5892e5 100755
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -3,19 +3,19 @@
 local _sublime_darwin_paths > /dev/null 2>&1
 _sublime_darwin_paths=(
     "/usr/local/bin/subl"
-    "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
-    "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
-    "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
+    "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
     "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
     "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
-    "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
+    "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
+    "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
+    "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
 )
 
 if [[ $('uname') == 'Linux' ]]; then
-    if [ -f '/usr/bin/sublime_text' ]; then
-        st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
+    if [ -f '/opt/sublime_text/sublime_text' ]; then
+        st_run() { /opt/sublime_text/sublime_text $@ &| }
     else
-        st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
+        st_run() { /usr/bin/sublime-text $@ &| }
     fi
     alias st=st_run
 

From 2691520d6f84fd0022fcb82a497042bb92c777b7 Mon Sep 17 00:00:00 2001
From: Kaiwen Xu 
Date: Sun, 2 Mar 2014 14:13:55 -0500
Subject: [PATCH 77/94] Integrate changes from #1841.

---
 plugins/sublime/sublime.plugin.zsh | 41 +++++++++++++++++-------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index 6ca5892e5..a2042343a 100755
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -1,25 +1,32 @@
 # Sublime Text 2 Aliases
 
-local _sublime_darwin_paths > /dev/null 2>&1
-_sublime_darwin_paths=(
-    "/usr/local/bin/subl"
-    "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
-    "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
-    "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
-    "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
-    "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
-    "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
-)
-
 if [[ $('uname') == 'Linux' ]]; then
-    if [ -f '/opt/sublime_text/sublime_text' ]; then
-        st_run() { /opt/sublime_text/sublime_text $@ &| }
-    else
-        st_run() { /usr/bin/sublime-text $@ &| }
-    fi
-    alias st=st_run
+    local _sublime_linux_paths > /dev/null 2>&1
+    _sublime_linux_paths=(
+        "$HOME/bin/sublime_text"
+        "/opt/sublime_text/sublime_text"
+        "/usr/bin/sublime_text"
+        "/usr/local/bin/sublime_text"
+    )
+    for _sublime_path in $_sublime_linux_paths; do
+        if [[ -a $_sublime_path ]]; then
+            st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
+            alias st=st_run
+            break
+        fi
+    done
 
 elif  [[ $('uname') == 'Darwin' ]]; then
+    local _sublime_darwin_paths > /dev/null 2>&1
+    _sublime_darwin_paths=(
+        "/usr/local/bin/subl"
+        "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
+        "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
+        "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
+        "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
+        "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
+        "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
+    )
 
     for _sublime_path in $_sublime_darwin_paths; do
         if [[ -a $_sublime_path ]]; then

From d41ac7fe3e52783054610c2cc57bbbfcdb2202b0 Mon Sep 17 00:00:00 2001
From: Markus Faerevaag 
Date: Tue, 4 Mar 2014 20:25:54 +0100
Subject: [PATCH 78/94] Updated wd plugin to v0.3.0

---
 plugins/wd/_wd.sh        | 96 ++++++++++++++++++++++++----------------
 plugins/wd/wd.plugin.zsh |  4 +-
 plugins/wd/wd.sh         | 75 ++++++++++++++-----------------
 3 files changed, 95 insertions(+), 80 deletions(-)

diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh
index 950564435..29df63520 100644
--- a/plugins/wd/_wd.sh
+++ b/plugins/wd/_wd.sh
@@ -1,48 +1,68 @@
-#compdef wd.sh
+#compdef wd
 
-zstyle ":completion:*:descriptions" format "%B%d%b"
+zstyle ':completion:*:descriptions' format '%B%d%b'
+zstyle ':completion::complete:wd:*:commands' group-name commands
+zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
+zstyle ':completion::complete:wd::' list-grouped
 
-CONFIG=$HOME/.warprc
+# Call `_wd()` when when trying to complete the command `wd`
 
-local -a main_commands
-main_commands=(
-    add:'Adds the current working directory to your warp points'
-    #add'\!':'Overwrites existing warp point' # TODO: Fix
-    rm:'Removes the given warp point'
-    ls:'Outputs all stored warp points'
-    show:'Outputs warp points to current directory'
-)
+zmodload zsh/mapfile
+function _wd() {
+  local ret=1
+  local CONFIG=$HOME/.warprc
 
-local -a points
-while read line
-do
-    points+=$(awk "{ gsub(/\/Users\/$USER|\/home\/$USER/,\"~\"); print }" <<< $line)
-done < $CONFIG
+  # Stolen from
+  # http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands
 
-_wd()
-{
-    # init variables
-    local curcontext="$curcontext" state line
-    typeset -A opt_args
+  # local curcontext="$curcontext" state line
+  # typeset -A opt_args
 
-    # init state
-    _arguments \
-        '1: :->command' \
-        '2: :->argument'
+  local -a commands
+  local -a warp_points
+  warp_points=( "${(f)mapfile[$CONFIG]}" )
+  # LIST="${mapfile[$FNAME]}" # Not required unless stuff uses it
 
-    case $state in
-        command)
-            compadd "$@" add rm ls show
-            _describe -t warp-points 'Warp points:' points && ret=0
-            ;;
-        argument)
-            case $words[2] in
-                rm|add!)
-                    _describe -t warp-points 'warp points' points && ret=0
-                    ;;
-                *)
-            esac
-    esac
+  commands=(
+    'add:Adds the current working directory to your warp points'
+    'add!:Overwrites existing warp point'
+    'rm:Removes the given warp point'
+    'ls:Outputs all stored warp points'
+    'show:Outputs all warp points that point to the current directory'
+    'help:Show this extremely helpful text'
+    '..:Go back to last directory'
+  )
+
+  _arguments -C \
+    '1: :->first_arg' \
+    '2: :->second_arg' && ret=0
+
+  case $state in
+    first_arg)
+      _describe -t warp_points "Warp points" warp_points && ret=0
+      _describe -t commands "Commands" commands && ret=0
+      ;;
+    second_arg)
+      case $words[2] in
+        add\!|rm)
+          _describe -t points "Warp points" warp_points && ret=0
+          ;;
+        add)
+          _message 'Write the name of your warp point' && ret=0
+          ;;
+      esac
+      ;;
+  esac
+
+  return $ret
 }
 
 _wd "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh
index bbec4a715..9800335fc 100755
--- a/plugins/wd/wd.plugin.zsh
+++ b/plugins/wd/wd.plugin.zsh
@@ -6,4 +6,6 @@
 #
 # @github.com/mfaerevaag/wd
 
-alias wd='. $ZSH/plugins/wd/wd.sh'
+wd() {
+    . $ZSH/plugins/wd/wd.sh
+}
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index 744f58bc2..96a3426fc 100755
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -50,12 +50,12 @@ wd_warp()
             wd_print_msg $YELLOW "Warping to current directory?"
         else
             (( n = $#1 - 1 ))
-            wd_print_msg $BLUE "Warping..."
+            #wd_print_msg $BLUE "Warping..."
             cd -$n > /dev/null
         fi
     elif [[ ${points[$1]} != "" ]]
     then
-        wd_print_msg $BLUE "Warping..."
+        #wd_print_msg $BLUE "Warping..."
         cd ${points[$1]}
     else
         wd_print_msg $RED "Unkown warp point '$1'"
@@ -64,16 +64,16 @@ wd_warp()
 
 wd_add()
 {
-    if [[ $1 =~ "^\.+$" ]]
+    if [[ $2 =~ "^\.+$" || $2 =~ "^\s*$" ]]
     then
-        wd_print_msg $RED "Illeagal warp point (see README)."
-    elif [[ ${points[$1]} == "" ]] || $2
+        wd_print_msg $RED "Illegal warp point (see README)."
+    elif [[ ${points[$2]} == "" ]] || $1
     then
-        wd_remove $1 > /dev/null
-        print "$1:$PWD" >> $CONFIG
+        wd_remove $2 > /dev/null
+        print "$2:$PWD" >> $CONFIG
         wd_print_msg $GREEN "Warp point added"
     else
-        wd_print_msg $YELLOW "Warp point '$1' alredy exists. Use 'add!' to overwrite."
+        wd_print_msg $YELLOW "Warp point '$2' already exists. Use 'add!' to overwrite."
     fi
 }
 
@@ -83,7 +83,9 @@ wd_remove()
     then
         if wd_tmp=`sed "/^$1:/d" $CONFIG`
         then
-            echo $wd_tmp > $CONFIG
+            # `>!` forces overwrite
+            # we need this if people use `setopt NO_CLOBBER`
+            echo $wd_tmp >! $CONFIG
             wd_print_msg $GREEN "Warp point removed"
         else
             wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!"
@@ -131,9 +133,9 @@ wd_print_usage()
     print "\nCommands:"
     print "\t add \t Adds the current working directory to your warp points"
     print "\t add! \t Overwrites existing warp point"
-    print "\t remove  Removes the given warp point"
+    print "\t rm \t  Removes the given warp point"
     print "\t show \t Outputs warp points to current directory"
-    print "\t list \t Outputs all stored warp points"
+    print "\t ls \t Outputs all stored warp points"
     print "\t help \t Show this extremely helpful text"
 }
 
@@ -141,7 +143,7 @@ wd_print_usage()
 ## run
 
 # get opts
-args=`getopt -o a:r:lhs -l add:,remove:,list,help,show -- $*`
+args=`getopt -o a:r:lhs -l add:,rm:,ls,help,show -- $*`
 
 # check if no arguments were given
 if [[ $? -ne 0 || $#* -eq 0 ]]
@@ -161,49 +163,40 @@ else
 
     for i
     do
-		    case "$i"
-		        in
-			      -a|--add|add)
-                wd_add $2 false
-				        shift
-                shift
+        case "$i"
+            in
+            -a|--add|add)
+                wd_add false $2
                 break
                 ;;
             -a!|--add!|add!)
-                wd_add $2 true
-				        shift
-                shift
+                wd_add true $2
                 break
                 ;;
-			      -r|--remove|rm)
-				        wd_remove $2
-                shift
-				        shift
+            -r|--remove|rm)
+                wd_remove $2
                 break
                 ;;
-			      -l|--list|ls)
-				        wd_list_all
-				        shift
+            -l|--list|ls)
+                wd_list_all
                 break
                 ;;
-			      -h|--help|help)
-				        wd_print_usage
-				        shift
+            -h|--help|help)
+                wd_print_usage
                 break
                 ;;
-			      -s|--show|show)
-				        wd_show
-				        shift
+            -s|--show|show)
+                wd_show
                 break
                 ;;
             *)
                 wd_warp $i
-                shift
                 break
                 ;;
-			      --)
-				        shift; break;;
-		    esac
+            --)
+                break
+                ;;
+        esac
     done
 fi
 
@@ -211,6 +204,6 @@ fi
 ## garbage collection
 # if not, next time warp will pick up variables from this run
 # remember, there's no sub shell
-points=""
-args=""
-unhash -d val &> /dev/null # fixes issue #1
+unset points
+unset args
+unset val &> /dev/null # fixes issue #1

From 8b667b229973dee2abb52edacbd056cbe52bb8f7 Mon Sep 17 00:00:00 2001
From: Jouko Johansson 
Date: Fri, 7 Mar 2014 01:09:04 +0200
Subject: [PATCH 79/94] added mvn-update

---
 plugins/mvn/mvn.plugin.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 0c9141907..4ef342e60 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -52,7 +52,7 @@ alias mvnc='mvn clean'
 alias mvncom='mvn compile'
 alias mvnt='mvn test'
 alias mvnag='mvn archetype:generate'
-
+alias mvn-updates='mvn versions:display-dependency-updates'
 function listMavenCompletions { 
      reply=(
         # common lifecycle

From 7378765a79491c836831543a6da3d88dac9b7568 Mon Sep 17 00:00:00 2001
From: Jouko Johansson 
Date: Fri, 7 Mar 2014 01:22:37 +0200
Subject: [PATCH 80/94] added aliases for tomcat:run tomcat7:run

---
 plugins/mvn/mvn.plugin.zsh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 4ef342e60..e9d7c0fc1 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -53,6 +53,10 @@ alias mvncom='mvn compile'
 alias mvnt='mvn test'
 alias mvnag='mvn archetype:generate'
 alias mvn-updates='mvn versions:display-dependency-updates'
+alias mvntc7='mvn tomcat7:run' 
+alias mvntc='mvn tomcat:run'
+
+
 function listMavenCompletions { 
      reply=(
         # common lifecycle

From fd8ce7f8e3ea96a7746e46339e447f7cbb83aa57 Mon Sep 17 00:00:00 2001
From: Jouko Johansson 
Date: Fri, 7 Mar 2014 01:23:37 +0200
Subject: [PATCH 81/94] added mvnjetty alias

---
 plugins/mvn/mvn.plugin.zsh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index e9d7c0fc1..ed7968534 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -55,6 +55,7 @@ alias mvnag='mvn archetype:generate'
 alias mvn-updates='mvn versions:display-dependency-updates'
 alias mvntc7='mvn tomcat7:run' 
 alias mvntc='mvn tomcat:run'
+alias mvnjetty='mvn jetty:run'
 
 
 function listMavenCompletions { 

From c249c69065f1216bd83f5bd92e87f560e42675fb Mon Sep 17 00:00:00 2001
From: Dan Kerimdzhanov 
Date: Sat, 8 Mar 2014 23:51:16 +0600
Subject: [PATCH 82/94] Remove all copyright information in themes. Closes
 #2587

---
 themes/adben.zsh-theme         | 13 +++++--------
 themes/af-magic.zsh-theme      |  6 ------
 themes/avit.zsh-theme          | 18 ------------------
 themes/candy-kingdom.zsh-theme |  7 -------
 themes/dogenpunk.zsh-theme     |  8 +-------
 themes/duellj.zsh-theme        |  1 -
 themes/eastwood.zsh-theme      |  4 ++--
 themes/essembeh.zsh-theme      |  1 -
 themes/fino-time.zsh-theme     |  2 +-
 themes/fino.zsh-theme          |  5 ++---
 themes/fox.zsh-theme           |  3 ++-
 themes/gianu.zsh-theme         |  5 -----
 themes/intheloop.zsh-theme     |  3 +--
 themes/itchy.zsh-theme         |  1 -
 themes/jaischeema.zsh-theme    |  9 +--------
 themes/juanghurtado.zsh-theme  |  7 ++-----
 themes/junkfood.zsh-theme      |  4 ----
 themes/kphoen.zsh-theme        |  9 +--------
 themes/pure.zsh-theme          | 22 ----------------------
 themes/rixius.zsh-theme        |  3 ---
 themes/smt.zsh-theme           |  8 +-------
 themes/sorin.zsh-theme         | 10 ++--------
 themes/sunrise.zsh-theme       |  4 +---
 themes/trapd00r.zsh-theme      |  3 +--
 24 files changed, 23 insertions(+), 133 deletions(-)

diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme
index b64714f32..aa3093f64 100644
--- a/themes/adben.zsh-theme
+++ b/themes/adben.zsh-theme
@@ -2,12 +2,12 @@
 # #
 # # #README
 # #
-# # This theme provides two customizable header functionalities : 
+# # This theme provides two customizable header functionalities:
 # # a) displaying a pseudo-random message from a database of quotations
 # # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29)
-# # b) displaying randomly command line tips from The command line fu 
+# # b) displaying randomly command line tips from The command line fu
 # # (http://www.commandlinefu.com) community: in order to make use of this functionality
-# # you will need Internet connection. 
+# # you will need Internet connection.
 # # This theme provides as well information for the current user's context, like;
 # # branch and status for the current version control system (git and svn currently
 # # supported) and time, presented to the user in a non invasive volatile way.
@@ -25,11 +25,8 @@
 # # -Solarized theme (https://github.com/altercation/solarized/)
 # # -OS X: iTerm 2 (http://www.iterm2.com/)
 # # -font Source code pro (https://github.com/adobe/source-code-pro)
-# # 
-# # Author: Adolfo Benedetti
-# # email: adolfo.benedetti@gmail.com
-# # License: Public Domain
-# # This theme's look and feel is based on the Aaron Toponce's zsh theme , more info: 
+# #
+# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info:
 # # http://pthree.org/2008/11/23/727/
 # # enjoy!
 ########## COLOR ###########
diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 3c2f45658..97d142a0f 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -1,12 +1,6 @@
 # af-magic.zsh-theme
-#
-# Author: Andy Fleming
-# URL: http://andyfleming.com/
 # Repo: https://github.com/andyfleming/oh-my-zsh
 # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
-#
-# Created on:		June 19, 2012
-# Last modified on:	June 20, 2012
 
 if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 51f5e375a..a21a9c8c4 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -1,22 +1,4 @@
-#
-# Author:: Andrew Vit ()
-#
 # AVIT ZSH Theme
-#
-# Copyright 2011, Andrew Vit
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
 
 PROMPT='
 $(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme
index 25aeb6597..718977d90 100644
--- a/themes/candy-kingdom.zsh-theme
+++ b/themes/candy-kingdom.zsh-theme
@@ -1,11 +1,4 @@
 # neuralsanwich.zsh-theme
-#
-# Author: Sean Jones
-# URL: http://www.neuralsandwich.com
-# Repo: 
-# Direct link:
-# Create:
-# Modified: 
 
 if [ "x$OH_MY_ZSH_HG" = "x" ]; then
     OH_MY_ZSH_HG="hg"
diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme
index f4d65ab74..0bd38acc2 100644
--- a/themes/dogenpunk.zsh-theme
+++ b/themes/dogenpunk.zsh-theme
@@ -1,10 +1,4 @@
-# -----------------------------------------------------------------------------
-#          FILE: dogenpunk.zsh-theme
-#   DESCRIPTION: oh-my-zsh theme file.
-#        AUTHOR: Matthew Nelson (dogenpunk@gmail.com)
-#       VERSION: 0.1
-#    SCREENSHOT: coming soon
-# -----------------------------------------------------------------------------
+# dogenpunk.zsh-theme
 
 MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
 local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme
index 7350b4335..3849c35be 100644
--- a/themes/duellj.zsh-theme
+++ b/themes/duellj.zsh-theme
@@ -1,4 +1,3 @@
-
 # user, host, full path, and time/date
 # on two lines for easier vgrepping
 # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme
index db2529990..1b284cdc2 100644
--- a/themes/eastwood.zsh-theme
+++ b/themes/eastwood.zsh-theme
@@ -1,4 +1,4 @@
-#RVM settings
+# RVM settings
 if [[ -s ~/.rvm/scripts/rvm ]] ; then 
   RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
 else
@@ -12,7 +12,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
 ZSH_THEME_GIT_PROMPT_CLEAN=""
 
-#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
+# Customized git status, oh-my-zsh currently does not allow render dirty status before branch
 git_custom_status() {
   local cb=$(current_branch)
   if [ -n "$cb" ]; then
diff --git a/themes/essembeh.zsh-theme b/themes/essembeh.zsh-theme
index 8c98ea1ed..939bb7a4c 100644
--- a/themes/essembeh.zsh-theme
+++ b/themes/essembeh.zsh-theme
@@ -1,7 +1,6 @@
 # Theme with full path names and hostname
 # Handy if you work on different servers all the time;
 
-
 local return_code="%(?..%{$fg_bold[red]%}%? ↵%{$reset_color%})"
 
 function my_git_prompt_info() {
diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme
index 7154e09f1..901c4d99f 100644
--- a/themes/fino-time.zsh-theme
+++ b/themes/fino-time.zsh-theme
@@ -1,4 +1,4 @@
-# Fino-time theme by Aexander Berezovsky (http://berezovsky.me) based on Fino by Max Masnick (http://max.masnick.me)
+# fino-time.zsh-theme
 
 # Use with a dark background and 256-color terminal!
 # Meant for people with RVM and git. Tested only on OS X 10.7.
diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme
index 4c7aabcff..35e6e02c1 100644
--- a/themes/fino.zsh-theme
+++ b/themes/fino.zsh-theme
@@ -1,4 +1,4 @@
-# Fino theme by Max Masnick (http://max.masnick.me)
+# fino.zsh-theme
 
 # Use with a dark background and 256-color terminal!
 # Meant for people with rbenv and git. Tested only on OS X 10.7.
@@ -11,7 +11,6 @@
 #
 # Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
 
-
 function prompt_char {
   git branch >/dev/null 2>/dev/null && echo "±" && return
   echo '○'
@@ -41,4 +40,4 @@ PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$F
 ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
 ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
 ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘"
-ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
\ No newline at end of file
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
diff --git a/themes/fox.zsh-theme b/themes/fox.zsh-theme
index 1959853cf..3ecd4e204 100644
--- a/themes/fox.zsh-theme
+++ b/themes/fox.zsh-theme
@@ -1,4 +1,5 @@
-#fox theme
+# fox.zsh-theme
+
 PROMPT='%{$fg[cyan]%}┌[%{$fg_bold[white]%}%n%{$reset_color%}%{$fg[cyan]%}☮%{$fg_bold[white]%}%M%{$reset_color%}%{$fg[cyan]%}]%{$fg[white]%}-%{$fg[cyan]%}(%{$fg_bold[white]%}%~%{$reset_color%}%{$fg[cyan]%})$(git_prompt_info)
 └> % %{$reset_color%}'
 
diff --git a/themes/gianu.zsh-theme b/themes/gianu.zsh-theme
index c7fe40665..faa80218e 100644
--- a/themes/gianu.zsh-theme
+++ b/themes/gianu.zsh-theme
@@ -1,8 +1,3 @@
-# Oh-my-Zsh prompt created by gianu
-#
-# github.com/gianu
-# sgianazza@gmail.com
-
 PROMPT='[%{$fg_bold[white]%}%n%{$reset_color%}@%{$fg_bold[red]%}%m%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%}]$ '
 
 ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg_bold[green]%}"
diff --git a/themes/intheloop.zsh-theme b/themes/intheloop.zsh-theme
index 85b4a4d95..7a98db27a 100644
--- a/themes/intheloop.zsh-theme
+++ b/themes/intheloop.zsh-theme
@@ -1,4 +1,3 @@
-# ZSH theme by James Smith (http://loopj.com)
 # A multiline prompt with username, hostname, full path, return status, git branch, git dirty status, git remote status
 
 local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
@@ -21,4 +20,4 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[grey]%}) %{$fg[yellow]%}⚡%{$reset_color%}"
 ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})"
 ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}↓%{$reset_color%}"
 ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}↑%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}"
\ No newline at end of file
+ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}↕%{$reset_color%}"
diff --git a/themes/itchy.zsh-theme b/themes/itchy.zsh-theme
index afc2abf69..c23889edf 100644
--- a/themes/itchy.zsh-theme
+++ b/themes/itchy.zsh-theme
@@ -1,4 +1,3 @@
-# Created by Daniel Bayerlein https://github.com/danielbayerlein
 # Inspired by http://peepcode.com/blog/2012/my-command-line-prompt
 
 local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})"
diff --git a/themes/jaischeema.zsh-theme b/themes/jaischeema.zsh-theme
index aecc5b961..da1dd1e5d 100644
--- a/themes/jaischeema.zsh-theme
+++ b/themes/jaischeema.zsh-theme
@@ -1,11 +1,4 @@
-# ------------------------------------------------------------------------------
-#          FILE:  jaischeema.zsh-theme
-#   DESCRIPTION:  oh-my-zsh theme file.
-#        AUTHOR:  Jais Cheema
-#       VERSION:  0.0.1
-# ------------------------------------------------------------------------------
-
-
+# jaischeema.zsh-theme
 
 PROMPT='%{$fg_bold[magenta]%}%m%{$reset_color%} at %{$fg_bold[green]%}%~%{$reset_color%} %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}%{$fg[red]%}❯%{$reset_color%} '
 
diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme
index 2f715cc9e..bc470e838 100644
--- a/themes/juanghurtado.zsh-theme
+++ b/themes/juanghurtado.zsh-theme
@@ -1,7 +1,4 @@
-# ------------------------------------------------------------------------
-# Juan G. Hurtado oh-my-zsh theme
-# (Needs Git plugin for current_branch method)
-# ------------------------------------------------------------------------
+# Needs Git plugin for current_branch method
 
 # Color shortcuts
 RED=$fg[red]
@@ -43,4 +40,4 @@ ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]"
 PROMPT='
 %{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%}
 %{$BLUE%}>%{$RESET_COLOR%} '
-RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
\ No newline at end of file
+RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
diff --git a/themes/junkfood.zsh-theme b/themes/junkfood.zsh-theme
index 57b4070dc..01fae4b95 100644
--- a/themes/junkfood.zsh-theme
+++ b/themes/junkfood.zsh-theme
@@ -1,8 +1,4 @@
-# ------------------------------------------------------------------------
-# Tyler Cipriani 
-# oh-my-zsh theme
 # Totally ripped off Dallas theme
-# ------------------------------------------------------------------------
 
 # Grab the current date (%W) and time (%t):
 JUNKFOOD_TIME_="%{$fg_bold[red]%}#%{$fg_bold[white]%}( %{$fg_bold[yellow]%}%W%{$reset_color%}@%{$fg_bold[white]%}%t )( %{$reset_color%}"
diff --git a/themes/kphoen.zsh-theme b/themes/kphoen.zsh-theme
index 0e9b5e73c..8e8894a34 100644
--- a/themes/kphoen.zsh-theme
+++ b/themes/kphoen.zsh-theme
@@ -1,11 +1,4 @@
-# ------------------------------------------------------------------------------
-#          FILE:  kphoen.zsh-theme
-#   DESCRIPTION:  oh-my-zsh theme file.
-#        AUTHOR:  Kévin Gomez (geek63@gmail.com)
-#       VERSION:  1.0.0
-#    SCREENSHOT:
-# ------------------------------------------------------------------------------
-
+# kphoen.zsh-theme
 
 if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
     PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)]
diff --git a/themes/pure.zsh-theme b/themes/pure.zsh-theme
index d7ed624e4..1473194a5 100644
--- a/themes/pure.zsh-theme
+++ b/themes/pure.zsh-theme
@@ -18,28 +18,6 @@
 #   Github:   https://github.com/nicoulaj
 #   Twitter:  https://twitter.com/nicoulaj
 #
-# License
-#
-# Copyright (c) 2013 Kasper Kronborg Isager
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
 # ------------------------------------------------------------------------------
 
 # Set required options
diff --git a/themes/rixius.zsh-theme b/themes/rixius.zsh-theme
index c0c5c9c71..b33f23e1c 100644
--- a/themes/rixius.zsh-theme
+++ b/themes/rixius.zsh-theme
@@ -1,6 +1,3 @@
-# /|/ Code by Stephen
-# /|/ "Rixius" Middleton
-# 
 # name in folder (github)
 # ± if in github repo, or ≥ if otherwise Time in 24-hour format is on right.
 function collapse_pwd {
diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme
index bbd1031e1..f2b0526b7 100644
--- a/themes/smt.zsh-theme
+++ b/themes/smt.zsh-theme
@@ -1,10 +1,4 @@
-# -----------------------------------------------------------------------------
-#          FILE: smt.zsh-theme
-#   DESCRIPTION: oh-my-zsh theme file, based on dogenpunk by Matthew Nelson.
-#        AUTHOR: Stephen Tudor (stephen@tudorstudio.com
-#       VERSION: 0.1
-#    SCREENSHOT: coming soon
-# -----------------------------------------------------------------------------
+# smt.zsh-theme, based on dogenpunk by Matthew Nelson.
 
 MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
 local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%} "
diff --git a/themes/sorin.zsh-theme b/themes/sorin.zsh-theme
index 601dbe5d7..ac6a49840 100644
--- a/themes/sorin.zsh-theme
+++ b/themes/sorin.zsh-theme
@@ -1,11 +1,5 @@
-# ------------------------------------------------------------------------------
-#          FILE:  sorin.zsh-theme
-#   DESCRIPTION:  oh-my-zsh theme file.
-#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
-#       VERSION:  1.0.2
-#    SCREENSHOT:  http://i.imgur.com/aipDQ.png
-# ------------------------------------------------------------------------------
-
+# sorin.zsh-theme
+# screenshot: http://i.imgur.com/aipDQ.png
 
 if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then
   MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme
index acc6ed312..4bea20a1b 100644
--- a/themes/sunrise.zsh-theme
+++ b/themes/sunrise.zsh-theme
@@ -1,8 +1,6 @@
-#-------------------------------------------------------------------------------
-# Sunrise theme for oh-my-zsh by Adam Lindberg (eproxus@gmail.com)
+# Sunrise theme for oh-my-zsh
 # Intended to be used with Solarized: http://ethanschoonover.com/solarized
 # (Needs Git plugin for current_branch method)
-#-------------------------------------------------------------------------------
 
 # Color shortcuts
 R=$fg_no_bold[red]
diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme
index cba14c42c..cb1c43c56 100644
--- a/themes/trapd00r.zsh-theme
+++ b/themes/trapd00r.zsh-theme
@@ -1,5 +1,4 @@
-# Name:   trapd00r zsh theme
-# Author: Magnus Woldrich 
+# trapd00r.zsh-theme
 #
 # This theme needs a terminal supporting 256 colors as well as unicode. It also
 # needs the script that splits up the current path and makes it fancy as located

From 5bd590ceb30ca58d96ec8d5dcfc1fec71bc6ca1f Mon Sep 17 00:00:00 2001
From: Andrew Vit 
Date: Sat, 8 Mar 2014 13:13:52 -0800
Subject: [PATCH 83/94] Reference default install path from ZSH variable

---
 tools/install.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/install.sh b/tools/install.sh
index b24bb4ad3..01984ea2b 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -1,16 +1,16 @@
-ZSH=`/usr/bin/env|grep 'ZSH='|cut -d '=' -f 2`
-if [ -d "$ZSH" ]
+if [ ! -n $ZSH ]
+then
+  ZSH=~/.oh-my-zsh
+fi
+
+if [ -d $ZSH ]
 then
   echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install"
   exit
-elif [ -d ~/.oh-my-zsh ]
-then
-  echo "\033[0;33mYou already have One Oh My Zsh Directory.\033[0m You'll need to remove  ~/.oh-my-zsh if you want to clone"
-  exit
 fi
 
 echo "\033[0;34mCloning Oh My Zsh...\033[0m"
-hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || {
+hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
   echo "git not installed"
   exit
 }
@@ -23,7 +23,7 @@ then
 fi
 
 echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
-cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
+cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
 
 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
 sed -i -e "/export PATH=/ c\\

From 2e11e2ab5adaea762b7f2eaa6c63332a9618bb3f Mon Sep 17 00:00:00 2001
From: Andrew Vit 
Date: Sat, 8 Mar 2014 13:15:18 -0800
Subject: [PATCH 84/94] Write install path into .zshrc

---
 tools/install.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/install.sh b/tools/install.sh
index 01984ea2b..5c7a5b6ca 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -24,6 +24,9 @@ fi
 
 echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
 cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
+sed -i -e "/^ZSH=/ c\\
+ZSH=$ZSH
+" ~/.zshrc
 
 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
 sed -i -e "/export PATH=/ c\\

From da1fa3b06a6369a5b3337025da164eeec275db70 Mon Sep 17 00:00:00 2001
From: Andrew Vit 
Date: Sat, 8 Mar 2014 13:17:16 -0800
Subject: [PATCH 85/94] Abort installer on errors

---
 tools/install.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/install.sh b/tools/install.sh
index 5c7a5b6ca..343f251ae 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -1,3 +1,5 @@
+set -e
+
 if [ ! -n $ZSH ]
 then
   ZSH=~/.oh-my-zsh

From 9f66d5b797ab73a54d944a7bd43d920a508625ea Mon Sep 17 00:00:00 2001
From: Andrew Vit 
Date: Mon, 23 Apr 2012 14:01:14 -0700
Subject: [PATCH 86/94] Document alternate install paths via ZSH variable

Uses environment variable $ZSH to configure install location.
---
 README.textile | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/README.textile b/README.textile
index 810569486..0fa9b30ec 100644
--- a/README.textile
+++ b/README.textile
@@ -20,8 +20,18 @@ h4. via `wget`
 
 @wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
 
-h3. The manual way
+h4. Optional: change the install directory
 
+The default location is `~/.oh-my-zsh` (hidden in your home directory).
+
+You can change the install directory with the ZSH environment variable, either
+by running `export ZSH=/your/path` before installing, or setting it before the
+end of the install pipeline like this:
+
+@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
+
+
+h3. The manual way
 
 1. Clone the repository
 
@@ -35,7 +45,6 @@ h3. The manual way
 
   @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
 
-
 4. Set zsh as your default shell:
 
   @chsh -s /bin/zsh@
@@ -46,6 +55,8 @@ h3. Problems?
 
 You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
 
+If you installed manually or changed the install location, check ZSH in ~/.zshrc
+
 h2. Usage
 
 * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)

From de0e7b5dc82ca3f18d20bc0d8aab8d9c5dd13ff9 Mon Sep 17 00:00:00 2001
From: Zhou Hua 
Date: Mon, 10 Mar 2014 11:41:25 +0800
Subject: [PATCH 87/94] Fix hgsl alias.

The original 'hgsl' missed 'hg' part.
---
 plugins/mercurial/mercurial.plugin.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
index d2db89d04..2e99a12fb 100644
--- a/plugins/mercurial/mercurial.plugin.zsh
+++ b/plugins/mercurial/mercurial.plugin.zsh
@@ -13,7 +13,7 @@ alias hglr='hg pull --rebase'
 alias hgo='hg outgoing'
 alias hgp='hg push'
 alias hgs='hg status'
-alias hgsl='log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
+alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
 # this is the 'git commit --amend' equivalent
 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
 

From b71a2b9d0f21c0b95840a2534eca2d866a48a941 Mon Sep 17 00:00:00 2001
From: Kaiwen Xu 
Date: Mon, 10 Mar 2014 04:05:14 -0400
Subject: [PATCH 88/94] Removed unsolicited aliases.

Those aliases should be in user's .zshrc file, instead of being default.
---
 lib/aliases.zsh | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/aliases.zsh b/lib/aliases.zsh
index 2094f60a0..3044c9660 100644
--- a/lib/aliases.zsh
+++ b/lib/aliases.zsh
@@ -6,11 +6,6 @@ alias po='popd'
 alias ...='cd ../..'
 alias -- -='cd -'
 
-# Prevent headaches
-alias cp='cp -v'
-alias rm='rm -v'
-alias mv='mv -v'
-
 # Super user
 alias _='sudo'
 alias please='sudo'

From 3c9a29b0d639f52162eb8056a9b657fe4b6f2850 Mon Sep 17 00:00:00 2001
From: Bob Maerten 
Date: Mon, 10 Mar 2014 16:23:14 +0100
Subject: [PATCH 89/94] Fix typo in autocomplete arguments

---
 plugins/docker/_docker | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index f13f876cf..12eee7a15 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -111,7 +111,7 @@ __ps() {
         '-beforeId="[Show only container created before Id, include non-running ones.]' \
         '-l[Show only the latest created container, include non-running ones.]' \
         '-n=[Show n last created containers, include non-running ones.]' \
-        '-notrurrrrnc[Dont truncate output]' \
+        '-notrunc[Dont truncate output]' \
         '-q[Only display numeric IDs]' \
         '-s[Display sizes]' \
         '-sinceId="[Show only containers created since Id, include non-running ones.]'

From b9841b0bae97049d426c652f6a9be361c7492040 Mon Sep 17 00:00:00 2001
From: Samvel Khalatyan 
Date: Mon, 10 Mar 2014 17:18:50 -0500
Subject: [PATCH 90/94] Add github url shortener

---
 plugins/github/github.plugin.zsh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
index 66a10cfdb..25b1a1e1b 100644
--- a/plugins/github/github.plugin.zsh
+++ b/plugins/github/github.plugin.zsh
@@ -84,5 +84,14 @@ exist_gh() { # [DIRECTORY]
     git push -u origin master
 }
 
+# git.io "GitHub URL"
+#
+# Shorten GitHub url, example:
+#   https://github.com/nvogel/dotzsh    >   http://git.io/8nU25w  
+# source: https://github.com/nvogel/dotzsh
+# documentation: https://github.com/blog/985-git-io-github-url-shortener
+#
+git.io() {curl -i -s http://git.io -F "url=$1" | grep "Location" | cut -f 2 -d " "}
+
 # End Functions #############################################################
 

From c3c8cc318de898257fd7c5be6f862098966fbbdf Mon Sep 17 00:00:00 2001
From: Ryan Marsh 
Date: Mon, 10 Mar 2014 18:36:51 -0500
Subject: [PATCH 91/94] Fixes #2467 tab completion scrolls back in terminal
 when using bureau theme

---
 themes/bureau.zsh-theme | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme
index 1d88f54d0..4d9cae0cc 100644
--- a/themes/bureau.zsh-theme
+++ b/themes/bureau.zsh-theme
@@ -101,12 +101,12 @@ _1RIGHT="[%*] "
 
 bureau_precmd () {
   _1SPACES=`get_space $_1LEFT $_1RIGHT`
-  echo
+  print 
+  print -rP "$_1LEFT$_1SPACES$_1RIGHT"
 }
 
 setopt prompt_subst
-PROMPT='$_1LEFT$_1SPACES$_1RIGHT
-> $_LIBERTY '
+PROMPT='> $_LIBERTY '
 RPROMPT='$(nvm_prompt_info) $(bureau_git_prompt)'
 
 autoload -U add-zsh-hook

From b6cbba9dfee5985232b473e94595c2fb1ab83715 Mon Sep 17 00:00:00 2001
From: Robby Russell 
Date: Wed, 12 Mar 2014 07:52:20 -0700
Subject: [PATCH 92/94] Updating README to show the new install URL, which
 redirects to the raw files on github.

---
 README.textile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.textile b/README.textile
index 810569486..b80294c60 100644
--- a/README.textile
+++ b/README.textile
@@ -14,11 +14,11 @@ You can install this via the command line with either `curl` or `wget`.
 
 h4. via `curl`
 
-@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
+@curl -L http://install.ohmyz.sh | sh@
 
 h4. via `wget`
 
-@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
+@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
 
 h3. The manual way
 

From 5f5e5508b0560339f7f57fa125496d0b9f1ea077 Mon Sep 17 00:00:00 2001
From: Jon Tewksbury 
Date: Wed, 12 Mar 2014 22:37:25 -0700
Subject: [PATCH 93/94] Update license year

Fix outdated copyright year (updated to 2014).
The copyright year was out of date. Copyright notices must reflect the current year, so this commit updates the listed year to 2014.

See http://www.copyright.gov/circs/circ01.pdf for more info.
---
 MIT-LICENSE.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt
index f6edab65b..6eb8aab34 100644
--- a/MIT-LICENSE.txt
+++ b/MIT-LICENSE.txt
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
+Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

From 47b0d754ae368af16957903f203ee902c7faeec1 Mon Sep 17 00:00:00 2001
From: Robby Russell 
Date: Thu, 13 Mar 2014 10:15:18 -0700
Subject: [PATCH 94/94] Fixing a few quirks in the latest installer updates
 (quoting /Users/robbyrussell/.oh-my-zsh and such). Also mentioining our
 twitter account after install

---
 tools/install.sh | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tools/install.sh b/tools/install.sh
index 343f251ae..71e19a389 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -1,12 +1,10 @@
 set -e
 
-if [ ! -n $ZSH ]
-then
+if [ ! -n "$ZSH" ]; then
   ZSH=~/.oh-my-zsh
 fi
 
-if [ -d $ZSH ]
-then
+if [ -d "$ZSH" ]; then
   echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install"
   exit
 fi
@@ -18,8 +16,7 @@ hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh
 }
 
 echo "\033[0;34mLooking for an existing zsh config...\033[0m"
-if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
-then
+if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
   echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m";
   mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
 fi
@@ -43,9 +40,8 @@ echo "\033[0;32m"'  ____  / /_     ____ ___  __  __   ____  _____/ /_  '"\033[0m
 echo "\033[0;32m"' / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ '"\033[0m"
 echo "\033[0;32m"'/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / '"\033[0m"
 echo "\033[0;32m"'\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  '"\033[0m"
-echo "\033[0;32m"'                        /____/                       '"\033[0m"
-
-echo "\n\n \033[0;32m....is now installed.\033[0m"
+echo "\033[0;32m"'                        /____/                       ....is now installed!'"\033[0m"
 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m"
+echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m"
 /usr/bin/env zsh
 . ~/.zshrc