06bd72f842480d9556a1cc28cc340f1be7e7c79b
- Author
- Atem18 <messer.kevin@gmail.com>
- Committer
- Atem18 <messer.kevin@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
2index 2677615c046e2933f6ae4bac48aa75130d09c563..0353f9db4d1c5ac973264132c316fde2dc084cf7 100644
3--- a/lib/theme-and-appearance.zsh
4+++ b/lib/theme-and-appearance.zsh
5@@ -11,6 +11,10 @@ then
6 # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
7 # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
8 gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
9+ elif [[ "$(uname -s)" == "OpenBSD" ]]; then
10+ # On OpenBSD, test if "colorls" is installed (this one supports colors);
11+ # otherwise, leave ls as is, because OpenBSD's ls doesn't support -G
12+ colorls -G -d . &>/dev/null 2>&1 && alias ls='colorls -G'
13 else
14 ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
15 fi
16diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
17index 15c1dce44c19249a12823c5493226edc61358ce0..2ae07668cba44a30e881db71d2d6f1af8f0964cb 100644
18--- a/oh-my-zsh.sh
19+++ b/oh-my-zsh.sh
20@@ -1,6 +1,5 @@
21 # Check for updates on initial load...
22-if [ "$DISABLE_AUTO_UPDATE" != "true" ]
23-then
24+if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
25 /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
26 fi
27
28@@ -69,8 +68,7 @@ done
29 unset config_file
30
31 # Load the theme
32-if [ "$ZSH_THEME" = "random" ]
33-then
34+if [ "$ZSH_THEME" = "random" ]; then
35 themes=($ZSH/themes/*zsh-theme)
36 N=${#themes[@]}
37 ((N=(RANDOM%N)+1))
38@@ -78,13 +76,10 @@ then
39 source "$RANDOM_THEME"
40 echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
41 else
42- if [ ! "$ZSH_THEME" = "" ]
43- then
44- if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]
45- then
46+ if [ ! "$ZSH_THEME" = "" ]; then
47+ if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
48 source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
49- elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]
50- then
51+ elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
52 source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
53 else
54 source "$ZSH/themes/$ZSH_THEME.zsh-theme"
55diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
56index f856f2f01fb81ae846549a3eba78cd23c95ad86d..0aa14959d3540d9d34b3570248b58d722bcdac7f 100644
57--- a/plugins/autojump/autojump.plugin.zsh
58+++ b/plugins/autojump/autojump.plugin.zsh
59@@ -5,6 +5,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
60 . /etc/profile.d/autojump.zsh
61 elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
62 . /etc/profile.d/autojump.sh
63+ elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
64+ . /usr/local/share/autojump/autojump.zsh
65 elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
66 . $HOME/.autojump/etc/profile.d/autojump.zsh
67 elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
68diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
69new file mode 100644
70index 0000000000000000000000000000000000000000..2a2c80cf67e637fada84a931134debb3e5f1df15
71--- /dev/null
72+++ b/plugins/chruby/chruby.plugin.zsh
73@@ -0,0 +1,99 @@
74+#
75+# INSTRUCTIONS
76+#
77+# With either a manual or brew installed chruby things should just work.
78+#
79+# If you'd prefer to specify an explicit path to load chruby from
80+# you can set variables like so:
81+#
82+# zstyle :omz:plugins:chruby path /local/path/to/chruby.sh
83+# zstyle :omz:plugins:chruby auto /local/path/to/auto.sh
84+#
85+# TODO
86+# - autodetermine correct source path on non OS X systems
87+# - completion if ruby-install exists
88+
89+# rvm and rbenv plugins also provide this alias
90+alias rubies='chruby'
91+
92+local _chruby_path
93+local _chruby_auto
94+
95+_homebrew-installed() {
96+ whence brew &> /dev/null
97+}
98+
99+_chruby-from-homebrew-installed() {
100+ brew --prefix chruby &> /dev/null
101+}
102+
103+_ruby-build_installed() {
104+ whence ruby-build &> /dev/null
105+}
106+
107+_ruby-install-installed() {
108+ whence ruby-install &> /dev/null
109+}
110+
111+# Simple definition completer for ruby-build
112+if _ruby-build_installed; then
113+ _ruby-build() { compadd $(ruby-build --definitions) }
114+ compdef _ruby-build ruby-build
115+fi
116+
117+_source_from_omz_settings() {
118+ zstyle -s :omz:plugins:chruby path _chruby_path
119+ zstyle -s :omz:plugins:chruby auto _chruby_auto
120+
121+ if _chruby_path && [[ -r _chruby_path ]]; then
122+ source ${_chruby_path}
123+ fi
124+
125+ if _chruby_auto && [[ -r _chruby_auto ]]; then
126+ source ${_chruby_auto}
127+ fi
128+}
129+
130+_chruby_dirs() {
131+ chrubydirs=($HOME/.rubies/ $PREFIX/opt/rubies)
132+ for dir in chrubydirs; do
133+ if [[ -d $dir ]]; then
134+ RUBIES+=$dir
135+ fi
136+ done
137+}
138+
139+if _homebrew-installed && _chruby-from-homebrew-installed ; then
140+ source $(brew --prefix chruby)/share/chruby/chruby.sh
141+ source $(brew --prefix chruby)/share/chruby/auto.sh
142+ _chruby_dirs
143+elif [[ -r "/usr/local/share/chruby/chruby.sh" ]] ; then
144+ source /usr/local/share/chruby/chruby.sh
145+ source /usr/local/share/chruby/auto.sh
146+ _chruby_dirs
147+else
148+ _source_from_omz_settings
149+ _chruby_dirs
150+fi
151+
152+function ensure_chruby() {
153+ $(whence chruby)
154+}
155+
156+function current_ruby() {
157+ local _ruby
158+ _ruby="$(chruby |grep \* |tr -d '* ')"
159+ if [[ $(chruby |grep -c \*) -eq 1 ]]; then
160+ echo ${_ruby}
161+ else
162+ echo "system"
163+ fi
164+}
165+
166+function chruby_prompt_info() {
167+ echo "$(current_ruby)"
168+}
169+
170+# complete on installed rubies
171+_chruby() { compadd $(chruby | tr -d '* ') }
172+compdef _chruby chruby
173diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
174index a95c38647f9bde735428d46db379f331fcf62113..46663303ac8e50ab7e491881a9bc03c23509a850 100644
175--- a/plugins/heroku/_heroku
176+++ b/plugins/heroku/_heroku
177@@ -23,8 +23,10 @@ _1st_arguments=(
178 "auth\:login":"log in with your heroku credentials"
179 "auth\:logout":"clear local authentication credentials"
180 "config":"display the config vars for an app"
181- "config\:add":"add one or more config vars"
182- "config\:remove":"remove a config var"
183+ "config\:pull":"pull heroku config vars down to the local environment"
184+ "config\:push":"push local config vars to heroku"
185+ "config\:set":"set one or more config vars"
186+ "config\:unset":"unset one or more config vars"
187 "db\:push":"push local data up to your app"
188 "db\:pull":"pull heroku data down into your local database"
189 "domains":"list custom domains for an app"
190diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
191index c18aa726c49cd75b327ae4173a153cd4cb22c0af..d2db89d045018ab33b116f33d18573213b4bde64 100644
192--- a/plugins/mercurial/mercurial.plugin.zsh
193+++ b/plugins/mercurial/mercurial.plugin.zsh
194@@ -13,6 +13,7 @@ alias hglr='hg pull --rebase'
195 alias hgo='hg outgoing'
196 alias hgp='hg push'
197 alias hgs='hg status'
198+alias hgsl='log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
199 # this is the 'git commit --amend' equivalent
200 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
201
202diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
203index 799f6fc8c551780fa1f4ef5429e1374fb61705ca..0c914190762be679ca6e429ac5428ed210b8876c 100644
204--- a/plugins/mvn/mvn.plugin.zsh
205+++ b/plugins/mvn/mvn.plugin.zsh
206@@ -24,16 +24,18 @@ export RESET_FORMATTING=`tput sgr0`
207 # Wrapper function for Maven's mvn command.
208 mvn-color()
209 {
210- # Filter mvn output using sed
211- mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \
212- -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \
213+ (
214+ # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
215+ unset LANG
216+ LC_CTYPE=C mvn $@ | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
217 -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
218- -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \
219- -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \
220+ -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
221+ -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
222diff --git a/plugins/pass/_pass b/plugins/pass/_pass
223index f6c1a6c4bd36ebe5fd6e347412e730578cc73000..d8ec388280bb7667d5bdce80de6f229be8c3a454 100644
224--- a/plugins/pass/_pass
225+++ b/plugins/pass/_pass
226@@ -101,7 +101,7 @@ _pass_cmd_show () {
227 _pass_complete_entries_helper () {
228 local IFS=$'\n'
229 local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
230- _values -C 'passwords' $(find "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort)
231+ _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort)
232 }
233
234 _pass_complete_entries_with_subdirs () {
235diff --git a/plugins/pip/_pip b/plugins/pip/_pip
236index fb8765c7e5d488adde84481d260e06b18279f7be..967da48cad713ffd9bb15bb34968626dd0c072bd 100644
237--- a/plugins/pip/_pip
238+++ b/plugins/pip/_pip
239@@ -6,8 +6,8 @@
240 _pip_all() {
241 # we cache the list of packages (originally from the macports plugin)
242 if (( ! $+piplist )); then
243- echo -n " (caching package index...)"
244- piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
245+ zsh-pip-cache-packages
246+ piplist=($(cat $ZSH_PIP_CACHE_FILE))
247 fi
248 }
249
250diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh
251new file mode 100644
252index 0000000000000000000000000000000000000000..b5433ae9d6e25f740757d5b4bd4eca26e7c37ef7
253--- /dev/null
254+++ b/plugins/pip/pip.plugin.zsh
255@@ -0,0 +1,78 @@
256+# Usage:
257+# Just add pip to your installed plugins.
258+
259+# If you would like to change the cheeseshops used for autocomplete set
260+# ZSH_PIP_INDEXES in your zshrc. If one of your indexes are bogus you won't get
261+# any kind of error message, pip will just not autocomplete from them. Double
262+# check!
263+#
264+# If you would like to clear your cache, go ahead and do a
265+# "zsh-pip-clear-cache".
266+
267+ZSH_PIP_CACHE_FILE=~/.pip/zsh-cache
268+ZSH_PIP_INDEXES=(https://pypi.python.org/simple/)
269+
270+zsh-pip-clear-cache() {
271+ rm $ZSH_PIP_CACHE_FILE
272+ unset piplist
273+}
274+
275+zsh-pip-clean-packages() {
276+ sed -n '/<a href/ s/.*>\([^<]\{1,\}\).*/\1/p'
277+}
278+
279+zsh-pip-cache-packages() {
280+ if [[ ! -d ${ZSH_PIP_CACHE_FILE:h} ]]; then
281+ mkdir -p ${ZSH_PIP_CACHE_FILE:h}
282+ fi
283+
284+ if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then
285+ echo -n "(...caching package index...)"
286+ tmp_cache=/tmp/zsh_tmp_cache
287+ for index in $ZSH_PIP_INDEXES ; do
288+ # well... I've already got two problems
289+ curl $index 2>/dev/null | \
290+ zsh-pip-clean-packages \
291+ >> $tmp_cache
292+ done
293+ sort $tmp_cache | uniq | tr '\n' ' ' > $ZSH_PIP_CACHE_FILE
294+ rm $tmp_cache
295+ fi
296+}
297+
298+# A test function that validates the regex against known forms of the simple
299+# index. If you modify the regex to make it work for you, you should add a test
300+# case in here and make sure that your changes don't break things for someone
301+# else.
302+zsh-pip-test-clean-packages() {
303+ local expected
304+ local actual
305+ expected="0x10c-asm
306+1009558_nester"
307+
308+ actual=$(echo -n "<html><head><title>Simple Index</title><meta name=\"api-version\" value=\"2\" /></head><body>
309+<a href='0x10c-asm'>0x10c-asm</a><br/>
310+<a href='1009558_nester'>1009558_nester</a><br/>
311+</body></html>" | zsh-pip-clean-packages)
312+
313+ if [[ $actual != $expected ]] ; then
314+ echo -e "python's simple index is broken:\n$actual\n !=\n$expected"
315+ else
316+ echo "python's simple index is fine"
317+ fi
318+
319+ actual=$(echo -n '<html>
320+ <head>
321+ <title>Simple Package Index</title>
322+ </head>
323+ <body>
324+ <a href="0x10c-asm">0x10c-asm</a><br/>
325+ <a href="1009558_nester">1009558_nester</a><br/>
326+</body></html>' | zsh-pip-clean-packages)
327+
328+ if [[ $actual != $expected ]] ; then
329+ echo -e "the djangopypi2 index is broken:\n$actual\n !=\n$expected"
330+ else
331+ echo "the djangopypi2 index is fine"
332+ fi
333+}
334diff --git a/plugins/pod/_pod b/plugins/pod/_pod
335index 563fa5e666459bee4c92bb588cbc8681be404c07..8c0f4460f7321f21202e16b9716deadf2d486b87 100644
336--- a/plugins/pod/_pod
337+++ b/plugins/pod/_pod
338@@ -3,18 +3,19 @@
339
340 # -----------------------------------------------------------------------------
341 # FILE: _pod
342-# DESCRIPTION: Cocoapods autocomplete plugin for Oh-My-Zsh
343+# DESCRIPTION: Cocoapods (0.27.1) autocomplete plugin for Oh-My-Zsh
344 # http://cocoapods.org
345 # AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch)
346 # GITHUB: https://github.com/mekanics
347 # TWITTER: @jolyAlexandre
348-# VERSION: 0.0.1
349+# VERSION: 0.0.3
350 # LICENSE: MIT
351 # -----------------------------------------------------------------------------
352
353 local -a _1st_arguments
354 _1st_arguments=(
355- 'help:Show help for the given command.'
356+ 'help:Show help for the given command'
357+ 'init:Generate a Podfile for the current directory'
358 'install:Install project dependencies'
359 'ipc:Inter-process communication'
360 'list:List pods'
361@@ -32,6 +33,7 @@ local -a _repo_arguments
362 _repo_arguments=(
363 'add:Add a spec repo'
364 'lint:Validates all specs in a repo'
365+ 'remove:Remove a spec repo.'
366 'update:Update a spec repo'
367 )
368
369@@ -158,7 +160,7 @@ __first_command_list ()
370 }
371
372 __repo_list() {
373- _wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods 2>/dev/null | sed -e 's/ /\\ /g')
374+ _wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods/repos 2>/dev/null | sed -e 's/ /\\ /g')
375 }
376
377 __pod-repo() {
378@@ -193,6 +195,12 @@ __pod-repo() {
379 (add)
380 _arguments \
381 $_inherited_options
382+
383+ (remove)
384+ _arguments \
385+ $_inherited_options \
386+ ':feature:__repo_list'
387+ ;;
388 esac
389 ;;
390 esac
391diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
392new file mode 100644
393index 0000000000000000000000000000000000000000..b3dc7aa1732966ab6ac8ef57e8b2309a317facd5
394--- /dev/null
395+++ b/plugins/pyenv/pyenv.plugin.zsh
396@@ -0,0 +1,31 @@
397+_homebrew-installed() {
398+ type brew &> /dev/null
399+}
400+
401+_pyenv-from-homebrew-installed() {
402+ brew --prefix pyenv &> /dev/null
403+}
404+
405+FOUND_PYENV=0
406+pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv")
407+if _homebrew-installed && _pyenv-from-homebrew-installed ; then
408+ pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}")
409+fi
410+
411+for pyenvdir in "${pyenvdirs[@]}" ; do
412+ if [ -d $pyenvdir/bin -a $FOUND_PYENV -eq 0 ] ; then
413+ FOUND_PYENV=1
414+ export PYENV_ROOT=$pyenvdir
415+ export PATH=${pyenvdir}/bin:$PATH
416+ eval "$(pyenv init --no-rehash - zsh)"
417+
418+ function pyenv_prompt_info() {
419+ echo "$(pyenv version-name)"
420+ }
421+ fi
422+done
423+unset pyenvdir
424+
425+if [ $FOUND_PYENV -eq 0 ] ; then
426+ function pyenv_prompt_info() { echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" }
427+fi
428diff --git a/plugins/rails3/_rails3 b/plugins/rails/_rails
429rename from plugins/rails3/_rails3
430rename to plugins/rails/_rails
431index 97915e68b90cd84cca1ff24e3b6b175224e4eab3..96f57ce6466602d4ea74b7f4588ca0054fbad767 100644
432--- a/plugins/rails3/_rails3
433+++ b/plugins/rails/_rails
434@@ -1,10 +1,6 @@
435 #compdef rails
436 #autoload
437
438-# rails 3 zsh completion, based on homebrew completion
439-# Extracted from https://github.com/robbyrussell/oh-my-zsh/blob/30620d463850c17f86e7a56fbf6a8b5e793a4e07/plugins/rails3/_rails3
440-# Published by Christopher Chow
441-
442 local -a _1st_arguments
443 _1st_arguments=(
444 'generate:Generate new code (short-cut alias: "g")'
445@@ -14,14 +10,20 @@ _1st_arguments=(
446 'new:Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app"'
447 'application:Generate the Rails application code'
448 'destroy:Undo code generated with "generate"'
449+
450 'benchmarker:See how fast a piece of code runs'
451 'profiler:Get profile information from a piece of code'
452 'plugin:Install a plugin'
453+
454+ 'plugin new:Generates skeleton for developing a Rails plugin'
455+ 'runner:Run a piece of code in the application environment (short-cut alias: "r")'
456 )
457
458 _rails_generate_arguments() {
459 generate_arguments=(
460+ assets
461 controller
462+ decorator
463 generator
464 helper
465 integration_test
466@@ -36,9 +38,11 @@ _rails_generate_arguments() {
467 scaffold_controller
468 session_migration
469 stylesheets
470+ task
471 )
472 }
473
474+
475 _arguments \
476 '(--version)--version[show version]' \
477 '(--help)--help[show help]' \
478@@ -50,7 +54,10 @@ if (( CURRENT == 1 )); then
479 fi
480
481 case "$words[1]" in
482- generate)
483+ g|generate)
484+ _rails_generate_arguments
485+ _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;;
486+ d|destroy)
487 _rails_generate_arguments
488 _wanted generate_arguments expl 'all generate' compadd -a generate_arguments ;;
489 esac
490diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
491index dd8b174b2b3a320046cdff854584304841951816..23d15a9a1f028086413b660fa3e72d661e2dc932 100644
492--- a/plugins/rails/rails.plugin.zsh
493+++ b/plugins/rails/rails.plugin.zsh
494@@ -1,20 +1,70 @@
495+function _rails_command () {
496+ if [ -e "script/server" ]; then
497+ ruby script/$@
498+ elif [ -e "script/rails" ]; then
499+ ruby script/rails $@
500+ elif [ -e "bin/rails" ]; then
501+ bin/rails $@
502+ else
503+ rails $@
504+ fi
505+}
506+
507+function _rake_command () {
508+ if [ -e "bin/rake" ]; then
509+ bin/rake $@
510+ else
511+ rake $@
512+ fi
513+}
514+
515+alias rails='_rails_command'
516+compdef _rails_command=rails
517+
518+alias rake='_rake_command'
519+compdef _rake_command=rake
520+
521+alias devlog='tail -f log/development.log'
522+alias prodlog='tail -f log/production.log'
523+alias testlog='tail -f log/test.log'
524+
525+alias -g RED='RAILS_ENV=development'
526+alias -g REP='RAILS_ENV=production'
527+alias -g RET='RAILS_ENV=test'
528+
529+# Rails aliases
530+alias rc='rails console'
531+alias rd='rails destroy'
532+alias rdb='rails dbconsole'
533+alias rg='rails generate'
534+alias rgm='rails generate migration'
535+alias rp='rails plugin'
536+alias ru='rails runner'
537+alias rs='rails server'
538+alias rsd='rails server --debugger'
539+
540+# Rake aliases
541+alias rdm='rake db:migrate'
542+alias rdr='rake db:rollback'
543+alias rdc='rake db:create'
544+alias rds='rake db:seed'
545+alias rdd='rake db:drop'
546+alias rdtc='rake db:test:clone'
547+alias rdtp='rake db:test:prepare'
548+
549+alias rlc='rake log:clear'
550+alias rn='rake notes'
551+alias rr='rake routes'
552+
553+# legacy stuff
554 alias ss='thin --stats "/thin/stats" start'
555 alias sg='ruby script/generate'
556 alias sd='ruby script/destroy'
557 alias sp='ruby script/plugin'
558 alias sr='ruby script/runner'
559 alias ssp='ruby script/spec'
560-alias rdbm='rake db:migrate'
561-alias rdbtp='rake db:test:prepare'
562-alias migrate='rake db:migrate && rake db:test:prepare'
563 alias sc='ruby script/console'
564 alias sd='ruby script/server --debugger'
565-alias devlog='tail -f log/development.log'
566-alias testlog='tail -f log/test.log'
567-alias prodlog='tail -f log/production.log'
568-alias -g RET='RAILS_ENV=test'
569-alias -g REP='RAILS_ENV=production'
570-alias -g RED='RAILS_ENV=development'
571
572 function remote_console() {
573 /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
574diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
575index b53d18d08f45a07538d45a7e7a841b643bc859f5..261b921087d220cefee029f6a1dce42899cfb67f 100644
576--- a/plugins/rails3/rails3.plugin.zsh
577+++ b/plugins/rails3/rails3.plugin.zsh
578@@ -1,32 +1,4 @@
579-# Rails 3 aliases, backwards-compatible with Rails 2.
580-
581-function _rails_command () {
582- if [ -e "script/server" ]; then
583- ruby script/$@
584- else
585- if [ -e "bin/rails" ]; then
586- bin/rails $@
587- else
588- rails $@
589- fi
590- fi
591-}
592-
593-alias rc='_rails_command console'
594-alias rd='_rails_command destroy'
595-alias rdb='_rails_command dbconsole'
596-alias rdbm='rake db:migrate db:test:clone'
597-alias rg='_rails_command generate'
598-alias rgm='_rails_command generate migration'
599-alias rp='_rails_command plugin'
600-alias ru='_rails_command runner'
601-alias rs='_rails_command server'
602-alias rsd='_rails_command server --debugger'
603-alias devlog='tail -f log/development.log'
604-alias testlog='tail -f log/test.log'
605-alias prodlog='tail -f log/production.log'
606-alias rdm='rake db:migrate'
607-alias rdr='rake db:rollback'
608-alias -g RET='RAILS_ENV=test'
609-alias -g REP='RAILS_ENV=production'
610-alias -g RED='RAILS_ENV=development'
611+echo "It looks like you have been using the 'rails3' plugin,"
612+echo "which has been deprecated in favor of a newly consolidated 'rails' plugin."
613+echo "You will want to modify your ~/.zshrc configuration to begin using it."
614+echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240"
615diff --git a/plugins/rails4/rails4.plugin.zsh b/plugins/rails4/rails4.plugin.zsh
616index cb6cf816d8a8dc48ac6a803409668827bdcaa949..5452c242cab529ee8e5816717c3cd0281199d681 100644
617--- a/plugins/rails4/rails4.plugin.zsh
618+++ b/plugins/rails4/rails4.plugin.zsh
619@@ -1,32 +1,4 @@
620-# Rails 4 aliases
621-
622-function _rails_command () {
623- if [ -e "script/server" ]; then
624- ruby script/$@
625- elif [ -e "script/rails" ]; then
626- ruby script/rails $@
627- else
628- ruby bin/rails $@
629- fi
630-}
631-
632-alias rc='_rails_command console'
633-alias rd='_rails_command destroy'
634-alias rdb='_rails_command dbconsole'
635-alias rdbm='rake db:migrate db:test:clone'
636-alias rg='_rails_command generate'
637-alias rgm='_rails_command generate migration'
638-alias rp='_rails_command plugin'
639-alias ru='_rails_command runner'
640-alias rs='_rails_command server'
641-alias rsd='_rails_command server --debugger'
642-alias devlog='tail -f log/development.log'
643-alias testlog='tail -f log/test.log'
644-alias prodlog='tail -f log/production.log'
645-alias rdm='rake db:migrate'
646-alias rdc='rake db:create'
647-alias rdr='rake db:rollback'
648-alias rds='rake db:seed'
649-alias rlc='rake log:clear'
650-alias rn='rake notes'
651-alias rr='rake routes'
652+echo "It looks like you have been using the 'rails4' plugin,"
653+echo "which has been deprecated in favor of a newly consolidated 'rails' plugin."
654+echo "You will want to modify your ~/.zshrc configuration to begin using it."
655+echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240"
656diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
657index 72f56754cf237db0ca0a29713d14ae1f4c5578c2..5662791839d77cdaa1c162ae4f45a98b3c4db554 100755
658--- a/plugins/sublime/sublime.plugin.zsh
659+++ b/plugins/sublime/sublime.plugin.zsh
660@@ -2,30 +2,32 @@
661
662 local _sublime_darwin_paths > /dev/null 2>&1
663 _sublime_darwin_paths=(
664- "/usr/local/bin/subl"
665- "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
666- "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
667- "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
668- "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
669+ "/usr/local/bin/subl"
670+ "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
671+ "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
672+ "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
673+ "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
674+ "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
675+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
676 )
677
678 if [[ $('uname') == 'Linux' ]]; then
679- if [ -f '/usr/bin/sublime_text' ]; then
680- st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
681- else
682- st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
683- fi
684- alias st=st_run
685+ if [ -f '/usr/bin/sublime_text' ]; then
686+ st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
687+ else
688+ st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
689+ fi
690+ alias st=st_run
691
692 elif [[ $('uname') == 'Darwin' ]]; then
693
694- for _sublime_path in $_sublime_darwin_paths; do
695- if [[ -a $_sublime_path ]]; then
696- alias subl="'$_sublime_path'"
697- alias st=subl
698- break
699- fi
700- done
701+ for _sublime_path in $_sublime_darwin_paths; do
702+ if [[ -a $_sublime_path ]]; then
703+ alias subl="'$_sublime_path'"
704+ alias st=subl
705+ break
706+ fi
707+ done
708 fi
709
710 alias stt='st .'
711diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh
712index 2249b1e2f1d4485f6c88349636b9e6adda065d2a..6e47ee188db466f713b1203ae4918a8ddd6d8982 100644
713--- a/plugins/terminalapp/terminalapp.plugin.zsh
714+++ b/plugins/terminalapp/terminalapp.plugin.zsh
715@@ -32,7 +32,7 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
716 # Register the function so it is called whenever the working
717 # directory changes.
718 autoload add-zsh-hook
719- add-zsh-hook chpwd update_terminal_cwd
720+ add-zsh-hook precmd update_terminal_cwd
721
722 # Tell the terminal about the initial directory.
723 update_terminal_cwd
724diff --git a/plugins/wd2/wd2/wd.plugin.zsh b/plugins/wd2/wd2/wd.plugin.zsh
725new file mode 100755
726index 0000000000000000000000000000000000000000..e0846ffd9037c95969453445002d2e52ca278eba
727--- /dev/null
728+++ b/plugins/wd2/wd2/wd.plugin.zsh
729@@ -0,0 +1,9 @@
730+#!/bin/zsh
731+
732+# WARP
733+# ====
734+# oh-my-zsh plugin
735+#
736+# @github.com/mfaerevaag/wd
737+
738+alias wd='. ~/.oh-my-zsh/plugins/wd/wd.sh'
739diff --git a/plugins/wd2/wd2/wd.sh b/plugins/wd2/wd2/wd.sh
740new file mode 100755
741index 0000000000000000000000000000000000000000..7852028c061c8a96f411ecf286afa01b82e5e6aa
742--- /dev/null
743+++ b/plugins/wd2/wd2/wd.sh
744@@ -0,0 +1,201 @@
745+#!/bin/zsh
746+
747+# WARP
748+# ====
749+# Jump to custom directories in terminal
750+# because `cd` takes too long...
751+#
752+# @github.com/mfaerevaag/wd
753+
754+
755+## variables
756+CONFIG=$HOME/.warprc
757+
758+## colors
759+BLUE="\033[96m"
760+GREEN="\033[92m"
761+YELLOW="\033[93m"
762+RED="\033[91m"
763+NOC="\033[m"
764+
765+
766+## load warp points
767+typeset -A points
768+while read line
769+do
770+ arr=(${(s,:,)line})
771+ key=${arr[1]}
772+ val=${arr[2]}
773+
774+ points[$key]=$val
775+done < $CONFIG
776+
777+
778+## functions
779+# prepended wd_ to not conflict with your environment (no sub shell)
780+
781+wd_warp()
782+{
783+ if [[ $1 =~ "^\.+$" ]]
784+ then
785+ if [[ $#1 < 2 ]]
786+ then
787+ wd_print_msg $YELLOW "Warping to current directory?"
788+ else
789+ (( n = $#1 - 1 ))
790+ wd_print_msg $BLUE "Warping..."
791+ cd -$n > /dev/null
792+ fi
793+ elif [[ ${points[$1]} != "" ]]
794+ then
795+ wd_print_msg $BLUE "Warping..."
796+ cd ${points[$1]}
797+ else
798+ wd_print_msg $RED "Unkown warp point '$1'"
799+ fi
800+}
801+
802+wd_add()
803+{
804+ if [[ $1 =~ "^\.+$" ]]
805+ then
806+ wd_print_msg $RED "Illeagal warp point (see README)."
807+ elif [[ ${points[$1]} == "" ]] || $2
808+ then
809+ wd_remove $1 > /dev/null
810+ print "$1:$PWD" >> $CONFIG
811+ wd_print_msg $GREEN "Warp point added"
812+ else
813+ wd_print_msg $YELLOW "Warp point '$1' alredy exists. Use 'add!' to overwrite."
814+ fi
815+}
816+
817+wd_remove()
818+{
819+ if [[ ${points[$1]} != "" ]]
820+ then
821+ if wd_tmp=`sed "/^$1:/d" $CONFIG`
822+ then
823+ echo $wd_tmp > $CONFIG
824+ wd_print_msg $GREEN "Warp point removed"
825+ else
826+ wd_print_msg $RED "Warp point unsuccessfully removed. Sorry!"
827+ fi
828+ else
829+ wd_print_msg $RED "Warp point was not found"
830+ fi
831+}
832+
833+wd_show()
834+{
835+ wd_print_msg $BLUE "Warp points to current directory:"
836+ wd_list_all | grep $PWD$
837+}
838+
839+wd_list_all()
840+{
841+ wd_print_msg $BLUE "All warp points:"
842+ while read line
843+ do
844diff --git a/plugins/zeus/README.md b/plugins/zeus/README.md
845index d7c2aef80e8e124486adf1cd31478c530ab2d72d..8964eaaec664ceee6d6e7897b3856d53c7b12648 100644
846--- a/plugins/zeus/README.md
847+++ b/plugins/zeus/README.md
848@@ -41,3 +41,13 @@
849
850 * `zsw` aliases `rm .zeus.sock`
851 * `zweep` aliases `rm .zeus.sock`
852+
853+`zdbr` aliases `zeus rake db:reset db:test:prepare`
854+`zdbreset` aliases `zeus rake db:reset db:test:prepare`
855+
856+`zdbm` aliases `zeus rake db:migrate db:test:prepare`
857+`zdbmigrate` aliases `zeus rake db:migrate db:test:prepare`
858+
859+`zdbc` aliases `zeus rake db:create`
860+
861+`zdbcm` aliases `zeus rake db:create db:migrate db:test:prepare`
862diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh
863index eddfb4f94a15163d2762490f0fb6845894dfe5d1..5ec9fa57941f5c721e2d3db6fe6c71c33ee2b23f 100644
864--- a/plugins/zeus/zeus.plugin.zsh
865+++ b/plugins/zeus/zeus.plugin.zsh
866@@ -53,3 +53,17 @@ alias zall='zeus test test/unit/*; zeus test test/functional/; zeus cucumber'
867 # Clean up crashed zeus instances.
868 alias zsw='rm .zeus.sock'
869 alias zweep='rm .zeus.sock'
870+
871+# Reset database
872+alias zdbr='zeus rake db:reset db:test:prepare'
873+alias zdbreset='zeus rake db:reset db:test:prepare'
874+
875+# Migrate and prepare database
876+alias zdbm='zeus rake db:migrate db:test:prepare'
877+alias zdbmigrate='zeus rake db:migrate db:test:prepare'
878+
879+# Create database
880+alias zdbc='zeus rake db:create'
881+
882+# Create, migrate and prepare database
883+alias zdbcm='zeus rake db:create db:migrate db:test:prepare'
884diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
885index 762f63c5b6b20898814aa5461723209cecfc75c6..01cdc80e50364478c59274acd4925f4084ce611b 100644
886--- a/themes/agnoster.zsh-theme
887+++ b/themes/agnoster.zsh-theme
888@@ -95,38 +95,38 @@ prompt_git() {
889 }
890
891 prompt_hg() {
892- local rev status
893- if $(hg id >/dev/null 2>&1); then
894- if $(hg prompt >/dev/null 2>&1); then
895- if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
896- # if files are not added
897- prompt_segment red white
898- st='±'
899- elif [[ -n $(hg prompt "{status|modified}") ]]; then
900- # if any modification
901- prompt_segment yellow black
902- st='±'
903- else
904- # if working copy is clean
905- prompt_segment green black
906- fi
907- echo -n $(hg prompt "☿ {rev}@{branch}") $st
908- else
909- st=""
910- rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
911- branch=$(hg id -b 2>/dev/null)
912- if `hg st | grep -Eq "^\?"`; then
913- prompt_segment red black
914- st='±'
915- elif `hg st | grep -Eq "^(M|A)"`; then
916- prompt_segment yellow black
917- st='±'
918- else
919- prompt_segment green black
920- fi
921- echo -n "☿ $rev@$branch" $st
922- fi
923- fi
924+ local rev status
925+ if $(hg id >/dev/null 2>&1); then
926+ if $(hg prompt >/dev/null 2>&1); then
927+ if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
928+ # if files are not added
929+ prompt_segment red white
930+ st='±'
931+ elif [[ -n $(hg prompt "{status|modified}") ]]; then
932+ # if any modification
933+ prompt_segment yellow black
934+ st='±'
935+ else
936+ # if working copy is clean
937+ prompt_segment green black
938+ fi
939+ echo -n $(hg prompt "☿ {rev}@{branch}") $st
940+ else
941+ st=""
942+ rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')
943+ branch=$(hg id -b 2>/dev/null)
944+ if `hg st | grep -Eq "^\?"`; then
945+ prompt_segment red black
946+ st='±'
947+ elif `hg st | grep -Eq "^(M|A)"`; then
948+ prompt_segment yellow black
949+ st='±'
950+ else
951+ prompt_segment green black
952+ fi
953+ echo -n "☿ $rev@$branch" $st
954+ fi
955+ fi
956 }
957
958 # Dir: current working directory
959diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme
960new file mode 100644
961index 0000000000000000000000000000000000000000..548f6d39d089ccbee283d10f8879160ff5e484b9
962--- /dev/null
963+++ b/themes/amuse.zsh-theme
964@@ -0,0 +1,21 @@
965+# vim:ft=zsh ts=2 sw=2 sts=2
966+
967+rvm_current() {
968+ rvm current 2>/dev/null
969+}
970+
971+rbenv_version() {
972+ rbenv version 2>/dev/null | awk '{print $1}'
973+}
974+
975+PROMPT='
976+%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
977+$ '
978+
979+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}⭠ "
980+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
981+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
982+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
983+ZSH_THEME_GIT_PROMPT_CLEAN=""
984+
985+RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}'