bf4d4db72b065bff57d75355f49192175364b8a5
- Author
- Andrew vonderLuft <avonderluft@avlux.net>
- Committer
- Andrew vonderLuft <avonderluft@avlux.net>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt
2index f6edab65be3f5703ec53770faf794d29a9aa1cd6..6eb8aab34f66de325a336c327b9abb1b476e6ad3 100644
3--- a/MIT-LICENSE.txt
4+++ b/MIT-LICENSE.txt
5@@ -1,6 +1,6 @@
6 The MIT License
7
8-Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
9+Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
10
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13diff --git a/README.textile b/README.textile
14index 81056948611083793e95c6e021f65f460c99ee9f..c808fb5d706fb5e8760cba4b1c45ed14583e44bd 100644
15--- a/README.textile
16+++ b/README.textile
17@@ -14,15 +14,25 @@ You can install this via the command line with either `curl` or `wget`.
18
19 h4. via `curl`
20
21-@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
22+@curl -L http://install.ohmyz.sh | sh@
23
24 h4. via `wget`
25
26-@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
27+@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
28
29-h3. The manual way
30+h4. Optional: change the install directory
31+
32+The default location is `~/.oh-my-zsh` (hidden in your home directory).
33+
34+You can change the install directory with the ZSH environment variable, either
35+by running `export ZSH=/your/path` before installing, or setting it before the
36+end of the install pipeline like this:
37+
38+@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
39
40
41+h3. The manual way
42+
43 1. Clone the repository
44
45 @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
46@@ -35,7 +45,6 @@ h3. The manual way
47
48 @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
49
50-
51 4. Set zsh as your default shell:
52
53 @chsh -s /bin/zsh@
54@@ -46,6 +55,8 @@ h3. Problems?
55
56 You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
57
58+If you installed manually or changed the install location, check ZSH in ~/.zshrc
59+
60 h2. Usage
61
62 * enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
63diff --git a/lib/aliases.zsh b/lib/aliases.zsh
64index b279bf85566ef4ce489d8c4f97b624ccf92dc41f..3044c966099cd8b1ac397859d5ad98af08309e3b 100644
65--- a/lib/aliases.zsh
66+++ b/lib/aliases.zsh
67@@ -27,9 +27,9 @@ else
68 fi
69 # List direcory contents
70 alias lsa='ls -lah'
71-alias l='ls -la'
72-alias ll='ls -l'
73-alias la='ls -lA'
74+alias l='ls -lah'
75+alias ll='ls -lh'
76+alias la='ls -lAh'
77 alias sl=ls # often screw this up
78
79 alias afind='ack-grep -il'
80diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
81index 49f80c8f34e22b2338ead858028a55485bb8f823..94f1842f37b5f38a5c6387ec6aae243af0820e34 100644
82--- a/lib/key-bindings.zsh
83+++ b/lib/key-bindings.zsh
84@@ -1,34 +1,43 @@
85-# TODO: Explain what some of this does..
86-
87-bindkey -e
88-bindkey '\ew' kill-region
89-bindkey -s '\el' "ls\n"
90-bindkey '^r' history-incremental-search-backward
91-bindkey "^[[5~" up-line-or-history
92-bindkey "^[[6~" down-line-or-history
93-
94-# make search up and down work, so partially type and hit up/down to find relevant stuff
95-bindkey '^[[A' up-line-or-search
96-bindkey '^[[B' down-line-or-search
97-
98-bindkey "^[[H" beginning-of-line
99-bindkey "^[[1~" beginning-of-line
100-bindkey "^[OH" beginning-of-line
101-bindkey "^[[F" end-of-line
102-bindkey "^[[4~" end-of-line
103-bindkey "^[OF" end-of-line
104-bindkey ' ' magic-space # also do history expansion on space
105-
106-bindkey "^[[1;5C" forward-word
107-bindkey "^[[1;5D" backward-word
108-
109-bindkey '^[[Z' reverse-menu-complete
110-
111-# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
112-bindkey '^?' backward-delete-char
113-bindkey "^[[3~" delete-char
114-bindkey "^[3;5~" delete-char
115-bindkey "\e[3~" delete-char
116+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
117+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
118+# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
119+
120+# Make sure that the terminal is in application mode when zle is active, since
121+# only then values from $terminfo are valid
122+if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
123+ function zle-line-init() {
124+ echoti smkx
125+ }
126+ function zle-line-finish() {
127+ echoti rmkx
128+ }
129+ zle -N zle-line-init
130+ zle -N zle-line-finish
131+fi
132+
133+bindkey -e # Use emacs key bindings
134+
135+bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
136+bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
137+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.
138+bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
139+bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
140+
141+bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
142+bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
143+
144+bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
145+bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
146+
147+bindkey ' ' magic-space # [Space] - do history expansion
148+
149+bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
150+bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
151+
152+bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards
153+
154+bindkey '^?' backward-delete-char # [Backspace] - delete backward
155+bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
156
157 # Edit the current command line in $EDITOR
158 autoload -U edit-command-line
159diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
160new file mode 100644
161index 0000000000000000000000000000000000000000..335c02a3d03867efa8674d778189d82a377896c6
162--- /dev/null
163+++ b/lib/prompt_info_functions.zsh
164@@ -0,0 +1,33 @@
165+# *_prompt_info functions for usage in your prompt
166+#
167+# Plugin creators, please add your *_prompt_info function to the list
168+# of dummy implementations to help theme creators not receiving errors
169+# without the need of implementing conditional clauses.
170+#
171+# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
172+# git_prompt_info, bzr_prompt_info and nvm_prompt_info
173+
174+# Dummy implementations that return false to prevent command_not_found
175+# errors with themes, that implement these functions
176+# Real implementations will be used when the respective plugins are loaded
177+function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
178+ rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
179+ virtualenv_prompt_info {
180+ return 1
181+}
182+
183+# oh-my-zsh supports an rvm prompt by default
184+# get the name of the rvm ruby version
185+function rvm_prompt_info() {
186+ [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
187+ local rvm_prompt
188+ rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
189+ [[ "${rvm_prompt}x" == "x" ]] && return 1
190+ echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
191+}
192+
193+# use this to enable users to see their ruby version, no matter which
194+# version management system they use
195+function ruby_prompt_info() {
196+ echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
197+}
198diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh
199deleted file mode 100644
200index a8b6c323ccae4f9bbe3f4955e258b88463b14e60..0000000000000000000000000000000000000000
201--- a/lib/rbenv.zsh
202+++ /dev/null
203@@ -1,2 +0,0 @@
204-# using the rbenv plugin will override this with a real implementation
205-function rbenv_prompt_info() {}
206diff --git a/lib/rvm.zsh b/lib/rvm.zsh
207deleted file mode 100644
208index e8744e61e373799201c3d55f4777f47be8728135..0000000000000000000000000000000000000000
209--- a/lib/rvm.zsh
210+++ /dev/null
211@@ -1,8 +0,0 @@
212-# get the name of the ruby version
213-function rvm_prompt_info() {
214- [ -f $HOME/.rvm/bin/rvm-prompt ] || return
215- local rvm_prompt
216- rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
217- [[ "${rvm_prompt}x" == "x" ]] && return
218- echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
219-}
220diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
221index 80319e1a86966b4a763c9b6a4209607a99b7a4b1..5f2fe63d422f6b0df580092fe8c51f0d67ed9fe6 100644
222--- a/lib/termsupport.zsh
223+++ b/lib/termsupport.zsh
224@@ -27,9 +27,8 @@ function omz_termsupport_preexec {
225 emulate -L zsh
226 setopt extended_glob
227 local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
228- local LINE="${2:gs/$/\\$}"
229- LINE="${LINE:gs/%/%%}"
230- title "$CMD" "%100>...>$LINE%<<"
231+ local LINE="${2:gs/%/%%}"
232+ title '$CMD' '%100>...>$LINE%<<'
233 }
234
235 autoload -U add-zsh-hook
236diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
237new file mode 100644
238index 0000000000000000000000000000000000000000..3f7fb199581c399916ceae46ff60ef3c3edd7485
239--- /dev/null
240+++ b/plugins/aws/aws.plugin.zsh
241@@ -0,0 +1,17 @@
242+export AWS_HOME=~/.aws
243+
244+function agp {
245+ echo $AWS_DEFAULT_PROFILE
246+
247+}
248+function asp {
249+ export AWS_DEFAULT_PROFILE=$1
250+ export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
251+
252+}
253+function aws_profiles {
254+ reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
255+}
256+
257+compctl -K aws_profiles asp
258+source `which aws_zsh_completer.sh`
259diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
260index 16ad3e6510a6937f528fb120740bc4efcfd592d5..e39cc5b8f455c952f3af876ee9b1e68c397903c3 100644
261--- a/plugins/battery/battery.plugin.zsh
262+++ b/plugins/battery/battery.plugin.zsh
263@@ -17,12 +17,16 @@ if [[ $(uname) == "Darwin" ]] ; then
264 integer i=$(((currentcapacity/maxcapacity) * 100))
265 echo $i
266 }
267+
268+ function plugged_in() {
269+ [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
270+ }
271
272 function battery_pct_remaining() {
273- if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
274- battery_pct
275- else
276+ if plugged_in ; then
277 echo "External Power"
278+ else
279+ battery_pct
280 fi
281 }
282
283diff --git a/plugins/brew/_brew b/plugins/brew/_brew
284index d4306f2236f143ba3711c5ad2291c0f8f2c4e8c0..9eb3bb557c261e27d853c68e5a396e5ad4bc0596 100644
285--- a/plugins/brew/_brew
286+++ b/plugins/brew/_brew
287@@ -11,10 +11,25 @@ _brew_installed_formulae() {
288 installed_formulae=(`brew list`)
289 }
290
291+_brew_installed_taps() {
292+ installed_taps=(`brew tap`)
293+}
294+
295+_brew_outdated_formulae() {
296+ outdated_formulae=(`brew outdated`)
297+}
298+
299+_brew_running_services() {
300+ running_services=(`brew services list | awk '{print $1}'`)
301+}
302+
303 local -a _1st_arguments
304 _1st_arguments=(
305+ 'audit:check formulae for Homebrew coding style'
306+ 'bundle:look for a Brewfile and run each line as a brew command'
307 'cat:display formula file for a formula'
308 'cleanup:uninstall unused and old versions of packages'
309+ 'commands:show a list of commands'
310 'create:create a new formula'
311 'deps:list dependencies and dependants of a formula'
312 'doctor:audits your installation for common issues'
313@@ -22,27 +37,38 @@ _1st_arguments=(
314 'home:visit the homepage of a formula or the brew project'
315 'info:information about a formula'
316 'install:install a formula'
317+ 'reinstall:install a formula anew; re-using its current options'
318 'link:link a formula'
319 'list:list files in a formula or not-installed formulae'
320 'log:git commit log for a formula'
321 'missing:check all installed formuale for missing dependencies.'
322- 'options:display install options specific to formula.'
323- 'outdated:list formulas for which a newer version is available'
324+ 'outdated:list formulae for which a newer version is available'
325+ 'pin:pin specified formulae'
326 'prune:remove dead links'
327- 'reinstall:reinstall a formula'
328 'remove:remove a formula'
329 'search:search for a formula (/regex/ or string)'
330 'server:start a local web app that lets you browse formulae (requires Sinatra)'
331- 'services:manage background services via launchctl'
332+ 'services:small wrapper around `launchctl` for supported formulae'
333+ 'tap:tap a new formula repository from GitHub, or list existing taps'
334 'unlink:unlink a formula'
335+ 'unpin:unpin specified formulae'
336+ 'untap:remove a tapped repository'
337 'update:freshen up links'
338 'upgrade:upgrade outdated formulae'
339- 'uses:show formulas which depend on a formula'
340- 'versions:show all available formula versions'
341+ 'uses:show formulae which depend on a formula'
342+)
343+
344+local -a _service_arguments
345+_service_arguments=(
346+ 'cleanup:get rid of stale services and unused plists'
347+ 'list:list all services managed by `brew services`'
348+ 'restart:gracefully restart selected service'
349+ 'start:start selected service'
350+ 'stop:stop selected service'
351 )
352
353 local expl
354-local -a formulae installed_formulae
355+local -a formulae installed_formulae installed_taps outdated_formulae running_services
356
357 _arguments \
358 '(-v)-v[verbose]' \
359@@ -61,24 +87,41 @@ if (( CURRENT == 1 )); then
360 fi
361
362 case "$words[1]" in
363- search|-S)
364- _arguments \
365- '(--macports)--macports[search the macports repository]' \
366- '(--fink)--fink[search the fink repository]' ;;
367+ install|reinstall|audit|home|homepage|log|info|abv|uses|cat|deps|edit|options)
368+ _brew_all_formulae
369+ _wanted formulae expl 'all formulae' compadd -a formulae ;;
370 list|ls)
371 _arguments \
372 '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
373+ '(--pinned)--pinned[list all versions of pinned formulae]' \
374 '(--versions)--versions[list all installed versions of a formula]' \
375- '1: :->forms' && return 0
376+ '1: :->forms' && return 0
377
378 if [[ "$state" == forms ]]; then
379 _brew_installed_formulae
380 _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
381 fi ;;
382- install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
383- _brew_all_formulae
384- _wanted formulae expl 'all formulae' compadd -a formulae ;;
385- reinstall|remove|rm|uninstall|unlink|cleanup|link|ln)
386+ remove|rm|uninstall|unlink|cleanup|link|ln|pin|unpin)
387diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
388new file mode 100644
389index 0000000000000000000000000000000000000000..cb92f5986bed461891798be5019ee45b3b53c3d2
390--- /dev/null
391+++ b/plugins/catimg/catimg.plugin.zsh
392@@ -0,0 +1,17 @@
393+################################################################################
394+# catimg script by Eduardo San Martin Morote aka Posva #
395+# http://posva.net #
396+# #
397+# Ouput the content of an image to the stdout using the 256 colors of the #
398+# terminal. #
399+# Github: https://github.com/posva/catimg #
400+################################################################################
401+
402+
403+function catimg() {
404+ if [[ -x `which convert` ]]; then
405+ zsh $ZSH/plugins/catimg/catimg.sh $@
406+ else
407+ echo "catimg need convert (ImageMagick) to work)"
408+ fi
409+}
410diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
411new file mode 100755
412index 0000000000000000000000000000000000000000..cd0f2e3335e537083ed6e1211c8e96d3e2a4d0e4
413--- /dev/null
414+++ b/plugins/catimg/catimg.sh
415@@ -0,0 +1,88 @@
416+################################################################################
417+# catimg script by Eduardo San Martin Morote aka Posva #
418+# http://posva.net #
419+# #
420+# Ouput the content of an image to the stdout using the 256 colors of the #
421+# terminal. #
422+# Github: https://github.com/posva/catimg #
423+################################################################################
424+
425+function help() {
426+ echo "Usage catimg [-h] [-w width] [-c char] img"
427+ echo "By default char is \" \" and w is the terminal width"
428+}
429+
430+# VARIABLES
431+COLOR_FILE=$(dirname $0)/colors.png
432+CHAR=" "
433+
434+WIDTH=""
435+IMG=""
436+
437+while getopts qw:c:h opt; do
438+ case "$opt" in
439+ w) WIDTH="$OPTARG" ;;
440+ c) CHAR="$OPTARG" ;;
441+ h) help; exit ;;
442+ *) help ; exit 1;;
443+ esac
444+ done
445+
446+while [ "$1" ]; do
447+ IMG="$1"
448+ shift
449+done
450+
451+if [ "$IMG" = "" -o ! -f "$IMG" ]; then
452+ help
453+ exit 1
454+fi
455+
456+if [ ! "$WIDTH" ]; then
457+ COLS=$(expr $(tput cols) "/" $(echo -n "$CHAR" | wc -c))
458+else
459+ COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
460+fi
461+WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
462+if [ "$WIDTH" -gt "$COLS" ]; then
463+ WIDTH=$COLS
464+fi
465+
466+REMAP=""
467+if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
468+ REMAP="-remap $COLOR_FILE"
469+else
470+ echo "The version of convert is too old, don't expect good results :(" >&2
471+ #convert "$IMG" -colors 256 PNG8:tmp.png
472+ #IMG="tmp.png"
473+fi
474+
475+# Display the image
476+I=0
477+convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
478+sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
479+while read R G B f; do
480+ if [ ! "$R" = "NO" ]; then
481+ if [ "$R" -eq "$G" -a "$G" -eq "$B" ]; then
482+ ((
483+ I++,
484+ IDX = 232 + R * 23 / 255
485+ ))
486+ else
487+ ((
488+ I++,
489+ IDX = 16
490+ + R * 5 / 255 * 36
491+ + G * 5 / 255 * 6
492+ + B * 5 / 255
493+ ))
494+ fi
495+ #echo "$R,$G,$B: $IDX"
496+ echo -ne "\e[48;5;${IDX}m${CHAR}"
497+ else
498+ (( I++ ))
499+ echo -ne "\e[0m${CHAR}"
500+ fi
501+ # New lines
502+ (( $I % $WIDTH )) || echo -e "\e[0m"
503+done
504diff --git a/plugins/catimg/colors.png b/plugins/catimg/colors.png
505new file mode 100644
506index 0000000000000000000000000000000000000000..5f2c8126bc0d8911a9de5d3ffbd4e37372b41671
507Binary files /dev/null and b/plugins/catimg/colors.png differ
508diff --git a/plugins/docker/_docker b/plugins/docker/_docker
509index f13f876cf9c97af4ed7d8598fba3325f60ac6cca..12eee7a1537e7cde16f086dbcbc4f72940a715e6 100644
510--- a/plugins/docker/_docker
511+++ b/plugins/docker/_docker
512@@ -111,7 +111,7 @@ __ps() {
513 '-beforeId="[Show only container created before Id, include non-running ones.]' \
514 '-l[Show only the latest created container, include non-running ones.]' \
515 '-n=[Show n last created containers, include non-running ones.]' \
516- '-notrurrrrnc[Dont truncate output]' \
517+ '-notrunc[Dont truncate output]' \
518 '-q[Only display numeric IDs]' \
519 '-s[Display sizes]' \
520 '-sinceId="[Show only containers created since Id, include non-running ones.]'
521diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
522new file mode 100644
523index 0000000000000000000000000000000000000000..a3f0085a826ba7817e47bc46f814fb931bd9011e
524--- /dev/null
525+++ b/plugins/emacs/emacs.plugin.zsh
526@@ -0,0 +1,56 @@
527+# Emacs 23 daemon capability is a killing feature.
528+# One emacs process handles all your frames whether
529+# you use a frame opened in a terminal via a ssh connection or X frames
530+# opened on the same host.
531+
532+# Benefits are multiple
533+# - You don't have the cost of starting Emacs all the time anymore
534+# - Opening a file is as fast as Emacs does not have anything else to do.
535+# - You can share opened buffered across opened frames.
536+# - Configuration changes made at runtime are applied to all frames.
537+
538+
539+if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
540+ export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh"
541+
542+ # set EDITOR if not already defined.
543+ export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}"
544+
545+ alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait"
546+ alias e=emacs
547+
548+ # same than M-x eval but from outside Emacs.
549+ alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
550+ # create a new X frame
551+ alias eframe='emacsclient --alternate-editor "" --create-frame'
552+
553+ # to code all night long
554+ alias emasc=emacs
555+ alias emcas=emacs
556+
557+ # Write to standard output the path to the file
558+ # opened in the current buffer.
559+ function efile {
560+ local cmd="(buffer-file-name (window-buffer))"
561+ "$EMACS_PLUGIN_LAUNCHER" --eval "$cmd" | tr -d \"
562+ }
563+
564+ # Write to standard output the directory of the file
565+ # opened in the the current buffer
566+ function ecd {
567+ local cmd="(let ((buf-name (buffer-file-name (window-buffer))))
568+ (if buf-name (file-name-directory buf-name)))"
569+
570+ local dir="$($EMACS_PLUGIN_LAUNCHER --eval $cmd | tr -d \")"
571+ if [ -n "$dir" ] ;then
572+ echo "$dir"
573+ else
574+ echo "can not deduce current buffer filename." >/dev/stderr
575+ return 1
576+ fi
577+ }
578+fi
579+
580+## Local Variables:
581+## mode: sh
582+## End:
583diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
584new file mode 100755
585index 0000000000000000000000000000000000000000..38d419813f8e21d37feb6f032ee250abdc4bf748
586--- /dev/null
587+++ b/plugins/emacs/emacsclient.sh
588@@ -0,0 +1,12 @@
589+#!/bin/sh
590+
591+# get list of available X windows.
592+x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
593+
594+if [ -z "$x" ] ;then
595+ # Create one if there is no X window yet.
596+ emacsclient --alternate-editor "" --create-frame "$@"
597+else
598+ # prevent creating another X frame if there is at least one present.
599+ emacsclient --alternate-editor "" "$@"
600+fi
601diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
602new file mode 100644
603index 0000000000000000000000000000000000000000..938f5c993fe084fe77aa36410c6147583ca9c7e4
604--- /dev/null
605+++ b/plugins/gem/gem.plugin.zsh
606@@ -0,0 +1,7 @@
607+alias gemb="gem build *.gemspec"
608+alias gemp="gem push *.gem"
609+
610+# gemy GEM 0.0.0 = gem yank GEM -v 0.0.0
611+function gemy {
612+ gem yank $1 -v $2
613+}
614diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
615index ee6fab9bd64a2201d47a66767fb4a40988f4aa87..ef894bff248e37b9175ee4002dc244dafc2cea68 100644
616--- a/plugins/git-prompt/gitstatus.py
617+++ b/plugins/git-prompt/gitstatus.py
618@@ -1,20 +1,30 @@
619 #!/usr/bin/env python
620 # -*- coding: UTF-8 -*-
621+from subprocess import Popen, PIPE
622+import re
623
624 # change those symbols to whatever you prefer
625-symbols = {'ahead of': '↑', 'behind': '↓', 'staged':'♦', 'changed':'‣', 'untracked':'…', 'clean':'⚡', 'unmerged':'≠', 'sha1':':'}
626-
627-from subprocess import Popen, PIPE
628+symbols = {
629+ 'ahead of': '↑',
630+ 'behind': '↓',
631+ 'staged': '♦',
632+ 'changed': '‣',
633+ 'untracked': '…',
634+ 'clean': '⚡',
635+ 'unmerged': '≠',
636+ 'sha1': ':'
637+}
638
639-output,error = Popen(['git','status'], stdout=PIPE, stderr=PIPE).communicate()
640+output, error = Popen(
641+ ['git', 'status'], stdout=PIPE, stderr=PIPE).communicate()
642
643 if error:
644- import sys
645- sys.exit(0)
646+ import sys
647+ sys.exit(0)
648 lines = output.splitlines()
649
650-import re
651-behead_re = re.compile(r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
652+behead_re = re.compile(
653+ r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
654 diverge_re = re.compile(r"^# and have (\d+) and (\d+) different")
655
656 status = ''
657@@ -23,46 +33,50 @@ changed = re.compile(r'^# Changed but not updated:$', re.MULTILINE)
658 untracked = re.compile(r'^# Untracked files:$', re.MULTILINE)
659 unmerged = re.compile(r'^# Unmerged paths:$', re.MULTILINE)
660
661+
662 def execute(*command):
663- out, err = Popen(stdout=PIPE, stderr=PIPE, *command).communicate()
664- if not err:
665- nb = len(out.splitlines())
666- else:
667- nb = '?'
668- return nb
669+ out, err = Popen(stdout=PIPE, stderr=PIPE, *command).communicate()
670+ if not err:
671+ nb = len(out.splitlines())
672+ else:
673+ nb = '?'
674+ return nb
675
676 if staged.search(output):
677- nb = execute(['git','diff','--staged','--name-only','--diff-filter=ACDMRT'])
678- status += '%s%s' % (symbols['staged'], nb)
679+ nb = execute(
680+ ['git', 'diff', '--staged', '--name-only', '--diff-filter=ACDMRT'])
681+ status += '%s%s' % (symbols['staged'], nb)
682 if unmerged.search(output):
683- nb = execute(['git','diff', '--staged','--name-only', '--diff-filter=U'])
684- status += '%s%s' % (symbols['unmerged'], nb)
685+ nb = execute(['git', 'diff', '--staged', '--name-only', '--diff-filter=U'])
686+ status += '%s%s' % (symbols['unmerged'], nb)
687 if changed.search(output):
688- nb = execute(['git','diff','--name-only', '--diff-filter=ACDMRT'])
689- status += '%s%s' % (symbols['changed'], nb)
690+ nb = execute(['git', 'diff', '--name-only', '--diff-filter=ACDMRT'])
691+ status += '%s%s' % (symbols['changed'], nb)
692 if untracked.search(output):
693-## nb = len(Popen(['git','ls-files','--others','--exclude-standard'],stdout=PIPE).communicate()[0].splitlines())
694-## status += "%s" % (symbols['untracked']*(nb//3 + 1), )
695- status += symbols['untracked']
696+ status += symbols['untracked']
697 if status == '':
698- status = symbols['clean']
699+ status = symbols['clean']
700
701 remote = ''
702
703 bline = lines[0]
704 if bline.find('Not currently on any branch') != -1:
705- branch = symbols['sha1']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1]
706+ branch = symbols['sha1'] + Popen([
707+ 'git',
708+ 'rev-parse',
709+ '--short',
710+ 'HEAD'], stdout=PIPE).communicate()[0][:-1]
711 else:
712- branch = bline.split(' ')[3]
713- bstatusline = lines[1]
714- match = behead_re.match(bstatusline)
715- if match:
716- remote = symbols[match.groups()[0]]
717- remote += match.groups()[2]
718diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
719index 1285a32476b763b64d98a29b79a5388bf50fa8cf..2b5983f33922a7728634e1f308dd9b2be64161d8 100644
720--- a/plugins/git/git.plugin.zsh
721+++ b/plugins/git/git.plugin.zsh
722@@ -62,8 +62,10 @@ alias glgg='git log --graph --max-count=10'
723 compdef _git glgg=git-log
724 alias glgga='git log --graph --decorate --all'
725 compdef _git glgga=git-log
726-alias glo='git log --oneline'
727+alias glo='git log --oneline --decorate --color'
728 compdef _git glo=git-log
729+alias glog='git log --oneline --decorate --color --graph'
730+compdef _git glog=git-log
731 alias gss='git status -s'
732 compdef _git gss=git-status
733 alias ga='git add'
734diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git
735index cf8116d4770c5924eaa647763d2bfae3dc14bacf..fac5e711ebbbd074366d89848165e0f9dbc36c36 100644
736--- a/plugins/gitfast/_git
737+++ b/plugins/gitfast/_git
738@@ -2,18 +2,19 @@
739
740 # zsh completion wrapper for git
741 #
742-# You need git's bash completion script installed somewhere, by default on the
743-# same directory as this script.
744+# Copyright (c) 2012-2013 Felipe Contreras <felipe.contreras@gmail.com>
745 #
746-# If your script is on ~/.git-completion.sh instead, you can configure it on
747-# your ~/.zshrc:
748+# You need git's bash completion script installed somewhere, by default it
749+# would be the location bash-completion uses.
750+#
751+# If your script is somewhere else, you can configure it on your ~/.zshrc:
752 #
753 # zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
754 #
755-# The recommended way to install this script is to copy to
756-# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file:
757+# The recommended way to install this script is to copy to '~/.zsh/_git', and
758+# then add the following to your ~/.zshrc file:
759 #
760-# fpath=(~/.zsh/completion $fpath)
761+# fpath=(~/.zsh $fpath)
762
763 complete ()
764 {
765@@ -21,8 +22,23 @@ complete ()
766 return 0
767 }
768
769+zstyle -T ':completion:*:*:git:*' tag-order && \
770+ zstyle ':completion:*:*:git:*' tag-order 'common-commands'
771+
772 zstyle -s ":completion:*:*:git:*" script script
773-test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
774+if [ -z "$script" ]; then
775+ local -a locations
776+ local e
777+ locations=(
778+ '/etc/bash_completion.d/git' # fedora, old debian
779+ '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
780+ '/usr/share/bash-completion/git' # gentoo
781+ $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
782+ )
783+ for e in $locations; do
784+ test -f $e && script="$e" && break
785+ done
786+fi
787 ZSH_VERSION='' . "$script"
788
789 __gitcomp ()
790@@ -69,18 +85,131 @@ __gitcomp_file ()
791 compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
792 }
793
794+__git_zsh_bash_func ()
795+{
796+ emulate -L ksh
797+
798+ local command=$1
799+
800+ local completion_func="_git_${command//-/_}"
801+ declare -f $completion_func >/dev/null && $completion_func && return
802+
803+ local expansion=$(__git_aliased_command "$command")
804+ if [ -n "$expansion" ]; then
805+ completion_func="_git_${expansion//-/_}"
806+ declare -f $completion_func >/dev/null && $completion_func
807+ fi
808+}
809+
810+__git_zsh_cmd_common ()
811+{
812+ local -a list
813+ list=(
814+ add:'add file contents to the index'
815+ bisect:'find by binary search the change that introduced a bug'
816+ branch:'list, create, or delete branches'
817+ checkout:'checkout a branch or paths to the working tree'
818+ clone:'clone a repository into a new directory'
819+ commit:'record changes to the repository'
820+ diff:'show changes between commits, commit and working tree, etc'
821+ fetch:'download objects and refs from another repository'
822+ grep:'print lines matching a pattern'
823+ init:'create an empty Git repository or reinitialize an existing one'
824+ log:'show commit logs'
825+ merge:'join two or more development histories together'
826+ mv:'move or rename a file, a directory, or a symlink'
827+ pull:'fetch from and merge with another repository or a local branch'
828+ push:'update remote refs along with associated objects'
829+ rebase:'forward-port local commits to the updated upstream head'
830+ reset:'reset current HEAD to the specified state'
831+ rm:'remove files from the working tree and from the index'
832+ show:'show various types of objects'
833+ status:'show the working tree status'
834+ tag:'create, list, delete or verify a tag object signed with GPG')
835+ _describe -t common-commands 'common commands' list && _ret=0
836+}
837+
838diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash
839index 93eba467502282db2697e1cf6c93a6909d35ee5c..5da920ecd9ec1b64760db863d266fdc9c47502de 100644
840--- a/plugins/gitfast/git-completion.bash
841+++ b/plugins/gitfast/git-completion.bash
842@@ -33,8 +33,6 @@ esac
843 # returns location of .git repo
844 __gitdir ()
845 {
846- # Note: this function is duplicated in git-prompt.sh
847- # When updating it, make sure you update the other one to match.
848 if [ -z "${1-}" ]; then
849 if [ -n "${__git_dir-}" ]; then
850 echo "$__git_dir"
851@@ -53,19 +51,6 @@ __gitdir ()
852 fi
853 }
854
855-__gitcomp_1 ()
856-{
857- local c IFS=$' \t\n'
858- for c in $1; do
859- c="$c$2"
860- case $c in
861- --*=*|*.) ;;
862- *) c="$c " ;;
863- esac
864- printf '%s\n' "$c"
865- done
866-}
867-
868 # The following function is based on code from:
869 #
870 # bash_completion - programmable completion functions for bash 3.2+
871@@ -195,8 +180,18 @@ _get_comp_words_by_ref ()
872 }
873 fi
874
875-# Generates completion reply with compgen, appending a space to possible
876-# completion words, if necessary.
877+__gitcompadd ()
878+{
879+ local i=0
880+ for x in $1; do
881+ if [[ "$x" == "$3"* ]]; then
882+ COMPREPLY[i++]="$2$x$4"
883+ fi
884+ done
885+}
886+
887+# Generates completion reply, appending a space to possible completion words,
888+# if necessary.
889 # It accepts 1 to 4 arguments:
890 # 1: List of possible completion words.
891 # 2: A prefix to be added to each possible completion word (optional).
892@@ -208,19 +203,25 @@ __gitcomp ()
893
894 case "$cur_" in
895 --*=)
896- COMPREPLY=()
897 ;;
898 *)
899- local IFS=$'\n'
900- COMPREPLY=($(compgen -P "${2-}" \
901- -W "$(__gitcomp_1 "${1-}" "${4-}")" \
902- -- "$cur_"))
903+ local c i=0 IFS=$' \t\n'
904+ for c in $1; do
905+ c="$c${4-}"
906+ if [[ $c == "$cur_"* ]]; then
907+ case $c in
908+ --*=*|*.) ;;
909+ *) c="$c " ;;
910+ esac
911+ COMPREPLY[i++]="${2-}$c"
912+ fi
913+ done
914 ;;
915 esac
916 }
917
918-# Generates completion reply with compgen from newline-separated possible
919-# completion words by appending a space to all of them.
920+# Generates completion reply from newline-separated possible completion words
921+# by appending a space to all of them.
922 # It accepts 1 to 4 arguments:
923 # 1: List of possible completion words, separated by a single newline.
924 # 2: A prefix to be added to each possible completion word (optional).
925@@ -231,7 +232,7 @@ __gitcomp ()
926 __gitcomp_nl ()
927 {
928 local IFS=$'\n'
929- COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
930+ __gitcompadd "$1" "${2-}" "${3-$cur}" "${4- }"
931 }
932
933 # Generates completion reply with compgen from newline-separated possible
934@@ -249,106 +250,50 @@ __gitcomp_file ()
935 # since tilde expansion is not applied.
936 # This means that COMPREPLY will be empty and Bash default
937 # completion will be used.
938- COMPREPLY=($(compgen -P "${2-}" -W "$1" -- "${3-$cur}"))
939-
940- # Tell Bash that compspec generates filenames.
941- compopt -o filenames 2>/dev/null
942diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh
943index 65f8368f1a7c010e2ac3dbad73043ebc2035cee6..a81ef5a482d48b114a81e242109e2f0dec0839ed 100644
944--- a/plugins/gitfast/git-prompt.sh
945+++ b/plugins/gitfast/git-prompt.sh
946@@ -3,7 +3,7 @@
947 # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
948 # Distributed under the GNU General Public License, version 2.0.
949 #
950-# This script allows you to see the current branch in your prompt.
951+# This script allows you to see repository status in your prompt.
952 #
953 # To enable:
954 #
955@@ -13,23 +13,27 @@
956 # 3a) Change your PS1 to call __git_ps1 as
957 # command-substitution:
958 # Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
959-# ZSH: PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
960+# ZSH: setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
961 # the optional argument will be used as format string.
962-# 3b) Alternatively, if you are using bash, __git_ps1 can be
963-# used for PROMPT_COMMAND with two parameters, <pre> and
964-# <post>, which are strings you would put in $PS1 before
965-# and after the status string generated by the git-prompt
966-# machinery. e.g.
967-# PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
968-# will show username, at-sign, host, colon, cwd, then
969-# various status string, followed by dollar and SP, as
970-# your prompt.
971+# 3b) Alternatively, for a slightly faster prompt, __git_ps1 can
972+# be used for PROMPT_COMMAND in Bash or for precmd() in Zsh
973+# with two parameters, <pre> and <post>, which are strings
974+# you would put in $PS1 before and after the status string
975+# generated by the git-prompt machinery. e.g.
976+# Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
977+# will show username, at-sign, host, colon, cwd, then
978+# various status string, followed by dollar and SP, as
979+# your prompt.
980+# ZSH: precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
981+# will show username, pipe, then various status string,
982+# followed by colon, cwd, dollar and SP, as your prompt.
983 # Optionally, you can supply a third argument with a printf
984 # format string to finetune the output of the branch status
985 #
986-# The argument to __git_ps1 will be displayed only if you are currently
987-# in a git repository. The %s token will be the name of the current
988-# branch.
989+# The repository status will be displayed only if you are currently in a
990+# git repository. The %s token is the placeholder for the shown status.
991+#
992+# The prompt status always includes the current branch name.
993 #
994 # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
995 # unstaged (*) and staged (+) changes will be shown next to the branch
996@@ -77,31 +81,8 @@
997 #
998 # If you would like a colored hint about the current dirty state, set
999 # GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
1000-# the colored output of "git status -sb".
1001-
1002-# __gitdir accepts 0 or 1 arguments (i.e., location)
1003-# returns location of .git repo
1004-__gitdir ()
1005-{
1006- # Note: this function is duplicated in git-completion.bash
1007- # When updating it, make sure you update the other one to match.
1008- if [ -z "${1-}" ]; then
1009- if [ -n "${__git_dir-}" ]; then
1010- echo "$__git_dir"
1011- elif [ -n "${GIT_DIR-}" ]; then
1012- test -d "${GIT_DIR-}" || return 1
1013- echo "$GIT_DIR"
1014- elif [ -d .git ]; then
1015- echo .git
1016- else
1017- git rev-parse --git-dir 2>/dev/null
1018- fi
1019- elif [ -d "$1/.git" ]; then
1020- echo "$1/.git"
1021- else
1022- echo "$1"
1023- fi
1024-}
1025+# the colored output of "git status -sb" and are available only when
1026+# using __git_ps1 for PROMPT_COMMAND or precmd.
1027
1028 # stores the divergence from upstream in $p
1029 # used by GIT_PS1_SHOWUPSTREAM
1030@@ -124,7 +105,7 @@ __git_ps1_show_upstream ()
1031 fi
1032 ;;
1033 svn-remote.*.url)
1034- svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
1035+ svn_remote[$((${#svn_remote[@]} + 1))]="$value"
1036 svn_url_pattern+="\\|$value"
1037 upstream=svn+git # default upstream is SVN if available, else git
1038 ;;
1039@@ -146,10 +127,11 @@ __git_ps1_show_upstream ()
1040 svn*)
1041 # get the upstream from the "git-svn-id: ..." in a commit message
1042 # (git-svn uses essentially the same procedure internally)
1043- local svn_upstream=($(git log --first-parent -1 \
1044+ local -a svn_upstream
1045+ svn_upstream=($(git log --first-parent -1 \
1046diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
1047index 66a10cfdb14ca966a6d9a948a58487d63bbed69a..25b1a1e1b42b6bbb25e7273ddf527035c9b31e74 100644
1048--- a/plugins/github/github.plugin.zsh
1049+++ b/plugins/github/github.plugin.zsh
1050@@ -84,5 +84,14 @@ exist_gh() { # [DIRECTORY]
1051 git push -u origin master
1052 }
1053
1054+# git.io "GitHub URL"
1055+#
1056+# Shorten GitHub url, example:
1057+# https://github.com/nvogel/dotzsh > http://git.io/8nU25w
1058+# source: https://github.com/nvogel/dotzsh
1059+# documentation: https://github.com/blog/985-git-io-github-url-shortener
1060+#
1061+git.io() {curl -i -s http://git.io -F "url=$1" | grep "Location" | cut -f 2 -d " "}
1062+
1063 # End Functions #############################################################
1064
1065diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
1066deleted file mode 100644
1067index 23afa96569e18d426125cd48921786e59a1faa2c..0000000000000000000000000000000000000000
1068--- a/plugins/go/go.plugin.zsh
1069+++ /dev/null
1070@@ -1,151 +0,0 @@
1071-# install in /etc/zsh/zshrc or your personal .zshrc
1072-
1073-# gc
1074-prefixes=(5 6 8)
1075-for p in $prefixes; do
1076- compctl -g "*.${p}" ${p}l
1077- compctl -g "*.go" ${p}g
1078-done
1079-
1080-# standard go tools
1081-compctl -g "*.go" gofmt
1082-
1083-# gccgo
1084-compctl -g "*.go" gccgo
1085-
1086-# go tool
1087-__go_tool_complete() {
1088- typeset -a commands build_flags
1089- commands+=(
1090- 'build[compile packages and dependencies]'
1091- 'clean[remove object files]'
1092- 'doc[run godoc on package sources]'
1093- 'fix[run go tool fix on packages]'
1094- 'fmt[run gofmt on package sources]'
1095- 'get[download and install packages and dependencies]'
1096- 'help[display help]'
1097- 'install[compile and install packages and dependencies]'
1098- 'list[list packages]'
1099- 'run[compile and run Go program]'
1100- 'test[test packages]'
1101- 'tool[run specified go tool]'
1102- 'version[print Go version]'
1103- 'vet[run go tool vet on packages]'
1104- )
1105- if (( CURRENT == 2 )); then
1106- # explain go commands
1107- _values 'go tool commands' ${commands[@]}
1108- return
1109- fi
1110- build_flags=(
1111- '-a[force reinstallation of packages that are already up-to-date]'
1112- '-n[print the commands but do not run them]'
1113- "-p[number of parallel builds]:number"
1114- '-x[print the commands]'
1115- "-work[print temporary directory name and keep it]"
1116- "-gcflags[flags for 5g/6g/8g]:flags"
1117- "-ldflags[flags for 5l/6l/8l]:flags"
1118- "-gccgoflags[flags for gccgo]:flags"
1119- )
1120- __go_list() {
1121- local expl importpaths
1122- declare -a importpaths
1123- importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
1124- _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
1125- }
1126- case ${words[2]} in
1127- clean|doc)
1128- _arguments -s -w : '*:importpaths:__go_list'
1129- ;;
1130- fix|fmt|list|vet)
1131- _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
1132- ;;
1133- install)
1134- _arguments -s -w : ${build_flags[@]} \
1135- "-v[show package names]" \
1136- '*:importpaths:__go_list'
1137- ;;
1138- get)
1139- _arguments -s -w : \
1140- ${build_flags[@]}
1141- ;;
1142- build)
1143- _arguments -s -w : \
1144- ${build_flags[@]} \
1145- "-v[show package names]" \
1146- "-o[output file]:file:_files" \
1147- "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1148- ;;
1149- test)
1150- _arguments -s -w : \
1151- ${build_flags[@]} \
1152- "-c[do not run, compile the test binary]" \
1153- "-i[do not run, install dependencies]" \
1154- "-v[print test output]" \
1155- "-x[print the commands]" \
1156- "-short[use short mode]" \
1157- "-parallel[number of parallel tests]:number" \
1158- "-cpu[values of GOMAXPROCS to use]:number list" \
1159- "-run[run tests and examples matching regexp]:regexp" \
1160- "-bench[run benchmarks matching regexp]:regexp" \
1161- "-benchtime[run each benchmark during n seconds]:duration" \
1162- "-timeout[kill test after that duration]:duration" \
1163- "-cpuprofile[write CPU profile to file]:file:_files" \
1164- "-memprofile[write heap profile to file]:file:_files" \
1165- "-memprofilerate[set heap profiling rate]:number" \
1166- "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
1167- ;;
1168- help)
1169- _values "${commands[@]}" \
1170diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
1171new file mode 120000
1172index 0000000000000000000000000000000000000000..cf943e2e1a98ae9f350f674a322b624e8ad7b1a4
1173--- /dev/null
1174+++ b/plugins/go/go.plugin.zsh
1175@@ -0,0 +1 @@
1176+../golang/golang.plugin.zsh
1177diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
1178index e60c4afe48e0b44cac537422229f8f32943a0349..18bcaaff284dc0e9dff48627826e09f461744682 100644
1179--- a/plugins/golang/golang.plugin.zsh
1180+++ b/plugins/golang/golang.plugin.zsh
1181@@ -1,9 +1,10 @@
1182-# From : http://golang.org/misc/zsh/go?m=text
1183+# install in /etc/zsh/zshrc or your personal .zshrc
1184+
1185 # gc
1186 prefixes=(5 6 8)
1187 for p in $prefixes; do
1188- compctl -g "*.${p}" ${p}l
1189- compctl -g "*.go" ${p}g
1190+ compctl -g "*.${p}" ${p}l
1191+ compctl -g "*.go" ${p}g
1192 done
1193
1194 # standard go tools
1195@@ -19,6 +20,7 @@ __go_tool_complete() {
1196 'build[compile packages and dependencies]'
1197 'clean[remove object files]'
1198 'doc[run godoc on package sources]'
1199+ 'env[print Go environment information]'
1200 'fix[run go tool fix on packages]'
1201 'fmt[run gofmt on package sources]'
1202 'get[download and install packages and dependencies]'
1203@@ -39,12 +41,17 @@ __go_tool_complete() {
1204 build_flags=(
1205 '-a[force reinstallation of packages that are already up-to-date]'
1206 '-n[print the commands but do not run them]'
1207- "-p[number of parallel builds]:number"
1208+ '-p[number of parallel builds]:number'
1209+ '-race[enable data race detection]'
1210 '-x[print the commands]'
1211- "-work[print temporary directory name and keep it]"
1212- "-gcflags[flags for 5g/6g/8g]:flags"
1213- "-ldflags[flags for 5l/6l/8l]:flags"
1214- "-gccgoflags[flags for gccgo]:flags"
1215+ '-work[print temporary directory name and keep it]'
1216+ '-ccflags[flags for 5c/6c/8c]:flags'
1217+ '-gcflags[flags for 5g/6g/8g]:flags'
1218+ '-ldflags[flags for 5l/6l/8l]:flags'
1219+ '-gccgoflags[flags for gccgo]:flags'
1220+ '-compiler[name of compiler to use]:name'
1221+ '-installsuffix[suffix to add to package directory]:suffix'
1222+ '-tags[list of build tags to consider satisfied]:tags'
1223 )
1224 __go_list() {
1225 local expl importpaths
1226@@ -62,7 +69,7 @@ __go_tool_complete() {
1227 install)
1228 _arguments -s -w : ${build_flags[@]} \
1229 "-v[show package names]" \
1230- '*:importpaths:__go_list'
1231+ '*:importpaths:__go_list'
1232 ;;
1233 get)
1234 _arguments -s -w : \
1235@@ -87,7 +94,10 @@ __go_tool_complete() {
1236 "-cpu[values of GOMAXPROCS to use]:number list" \
1237 "-run[run tests and examples matching regexp]:regexp" \
1238 "-bench[run benchmarks matching regexp]:regexp" \
1239- "-benchtime[run each benchmark during n seconds]:duration" \
1240+ "-benchmem[print memory allocation stats]" \
1241+ "-benchtime[run each benchmark until taking this long]:duration" \
1242+ "-blockprofile[write goroutine blocking profile to file]:file" \
1243+ "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \
1244 "-timeout[kill test after that duration]:duration" \
1245 "-cpuprofile[write CPU profile to file]:file:_files" \
1246 "-memprofile[write heap profile to file]:file:_files" \
1247@@ -97,7 +107,7 @@ __go_tool_complete() {
1248 help)
1249 _values "${commands[@]}" \
1250 'gopath[GOPATH environment variable]' \
1251- 'importpath[description of import paths]' \
1252+ 'packages[description of package lists]' \
1253 'remote[remote import path syntax]' \
1254 'testflag[description of testing flags]' \
1255 'testfunc[description of testing functions]'
1256@@ -147,4 +157,4 @@ __go_tool_complete() {
1257 esac
1258 }
1259
1260-compdef __go_tool_complete go
1261+compdef __go_tool_complete go
1262diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
1263index ae065c12f8066f2197af9f24b879c0101e519cb5..1b32ec2e436d2e2f69e983cfde0b3452371c5450 100644
1264--- a/plugins/lol/lol.plugin.zsh
1265+++ b/plugins/lol/lol.plugin.zsh
1266@@ -36,3 +36,15 @@ alias nomnom='killall'
1267 alias byes='exit'
1268 alias cya='reboot'
1269 alias kthxbai='halt'
1270+
1271+alias pwned='ssh'
1272+
1273+alias hackzor='git init'
1274+alias rulz='git push'
1275+alias bringz='git pull'
1276+alias chicken='git add'
1277+alias oanward='git commit -m'
1278+alias ooanward='git commit -am'
1279+alias letcat='git checkout'
1280+alias violenz='git rebase'
1281+
1282diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
1283index d2db89d045018ab33b116f33d18573213b4bde64..2e99a12fbdc3b484f93ab186387896b8337c7ceb 100644
1284--- a/plugins/mercurial/mercurial.plugin.zsh
1285+++ b/plugins/mercurial/mercurial.plugin.zsh
1286@@ -13,7 +13,7 @@ alias hglr='hg pull --rebase'
1287 alias hgo='hg outgoing'
1288 alias hgp='hg push'
1289 alias hgs='hg status'
1290-alias hgsl='log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
1291+alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
1292 # this is the 'git commit --amend' equivalent
1293 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
1294
1295diff --git a/plugins/meteor/_meteor b/plugins/meteor/_meteor
1296new file mode 100644
1297index 0000000000000000000000000000000000000000..cd7fc304f3219d324fcabe4eb7308219cffbd797
1298--- /dev/null
1299+++ b/plugins/meteor/_meteor
1300@@ -0,0 +1,48 @@
1301+#compdef meteor
1302+#autoload
1303+
1304+# Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
1305+# Original author: Dimitri JORGE (https://github.com/jorge-d)
1306+
1307+_meteor_all_packages() {
1308+ packages=(`meteor list | cut -d" " -f1`)
1309+}
1310+_meteor_installed_packages() {
1311+ installed_packages=(`meteor list --using`)
1312+}
1313+
1314+local -a _1st_arguments
1315+_1st_arguments=(
1316+ 'run:[Default] Run this project in local development mode'
1317+ 'create:Create a new project'
1318+ 'update:Upgrade this project to the latest version of Meteor'
1319+ 'add:Add a package to this project'
1320+ 'remove:Remove a package from this project'
1321+ 'list:List available packages'
1322+ 'help:Display Meteor help'
1323+ 'bundle:Pack this project up into a tarball'
1324+ 'mongo:Connect to the Mongo database for the specified site'
1325+ 'deploy:Deploy this project to Meteor'
1326+ 'logs:Show logs for specified site'
1327+ 'reset:Reset the project state. Erases the local database.'
1328+ 'test-packages:Test one or more packages'
1329+)
1330+
1331+local expl
1332+local -a packages installed_packages
1333+
1334+if (( CURRENT == 2 )); then
1335+ _describe -t commands "meteor subcommand" _1st_arguments
1336+ return
1337+fi
1338+
1339+case "$words[2]" in
1340+ help)
1341+ _describe -t commands "meteor subcommand" _1st_arguments ;;
1342+ remove)
1343+ _meteor_installed_packages
1344+ _wanted installed_packages expl 'installed packages' compadd -a installed_packages ;;
1345+ add)
1346+ _meteor_all_packages
1347+ _wanted packages expl 'all packages' compadd -a packages ;;
1348+esac
1349diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
1350index 0c914190762be679ca6e429ac5428ed210b8876c..ed79685344f8cb527c51f2d926b1397d046cf4c6 100644
1351--- a/plugins/mvn/mvn.plugin.zsh
1352+++ b/plugins/mvn/mvn.plugin.zsh
1353@@ -52,6 +52,11 @@ alias mvnc='mvn clean'
1354 alias mvncom='mvn compile'
1355 alias mvnt='mvn test'
1356 alias mvnag='mvn archetype:generate'
1357+alias mvn-updates='mvn versions:display-dependency-updates'
1358+alias mvntc7='mvn tomcat7:run'
1359+alias mvntc='mvn tomcat:run'
1360+alias mvnjetty='mvn jetty:run'
1361+
1362
1363 function listMavenCompletions {
1364 reply=(
1365diff --git a/plugins/pip/_pip b/plugins/pip/_pip
1366index 967da48cad713ffd9bb15bb34968626dd0c072bd..7c1238db7a8f65b97974512e719f9f9b778a907e 100644
1367--- a/plugins/pip/_pip
1368+++ b/plugins/pip/_pip
1369@@ -20,6 +20,7 @@ _1st_arguments=(
1370 'bundle:create pybundles (archives containing multiple packages)'
1371 'freeze:output all currently installed packages (exact versions) to stdout'
1372 'help:show available commands'
1373+ 'show:show information about installed packages'
1374 'install:install packages'
1375 'search:search PyPI'
1376 'uninstall:uninstall packages'
1377@@ -76,4 +77,7 @@ case "$words[1]" in
1378 uninstall)
1379 _pip_installed
1380 _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
1381+ show)
1382+ _pip_installed
1383+ _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
1384 esac
1385diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
1386index 23d15a9a1f028086413b660fa3e72d661e2dc932..fb46cdcf0710612900cc298118f96afebddac5da 100644
1387--- a/plugins/rails/rails.plugin.zsh
1388+++ b/plugins/rails/rails.plugin.zsh
1389@@ -1,10 +1,10 @@
1390 function _rails_command () {
1391- if [ -e "script/server" ]; then
1392- ruby script/$@
1393+ if [ -e "bin/rails" ]; then
1394+ bin/rails $@
1395 elif [ -e "script/rails" ]; then
1396 ruby script/rails $@
1397- elif [ -e "bin/rails" ]; then
1398- bin/rails $@
1399+ elif [ -e "script/server" ]; then
1400+ ruby script/$@
1401 else
1402 rails $@
1403 fi
1404@@ -51,6 +51,7 @@ alias rds='rake db:seed'
1405 alias rdd='rake db:drop'
1406 alias rdtc='rake db:test:clone'
1407 alias rdtp='rake db:test:prepare'
1408+alias rdmtc='rake db:migrate db:test:clone'
1409
1410 alias rlc='rake log:clear'
1411 alias rn='rake notes'
1412diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
1413index 78f76c3a3882328b91df2a6e895ec74374906824..57ae2ca1fad7a1e76fad8aa4c598d25bfad0869b 100644
1414--- a/plugins/rbenv/rbenv.plugin.zsh
1415+++ b/plugins/rbenv/rbenv.plugin.zsh
1416@@ -10,12 +10,18 @@ FOUND_RBENV=0
1417 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
1418 if _homebrew-installed && _rbenv-from-homebrew-installed ; then
1419 rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
1420+ if [[ $RBENV_ROOT = '' ]]; then
1421+ RBENV_ROOT="$HOME/.rbenv"
1422+ fi
1423 fi
1424
1425 for rbenvdir in "${rbenvdirs[@]}" ; do
1426 if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
1427 FOUND_RBENV=1
1428- export RBENV_ROOT=$rbenvdir
1429+ if [[ $RBENV_ROOT = '' ]]; then
1430+ RBENV_ROOT=$rbenvdir
1431+ fi
1432+ export RBENV_ROOT
1433 export PATH=${rbenvdir}/bin:$PATH
1434 eval "$(rbenv init --no-rehash - zsh)"
1435
1436diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
1437index 5662791839d77cdaa1c162ae4f45a98b3c4db554..a2042343a478cc84f91ab8b2c98c7d2204b4d5c7 100755
1438--- a/plugins/sublime/sublime.plugin.zsh
1439+++ b/plugins/sublime/sublime.plugin.zsh
1440@@ -1,25 +1,32 @@
1441 # Sublime Text 2 Aliases
1442
1443-local _sublime_darwin_paths > /dev/null 2>&1
1444-_sublime_darwin_paths=(
1445- "/usr/local/bin/subl"
1446- "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1447- "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1448- "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1449- "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1450- "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1451- "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1452-)
1453-
1454 if [[ $('uname') == 'Linux' ]]; then
1455- if [ -f '/usr/bin/sublime_text' ]; then
1456- st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
1457- else
1458- st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
1459- fi
1460- alias st=st_run
1461+ local _sublime_linux_paths > /dev/null 2>&1
1462+ _sublime_linux_paths=(
1463+ "$HOME/bin/sublime_text"
1464+ "/opt/sublime_text/sublime_text"
1465+ "/usr/bin/sublime_text"
1466+ "/usr/local/bin/sublime_text"
1467+ )
1468+ for _sublime_path in $_sublime_linux_paths; do
1469+ if [[ -a $_sublime_path ]]; then
1470+ st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
1471+ alias st=st_run
1472+ break
1473+ fi
1474+ done
1475
1476 elif [[ $('uname') == 'Darwin' ]]; then
1477+ local _sublime_darwin_paths > /dev/null 2>&1
1478+ _sublime_darwin_paths=(
1479+ "/usr/local/bin/subl"
1480+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1481+ "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1482+ "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1483+ "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
1484+ "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
1485+ "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
1486+ )
1487
1488 for _sublime_path in $_sublime_darwin_paths; do
1489 if [[ -a $_sublime_path ]]; then
1490diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
1491new file mode 100644
1492index 0000000000000000000000000000000000000000..ea19bcea07f2d71e04a2ad49e5e4811ab4953ea3
1493--- /dev/null
1494+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
1495@@ -0,0 +1,73 @@
1496+# vim:ft=zsh ts=2 sw=2 sts=2 et
1497+#
1498+# Faster alternative to the current SVN plugin implementation.
1499+#
1500+# Works with svn 1.6, 1.7, 1.8.
1501+# Use `svn_prompt_info` method to enquire the svn data.
1502+# It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
1503+# It displays the current status of the local files (added, deleted, modified, replaced, or else...)
1504+#
1505+# Use as a drop-in replacement of the svn plugin not as complementary plugin
1506+
1507+function svn_prompt_info() {
1508+ local info
1509+ info=$(svn info 2>&1) || return 1; # capture stdout and stderr
1510+ local repo_need_upgrade=$(svn_repo_need_upgrade $info)
1511+
1512+ if [[ -n $repo_need_upgrade ]]; then
1513+ printf '%s%s%s%s%s%s%s\n' \
1514+ $ZSH_PROMPT_BASE_COLOR \
1515+ $ZSH_THEME_SVN_PROMPT_PREFIX \
1516+ $ZSH_PROMPT_BASE_COLOR \
1517+ $repo_need_upgrade \
1518+ $ZSH_PROMPT_BASE_COLOR \
1519+ $ZSH_THEME_SVN_PROMPT_SUFFIX \
1520+ $ZSH_PROMPT_BASE_COLOR
1521+ else
1522+ printf '%s%s%s %s%s:%s%s%s%s%s' \
1523+ $ZSH_PROMPT_BASE_COLOR \
1524+ $ZSH_THEME_SVN_PROMPT_PREFIX \
1525+ \
1526+ "$(svn_status_info $info)" \
1527+ $ZSH_PROMPT_BASE_COLOR \
1528+ \
1529+ $ZSH_THEME_BRANCH_NAME_COLOR \
1530+ $(svn_current_branch_name $info) \
1531+ $ZSH_PROMPT_BASE_COLOR \
1532+ \
1533+ $(svn_current_revision $info) \
1534+ $ZSH_PROMPT_BASE_COLOR \
1535+ \
1536+ $ZSH_THEME_SVN_PROMPT_SUFFIX \
1537+ $ZSH_PROMPT_BASE_COLOR
1538+ fi
1539+}
1540+
1541+function svn_repo_need_upgrade() {
1542+ grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
1543+ echo "E155036: upgrade repo with svn upgrade"
1544+}
1545+
1546+function svn_current_branch_name() {
1547+ grep '^URL:' <<< "${1:-$(svn info 2> /dev/null)}" | egrep -o '(tags|branches)/[^/]+|trunk'
1548+}
1549+
1550+function svn_repo_root_name() {
1551+ grep '^Repository\ Root:' <<< "${1:-$(svn info 2> /dev/null)}" | sed 's#.*/##'
1552+}
1553+
1554+function svn_current_revision() {
1555+ echo "${1:-$(svn info 2> /dev/null)}" | sed -n 's/Revision: //p'
1556+}
1557+
1558+function svn_status_info() {
1559+ local svn_status_string="$ZSH_THEME_SVN_PROMPT_CLEAN"
1560+ local svn_status="$(svn status 2> /dev/null)";
1561+ if grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
1562+ if grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"; fi
1563+ if grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
1564+ if grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"; fi
1565+ if grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
1566+ if grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string ${ZSH_THEME_SVN_PROMPT_DIRTY:-'!'}"; fi
1567+ echo $svn_status_string
1568+}
1569diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh
1570index 9505644356e0146cbdb8dbd1e422de9bc156ab36..29df63520684f00cdb86adfea6c5785a816d6c9d 100644
1571--- a/plugins/wd/_wd.sh
1572+++ b/plugins/wd/_wd.sh
1573@@ -1,48 +1,68 @@
1574-#compdef wd.sh
1575-
1576-zstyle ":completion:*:descriptions" format "%B%d%b"
1577-
1578-CONFIG=$HOME/.warprc
1579-
1580-local -a main_commands
1581-main_commands=(
1582- add:'Adds the current working directory to your warp points'
1583- #add'\!':'Overwrites existing warp point' # TODO: Fix
1584- rm:'Removes the given warp point'
1585- ls:'Outputs all stored warp points'
1586- show:'Outputs warp points to current directory'
1587-)
1588-
1589-local -a points
1590-while read line
1591-do
1592- points+=$(awk "{ gsub(/\/Users\/$USER|\/home\/$USER/,\"~\"); print }" <<< $line)
1593-done < $CONFIG
1594-
1595-_wd()
1596-{
1597- # init variables
1598- local curcontext="$curcontext" state line
1599- typeset -A opt_args
1600-
1601- # init state
1602- _arguments \
1603- '1: :->command' \
1604- '2: :->argument'
1605-
1606- case $state in
1607- command)
1608- compadd "$@" add rm ls show
1609- _describe -t warp-points 'Warp points:' points && ret=0
1610- ;;
1611- argument)
1612- case $words[2] in
1613- rm|add!)
1614- _describe -t warp-points 'warp points' points && ret=0
1615- ;;
1616- *)
1617- esac
1618- esac
1619+#compdef wd
1620+
1621+zstyle ':completion:*:descriptions' format '%B%d%b'
1622+zstyle ':completion::complete:wd:*:commands' group-name commands
1623+zstyle ':completion::complete:wd:*:warp_points' group-name warp_points
1624+zstyle ':completion::complete:wd::' list-grouped
1625+
1626+# Call `_wd()` when when trying to complete the command `wd`
1627+
1628+zmodload zsh/mapfile
1629+function _wd() {
1630+ local ret=1
1631+ local CONFIG=$HOME/.warprc
1632+
1633+ # Stolen from
1634+ # http://stackoverflow.com/questions/9000698/completion-when-program-has-sub-commands
1635+
1636+ # local curcontext="$curcontext" state line
1637+ # typeset -A opt_args
1638+
1639+ local -a commands
1640+ local -a warp_points
1641+ warp_points=( "${(f)mapfile[$CONFIG]}" )
1642+ # LIST="${mapfile[$FNAME]}" # Not required unless stuff uses it
1643+
1644+ commands=(
1645+ 'add:Adds the current working directory to your warp points'
1646+ 'add!:Overwrites existing warp point'
1647+ 'rm:Removes the given warp point'
1648+ 'ls:Outputs all stored warp points'
1649+ 'show:Outputs all warp points that point to the current directory'
1650+ 'help:Show this extremely helpful text'
1651+ '..:Go back to last directory'
1652+ )
1653+
1654+ _arguments -C \
1655+ '1: :->first_arg' \
1656+ '2: :->second_arg' && ret=0
1657+
1658+ case $state in
1659+ first_arg)
1660+ _describe -t warp_points "Warp points" warp_points && ret=0
1661+ _describe -t commands "Commands" commands && ret=0
1662+ ;;
1663+ second_arg)
1664+ case $words[2] in
1665+ add\!|rm)
1666+ _describe -t points "Warp points" warp_points && ret=0
1667+ ;;
1668+ add)
1669+ _message 'Write the name of your warp point' && ret=0
1670+ ;;
1671+ esac
1672+ ;;
1673diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh
1674index bbec4a7154a58572d74e389251ee1d4747c1aa5a..9800335fc6584ea2ffaed1d81b766c5095a68e18 100755
1675--- a/plugins/wd/wd.plugin.zsh
1676+++ b/plugins/wd/wd.plugin.zsh
1677@@ -6,4 +6,6 @@
1678 #
1679 # @github.com/mfaerevaag/wd
1680
1681-alias wd='. $ZSH/plugins/wd/wd.sh'
1682+wd() {
1683+ . $ZSH/plugins/wd/wd.sh
1684+}
1685diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
1686index 744f58bc2039a5e1c6054a5ad0aab77fa2aa165f..96a3426fc500115d28bb6282ec673922b63e5503 100755
1687--- a/plugins/wd/wd.sh
1688+++ b/plugins/wd/wd.sh
1689@@ -50,12 +50,12 @@ wd_warp()
1690 wd_print_msg $YELLOW "Warping to current directory?"
1691 else
1692 (( n = $#1 - 1 ))
1693- wd_print_msg $BLUE "Warping..."
1694+ #wd_print_msg $BLUE "Warping..."
1695 cd -$n > /dev/null
1696 fi
1697 elif [[ ${points[$1]} != "" ]]
1698 then
1699- wd_print_msg $BLUE "Warping..."
1700+ #wd_print_msg $BLUE "Warping..."
1701 cd ${points[$1]}
1702 else
1703 wd_print_msg $RED "Unkown warp point '$1'"
1704@@ -64,16 +64,16 @@ wd_warp()
1705
1706 wd_add()
1707 {
1708- if [[ $1 =~ "^\.+$" ]]
1709+ if [[ $2 =~ "^\.+$" || $2 =~ "^\s*$" ]]
1710 then
1711- wd_print_msg $RED "Illeagal warp point (see README)."
1712- elif [[ ${points[$1]} == "" ]] || $2
1713+ wd_print_msg $RED "Illegal warp point (see README)."
1714+ elif [[ ${points[$2]} == "" ]] || $1
1715 then
1716- wd_remove $1 > /dev/null
1717- print "$1:$PWD" >> $CONFIG
1718+ wd_remove $2 > /dev/null
1719+ print "$2:$PWD" >> $CONFIG
1720 wd_print_msg $GREEN "Warp point added"
1721 else
1722- wd_print_msg $YELLOW "Warp point '$1' alredy exists. Use 'add!' to overwrite."
1723+ wd_print_msg $YELLOW "Warp point '$2' already exists. Use 'add!' to overwrite."
1724 fi
1725 }
1726
1727@@ -83,7 +83,9 @@ wd_remove()
1728 then
1729 if wd_tmp=`sed "/^$1:/d" $CONFIG`
1730 then
1731- echo $wd_tmp > $CONFIG
1732+ # `>!` forces overwrite
1733+ # we need this if people use `setopt NO_CLOBBER`
1734+ echo $wd_tmp >! $CONFIG
1735 wd_print_msg $GREEN "Warp point removed"
1736 else
1737 wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!"
1738@@ -131,9 +133,9 @@ wd_print_usage()
1739 print "\nCommands:"
1740 print "\t add \t Adds the current working directory to your warp points"
1741 print "\t add! \t Overwrites existing warp point"
1742- print "\t remove Removes the given warp point"
1743+ print "\t rm \t Removes the given warp point"
1744 print "\t show \t Outputs warp points to current directory"
1745- print "\t list \t Outputs all stored warp points"
1746+ print "\t ls \t Outputs all stored warp points"
1747 print "\t help \t Show this extremely helpful text"
1748 }
1749
1750@@ -141,7 +143,7 @@ wd_print_usage()
1751 ## run
1752
1753 # get opts
1754-args=`getopt -o a:r:lhs -l add:,remove:,list,help,show -- $*`
1755+args=`getopt -o a:r:lhs -l add:,rm:,ls,help,show -- $*`
1756
1757 # check if no arguments were given
1758 if [[ $? -ne 0 || $#* -eq 0 ]]
1759@@ -161,49 +163,40 @@ else
1760
1761 for i
1762 do
1763- case "$i"
1764- in
1765- -a|--add|add)
1766- wd_add $2 false
1767- shift
1768- shift
1769+ case "$i"
1770+ in
1771+ -a|--add|add)
1772+ wd_add false $2
1773 break
1774 ;;
1775 -a!|--add!|add!)
1776- wd_add $2 true
1777- shift
1778- shift
1779+ wd_add true $2
1780 break
1781 ;;
1782- -r|--remove|rm)
1783- wd_remove $2
1784- shift
1785- shift
1786+ -r|--remove|rm)
1787+ wd_remove $2
1788 break
1789diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh
1790index f137253f32a759a4a2050de16472397c22d213dd..4816ab0edd37a57e76f9a5bd723b67f440a40684 100644
1791--- a/plugins/xcode/xcode.plugin.zsh
1792+++ b/plugins/xcode/xcode.plugin.zsh
1793@@ -16,3 +16,4 @@ function xcsel {
1794
1795 alias xcb='xcodebuild'
1796 alias xcp='xcode-select --print-path'
1797+alias simulator='open $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
1798diff --git a/plugins/yii/yii.plugin.zsh b/plugins/yii/yii.plugin.zsh
1799new file mode 100644
1800index 0000000000000000000000000000000000000000..b816160f01d93036db2a2411bf13cd63e5b18f09
1801--- /dev/null
1802+++ b/plugins/yii/yii.plugin.zsh
1803@@ -0,0 +1,17 @@
1804+# Yii basic command completion
1805+
1806+_yii_get_command_list () {
1807+ protected/yiic | awk '/^ - [a-z]+/ { print $2 }'
1808+}
1809+
1810+_yii () {
1811+ if [ -f protected/yiic ]; then
1812+ compadd `_yii_get_command_list`
1813+ fi
1814+}
1815+
1816+compdef _yii protected/yiic
1817+compdef _yii yiic
1818+
1819+# Aliases
1820+alias yiic='protected/yiic'
1821diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
1822index b2cad20e8228ab5be3e774abada1d07b265d0747..c2254d055dc485e4581beee4291478e89729f5ee 100644
1823--- a/templates/zshrc.zsh-template
1824+++ b/templates/zshrc.zsh-template
1825@@ -11,13 +11,13 @@ ZSH_THEME="robbyrussell"
1826 # alias zshconfig="mate ~/.zshrc"
1827 # alias ohmyzsh="mate ~/.oh-my-zsh"
1828
1829-# Set to this to use case-sensitive completion
1830+# Set this to use case-sensitive completion
1831 # CASE_SENSITIVE="true"
1832
1833 # Uncomment this to disable bi-weekly auto-update checks
1834 # DISABLE_AUTO_UPDATE="true"
1835
1836-# Uncomment to change how often before auto-updates occur? (in days)
1837+# Uncomment to change how often to auto-update? (in days)
1838 # export UPDATE_ZSH_DAYS=13
1839
1840 # Uncomment following line if you want to disable colors in ls
1841@@ -37,9 +37,9 @@ ZSH_THEME="robbyrussell"
1842 # much faster.
1843 # DISABLE_UNTRACKED_FILES_DIRTY="true"
1844
1845-# Uncomment following line if you want to shown in the command execution time stamp
1846-# in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|
1847-# yyyy-mm-dd
1848+# Uncomment following line if you want to the command execution time stamp shown
1849+# in the history command output.
1850+# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
1851 # HIST_STAMPS="mm/dd/yyyy"
1852
1853 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
1854@@ -66,4 +66,3 @@ export PATH=$HOME/bin:/usr/local/bin:$PATH
1855
1856 # ssh
1857 # export SSH_KEY_PATH="~/.ssh/dsa_id"
1858-
1859diff --git a/themes/adben.zsh-theme b/themes/adben.zsh-theme
1860index b64714f32ea65addc27891e3d532b860c291671c..aa3093f64139751b78f6264755128d32e003fb96 100644
1861--- a/themes/adben.zsh-theme
1862+++ b/themes/adben.zsh-theme
1863@@ -2,12 +2,12 @@
1864 # #
1865 # # #README
1866 # #
1867-# # This theme provides two customizable header functionalities :
1868+# # This theme provides two customizable header functionalities:
1869 # # a) displaying a pseudo-random message from a database of quotations
1870 # # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29)
1871-# # b) displaying randomly command line tips from The command line fu
1872+# # b) displaying randomly command line tips from The command line fu
1873 # # (http://www.commandlinefu.com) community: in order to make use of this functionality
1874-# # you will need Internet connection.
1875+# # you will need Internet connection.
1876 # # This theme provides as well information for the current user's context, like;
1877 # # branch and status for the current version control system (git and svn currently
1878 # # supported) and time, presented to the user in a non invasive volatile way.
1879@@ -25,11 +25,8 @@
1880 # # -Solarized theme (https://github.com/altercation/solarized/)
1881 # # -OS X: iTerm 2 (http://www.iterm2.com/)
1882 # # -font Source code pro (https://github.com/adobe/source-code-pro)
1883-# #
1884-# # Author: Adolfo Benedetti
1885-# # email: adolfo.benedetti@gmail.com
1886-# # License: Public Domain
1887-# # This theme's look and feel is based on the Aaron Toponce's zsh theme , more info:
1888+# #
1889+# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info:
1890 # # http://pthree.org/2008/11/23/727/
1891 # # enjoy!
1892 ########## COLOR ###########
1893diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
1894index f241efb6aaef093d8a62a3f9f5fad0b50d1bbace..97d142a0feeb0023520c639b994715b07c846edf 100644
1895--- a/themes/af-magic.zsh-theme
1896+++ b/themes/af-magic.zsh-theme
1897@@ -1,14 +1,6 @@
1898 # af-magic.zsh-theme
1899-#
1900-# Author: Andy Fleming
1901-# URL: http://andyfleming.com/
1902 # Repo: https://github.com/andyfleming/oh-my-zsh
1903 # Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
1904-#
1905-# Created on: June 19, 2012
1906-# Last modified on: June 20, 2012
1907-
1908-
1909
1910 if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
1911 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
1912@@ -27,7 +19,12 @@ eval my_gray='$FG[237]'
1913 eval my_orange='$FG[214]'
1914
1915 # right prompt
1916-RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
1917+if type "virtualenv_prompt_info" > /dev/null
1918+then
1919+ RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%'
1920+else
1921+ RPROMPT='$my_gray%n@%m%{$reset_color%}%'
1922+fi
1923
1924 # git settings
1925 ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"
1926diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
1927index 01cdc80e50364478c59274acd4925f4084ce611b..85b846cb5bd9156b24cb57f7d0b05084af8339ea 100644
1928--- a/themes/agnoster.zsh-theme
1929+++ b/themes/agnoster.zsh-theme
1930@@ -6,7 +6,7 @@
1931 # # README
1932 #
1933 # In order for this theme to render correctly, you will need a
1934-# [Powerline-patched font](https://gist.github.com/1595572).
1935+# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
1936 #
1937 # In addition, I recommend the
1938 # [Solarized theme](https://github.com/altercation/solarized/) and, if you're
1939@@ -88,9 +88,9 @@ prompt_git() {
1940 zstyle ':vcs_info:*' stagedstr '✚'
1941 zstyle ':vcs_info:git:*' unstagedstr '●'
1942 zstyle ':vcs_info:*' formats ' %u%c'
1943- zstyle ':vcs_info:*' actionformats '%u%c'
1944+ zstyle ':vcs_info:*' actionformats ' %u%c'
1945 vcs_info
1946- echo -n "${ref/refs\/heads\//± }${vcs_info_msg_0_}"
1947+ echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }"
1948 fi
1949 }
1950
1951diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
1952index 51f5e375ad4b459d2b853a7532f51a12919b0520..a21a9c8c4cbd2831d24fb35338583e1bdb7ea6ff 100644
1953--- a/themes/avit.zsh-theme
1954+++ b/themes/avit.zsh-theme
1955@@ -1,22 +1,4 @@
1956-#
1957-# Author:: Andrew Vit (<andrew@avit.ca>)
1958-#
1959 # AVIT ZSH Theme
1960-#
1961-# Copyright 2011, Andrew Vit
1962-#
1963-# Licensed under the Apache License, Version 2.0 (the "License");
1964-# you may not use this file except in compliance with the License.
1965-# You may obtain a copy of the License at
1966-#
1967-# http://www.apache.org/licenses/LICENSE-2.0
1968-#
1969-# Unless required by applicable law or agreed to in writing, software
1970-# distributed under the License is distributed on an "AS IS" BASIS,
1971-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1972-# See the License for the specific language governing permissions and
1973-# limitations under the License.
1974-#
1975
1976 PROMPT='
1977 $(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
1978diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme
1979index 1d88f54d086923e8cd78e47937efa07698e7354d..4d9cae0cceb406967680f26435230abd7a1ffa10 100644
1980--- a/themes/bureau.zsh-theme
1981+++ b/themes/bureau.zsh-theme
1982@@ -101,12 +101,12 @@ _1RIGHT="[%*] "
1983
1984 bureau_precmd () {
1985 _1SPACES=`get_space $_1LEFT $_1RIGHT`
1986- echo
1987+ print
1988+ print -rP "$_1LEFT$_1SPACES$_1RIGHT"
1989 }
1990
1991 setopt prompt_subst
1992-PROMPT='$_1LEFT$_1SPACES$_1RIGHT
1993-> $_LIBERTY '
1994+PROMPT='> $_LIBERTY '
1995 RPROMPT='$(nvm_prompt_info) $(bureau_git_prompt)'
1996
1997 autoload -U add-zsh-hook
1998diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme
1999index 25aeb65974f4c491c4ca842c4fca5b6999828d60..718977d904d512eeafe1b9d9ec6bd0c0f34c3d43 100644
2000--- a/themes/candy-kingdom.zsh-theme
2001+++ b/themes/candy-kingdom.zsh-theme
2002@@ -1,11 +1,4 @@
2003 # neuralsanwich.zsh-theme
2004-#
2005-# Author: Sean Jones
2006-# URL: http://www.neuralsandwich.com
2007-# Repo:
2008-# Direct link:
2009-# Create:
2010-# Modified:
2011
2012 if [ "x$OH_MY_ZSH_HG" = "x" ]; then
2013 OH_MY_ZSH_HG="hg"
2014diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme
2015index f4d65ab742781e1242fb5ca5ffaaf23fe6643c86..0bd38acc2890b4f6a2a63f7cbe35591f6519cbda 100644
2016--- a/themes/dogenpunk.zsh-theme
2017+++ b/themes/dogenpunk.zsh-theme
2018@@ -1,10 +1,4 @@
2019-# -----------------------------------------------------------------------------
2020-# FILE: dogenpunk.zsh-theme
2021-# DESCRIPTION: oh-my-zsh theme file.
2022-# AUTHOR: Matthew Nelson (dogenpunk@gmail.com)
2023-# VERSION: 0.1
2024-# SCREENSHOT: coming soon
2025-# -----------------------------------------------------------------------------
2026+# dogenpunk.zsh-theme
2027
2028 MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
2029 local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
2030diff --git a/themes/duellj.zsh-theme b/themes/duellj.zsh-theme
2031index 7350b433537746452826eba36d8dd9b5a8b8ce64..3849c35beadf3bc3b7436de463d0cd3243b801ed 100644
2032--- a/themes/duellj.zsh-theme
2033+++ b/themes/duellj.zsh-theme
2034@@ -1,4 +1,3 @@
2035-
2036 # user, host, full path, and time/date
2037 # on two lines for easier vgrepping
2038 # entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888