Diff
1diff --git a/lib/git.zsh b/lib/git.zsh
2index b0e73bf3ab5dabbfb0654b06c4c8f2c4bfbc2a16..7aa5a0ea2fe8f928681efdb3857af10587c3abc3 100644
3--- a/lib/git.zsh
4+++ b/lib/git.zsh
5@@ -54,11 +54,19 @@ git_remote_status() {
6
7 # Checks if there are commits ahead from remote
8 function git_prompt_ahead() {
9- if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
10+ if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
11 echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
12 fi
13 }
14
15+# Gets the number of commits ahead from remote
16+function git_commits_ahead() {
17+ if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
18+ COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
19+ echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
20+ fi
21+}
22+
23 # Formats prompt string for current git commit short SHA
24 function git_prompt_short_sha() {
25 SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
26diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
27index c2e95884e96fd6bb5faba415ebdbe6e9b11153f0..42fb80c9a4910cb403bb06d26010c85387aa7aee 100644
28--- a/plugins/brew/brew.plugin.zsh
29+++ b/plugins/brew/brew.plugin.zsh
30@@ -1 +1,2 @@
31 alias brews='brew list -1'
32+alias bubu="brew update && brew upgrade && brew cleanup"
33diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
34new file mode 100644
35index 0000000000000000000000000000000000000000..56f0c71767c66d0ba5c3f0306a6450d8f438c278
36--- /dev/null
37+++ b/plugins/bundler/README.md
38@@ -0,0 +1,49 @@
39+# Bundler
40+
41+- adds completion for basic bundler commands
42+- adds short aliases for common bundler commands
43+ - `be` aliased to `bundle exec`
44+ - `bl` aliased to `bundle list`
45+ - `bp` aliased to `bundle package`
46+ - `bo` aliased to `bundle open`
47+ - `bu` aliased to `bundle update`
48+ - `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
49+- adds a wrapper for common gems:
50+ - looks for a binstub under `./bin/` and executes it (if present)
51+ - calls `bundle exec <gem executable>` otherwise
52+
53+For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
54+
55+## Configuration
56+
57+Please use the exact name of the executable and not the gem name.
58+
59+### Add additional gems to be wrapped
60+
61+Add this before the plugin-list in your `.zshrc`:
62+```sh
63+BUNDLED_COMMANDS=(rubocop)
64+plugins=(... bundler ...)
65+```
66+This will add the wrapper for the `rubocop` gem (i.e. the executable).
67+
68+
69+### Exclude gems from being wrapped
70+
71+Add this before the plugin-list in your `.zshrc`:
72+```sh
73+UNBUNDLED_COMMANDS=(foreman spin)
74+plugins=(... bundler ...)
75+```
76+This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped.
77+
78+## Excluded gems
79+
80+These gems should not be called with `bundle exec`. Please see the Issues on GitHub for clarification.
81+
82+`berks`
83+`foreman`
84+`mailcatcher`
85+`rails`
86+`ruby`
87+`spin`
88diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
89index 2ec3a5f9c7c97ea821c3ec6ac4e57108b8cc923d..ba647ab80a2abaf31724a9fdb8db0b0a8e769f63 100644
90--- a/plugins/bundler/_bundler
91+++ b/plugins/bundler/_bundler
92@@ -18,11 +18,13 @@ case $state in
93 "check[Determine whether the requirements for your application are installed]" \
94 "list[Show all of the gems in the current bundle]" \
95 "show[Show the source location of a particular gem in the bundle]" \
96+ "outdated[Show all of the outdated gems in the current bundle]" \
97 "console[Start an IRB session in the context of the current bundle]" \
98 "open[Open an installed gem in the editor]" \
99 "viz[Generate a visual representation of your dependencies]" \
100 "init[Generate a simple Gemfile, placed in the current directory]" \
101 "gem[Create a simple gem, suitable for development with bundler]" \
102+ "platform[Displays platform compatibility information]" \
103 "clean[Cleans up unused gems in your bundler directory]" \
104 "help[Describe available tasks or one specific task]"
105 ret=0
106@@ -39,11 +41,13 @@ case $state in
107 'check' \
108 'list' \
109 'show' \
110+ 'outdated' \
111 'console' \
112 'open' \
113 'viz' \
114 'init' \
115 'gem' \
116+ 'platform' \
117 'help' && ret=0
118 ;;
119 install)
120@@ -71,6 +75,15 @@ case $state in
121 '(--verbose)--verbose[Enable verbose output mode]'
122 ret=0
123 ;;
124+ outdated)
125+ _arguments \
126+ '(--pre)--pre[Check for newer pre-release gems]' \
127+ '(--source)--source[Check against a specific source]' \
128+ '(--local)--local[Do not attempt to fetch gems remotely and use the gem cache instead]' \
129+ '(--no-color)--no-color[Disable colorization in output]' \
130+ '(--verbose)--verbose[Enable verbose output mode]'
131+ ret=0
132+ ;;
133 (open|show)
134 _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
135 if [[ $_gems != "" ]]; then
136diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
137index 20931dcefb2c942096455f44225fb276581bf06b..617dcde7111f5a811f391e15c685a8c712b16dd4 100644
138--- a/plugins/bundler/bundler.plugin.zsh
139+++ b/plugins/bundler/bundler.plugin.zsh
140@@ -5,15 +5,49 @@ alias bo="bundle open"
141 alias bu="bundle update"
142 alias bi="bundle_install"
143
144-# The following is based on https://github.com/gma/bundler-exec
145-
146-bundled_commands=(annotate berks cap capify cucumber foodcritic foreman guard irb jekyll kitchen knife middleman nanoc puma rackup rainbows rake rspec ruby shotgun spec spin spork spring strainer tailor taps thin thor unicorn unicorn_rails)
147+bundled_commands=(
148+ annotate
149+ cap
150+ capify
151+ cucumber
152+ foodcritic
153+ guard
154+ irb
155+ jekyll
156+ kitchen
157+ knife
158+ middleman
159+ nanoc
160+ pry
161+ puma
162+ rackup
163+ rainbows
164+ rake
165+ rspec
166+ shotgun
167+ sidekiq
168+ spec
169+ spork
170+ spring
171+ strainer
172+ tailor
173+ taps
174+ thin
175+ thor
176+ unicorn
177+ unicorn_rails
178+)
179
180 # Remove $UNBUNDLED_COMMANDS from the bundled_commands list
181 for cmd in $UNBUNDLED_COMMANDS; do
182 bundled_commands=(${bundled_commands#$cmd});
183 done
184
185+# Add $BUNDLED_COMMANDS to the bundled_commands list
186+for cmd in $BUNDLED_COMMANDS; do
187+ bundled_commands+=($cmd);
188+done
189+
190 ## Functions
191
192 bundle_install() {
193@@ -48,9 +82,17 @@ _within-bundled-project() {
194 false
195 }
196
197+_binstubbed() {
198+ [ -f "./bin/${1}" ]
199+}
200+
201 _run-with-bundler() {
202 if _bundler-installed && _within-bundled-project; then
203- bundle exec $@
204+ if _binstubbed $1; then
205+ ./bin/$@
206+ else
207+ bundle exec $@
208+ fi
209 else
210 $@
211 fi
212@@ -63,7 +105,6 @@ for cmd in $bundled_commands; do
213 alias $cmd=bundled_$cmd
214
215 if which _$cmd > /dev/null 2>&1; then
216- compdef _$cmd bundled_$cmd=$cmd
217+ compdef _$cmd bundled_$cmd=$cmd
218 fi
219 done
220-
221diff --git a/plugins/docker/_docker b/plugins/docker/_docker
222index c291037a344c1031430ece94f0e87af490b6d0e8..28568a6e5d0841bd8090a75f1e28b0221332134b 100644
223--- a/plugins/docker/_docker
224+++ b/plugins/docker/_docker
225@@ -214,7 +214,7 @@ __save() {
226 __start() {
227 _arguments \
228 '(-a,--attach=)'{-a,--attach=}'[Attach container''s stdout/stderr and forward all signals to the process]' \
229- '(-i,--interactive=)'{-i, --interactive=}'[Attach container''s stdin]'
230+ '(-i,--interactive=)'{-i,--interactive=}'[Attach container''s stdin]'
231 __docker_containers
232 }
233
234diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
235index 739ee7142f69b7e794f8e2a3633cb8e96000735a..3d510e4308bfa08fe430c2e6e1d9d976df1f570a 100644
236--- a/plugins/jira/jira.plugin.zsh
237+++ b/plugins/jira/jira.plugin.zsh
238@@ -29,15 +29,23 @@ open_jira_issue () {
239 return 0
240 fi
241
242+ if [ -f .jira-prefix ]; then
243+ jira_prefix=$(cat .jira-prefix)
244+ elif [ -f ~/.jira-prefix ]; then
245+ jira_prefix=$(cat ~/.jira-prefix)
246+ else
247+ jira_prefix=""
248+ fi
249+
250 if [ -z "$1" ]; then
251 echo "Opening new issue"
252 $open_cmd "$jira_url/secure/CreateIssue!default.jspa"
253 else
254 echo "Opening issue #$1"
255 if [[ "x$JIRA_RAPID_BOARD" = "xtrue" ]]; then
256- $open_cmd "$jira_url/issues/$1"
257+ $open_cmd "$jira_url/issues/$jira_prefix$1"
258 else
259- $open_cmd "$jira_url/browse/$1"
260+ $open_cmd "$jira_url/browse/$jira_prefix$1"
261 fi
262 fi
263 }
264diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
265index 2b7683078d19920cc656fac7057403c45496cd7c..a70625fcf9c27d32a1b88280f488e748ba3143fc 100644
266--- a/plugins/mvn/mvn.plugin.zsh
267+++ b/plugins/mvn/mvn.plugin.zsh
268@@ -129,6 +129,8 @@ function listMavenCompletions {
269 tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
270 # tomcat7
271 tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
272+ # spring-boot
273+ spring-boot:run spring-boot:repackage
274 # exec
275 exec:exec exec:java
276 # versions
277diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
278index 63760b5ffd04dde6e62d4535ee82cb7fdac5d011..a63f0ee053ccbcbf0182660a04991754e1979268 100644
279--- a/plugins/osx/osx.plugin.zsh
280+++ b/plugins/osx/osx.plugin.zsh
281@@ -174,12 +174,16 @@ function itunes() {
282 next|previous)
283 opt="$opt track"
284 ;;
285+ vol)
286+ opt="set sound volume to $1" #$1 Due to the shift
287+ ;;
288 ""|-h|--help)
289 echo "Usage: itunes <option>"
290 echo "option:"
291 echo "\tlaunch|play|pause|stop|rewind|resume|quit"
292 echo "\tmute|unmute\tcontrol volume set"
293 echo "\tnext|previous\tplay next or previous track"
294+ echo "\tvol\tSet the volume, takes an argument from 0 to 100"
295 echo "\thelp\tshow this message and exit"
296 return 0
297 ;;
298@@ -190,4 +194,3 @@ function itunes() {
299 esac
300 osascript -e "tell application \"iTunes\" to $opt"
301 }
302-
303diff --git a/plugins/postgres/postgres.plugin.zsh b/plugins/postgres/postgres.plugin.zsh
304index cdd142e92c61c8db172e72a165923b5d96b11d12..c2dbef244fe7f3a11209f19486047ebe2fd6fd54 100644
305--- a/plugins/postgres/postgres.plugin.zsh
306+++ b/plugins/postgres/postgres.plugin.zsh
307@@ -1,6 +1,8 @@
308-# Aliases to stop, start and restart Postgres
309-# Paths noted below are for Postgress installed via Homebrew on OSX
310+# Aliases to control Postgres
311+# Paths noted below are for Postgres installed via Homebrew on OSX
312
313 alias startpost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
314 alias stoppost='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
315-alias restartpost='stoppost && sleep 1 && startpost'
316+alias restartpost='stoppost && sleep 1 && startpost'
317+alias reloadpost='pg_ctl reload -D /usr/local/var/postgres -s'
318+alias statuspost='pg_ctl status -D /usr/local/var/postgres -s'
319diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
320index 3bde154df38051fa1d2b0d479d13190319a48a0e..ad23e18d7fc3d024235d9e37f2ccbde28ae08ac0 100644
321--- a/plugins/rvm/rvm.plugin.zsh
322+++ b/plugins/rvm/rvm.plugin.zsh
323@@ -6,6 +6,7 @@ alias gemsets='rvm gemset list'
324 local ruby18='ruby-1.8.7'
325 local ruby19='ruby-1.9.3'
326 local ruby20='ruby-2.0.0'
327+local ruby21='ruby-2.1.1'
328
329 function rb18 {
330 if [ -z "$1" ]; then
331@@ -40,6 +41,17 @@ function rb20 {
332 _rb20() {compadd `ls -1 $rvm_path/gems | grep "^$ruby20@" | sed -e "s/^$ruby20@//" | awk '{print $1}'`}
333 compdef _rb20 rb20
334
335+function rb21 {
336+ if [ -z "$1" ]; then
337+ rvm use "$ruby21"
338+ else
339+ rvm use "$ruby21@$1"
340+ fi
341+}
342+
343+_rb21() {compadd `ls -1 $rvm_path/gems | grep "^$ruby21@" | sed -e "s/^$ruby21@//" | awk '{print $1}'`}
344+compdef _rb21 rb21
345+
346 function rvm-update {
347 rvm get head
348 }
349diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
350index 4c07349a4d909f1edbb916b883b733e2be560adf..1d5177e6d53276c49381ec6275a79d1d3e80588f 100644
351--- a/plugins/symfony2/symfony2.plugin.zsh
352+++ b/plugins/symfony2/symfony2.plugin.zsh
353@@ -1,22 +1,23 @@
354 # Symfony2 basic command completion
355
356 _symfony2_get_command_list () {
357- php app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
358+ php $(find . -maxdepth 2 -mindepth 1 -name 'console') --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
359 }
360
361 _symfony2 () {
362- if [ -f app/console ]; then
363+ if [ -f $(find . -maxdepth 2 -mindepth 1 -name 'console') ]; then
364 compadd `_symfony2_get_command_list`
365 fi
366 }
367
368-compdef _symfony2 app/console
369+compdef _symfony2 $(find . -maxdepth 2 -mindepth 1 -name 'console')
370 compdef _symfony2 sf
371
372 #Alias
373-alias sf='php app/console'
374-alias sfcl='php app/console cache:clear'
375-alias sfroute='php app/console router:debug'
376-alias sfcontainer='php app/console container:debug'
377-alias sfgb='php app/console generate:bundle'
378+alias sf='php $(find . -maxdepth 2 -mindepth 1 -name 'console') '
379+alias sfcl='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:clear'
380+alias sfcw='php $(find . -maxdepth 2 -mindepth 1 -name 'console') cache:warmup'
381+alias sfroute='php $(find . -maxdepth 2 -mindepth 1 -name 'console') router:debug'
382+alias sfcontainer='php $(find . -maxdepth 2 -mindepth 1 -name 'console') container:debug'
383+alias sfgb='php $(find . -maxdepth 2 -mindepth 1 -name 'console') generate:bundle'
384
385diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
386index 96a3426fc500115d28bb6282ec673922b63e5503..9ebad68082e0eb1c1eb595cb582b7edfdc1cd950 100755
387--- a/plugins/wd/wd.sh
388+++ b/plugins/wd/wd.sh
389@@ -58,7 +58,7 @@ wd_warp()
390 #wd_print_msg $BLUE "Warping..."
391 cd ${points[$1]}
392 else
393- wd_print_msg $RED "Unkown warp point '$1'"
394+ wd_print_msg $RED "Unknown warp point '$1'"
395 fi
396 }
397
398diff --git a/themes/terminalparty.zsh-theme b/themes/terminalparty.zsh-theme
399index 216ce37eb4e682d7e0e999f779b84875a629a379..cd7370bbac47381b53591756cf4e650f2c0ef4d3 100644
400--- a/themes/terminalparty.zsh-theme
401+++ b/themes/terminalparty.zsh-theme
402@@ -1,4 +1,4 @@
403-PROMPT='%{$fg[green]%} %% '
404+PROMPT='%(?,%{$fg[green]%},%{$fg[red]%}) %% '
405 # RPS1='%{$fg[blue]%}%~%{$reset_color%} '
406 RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}'
407
408@@ -6,4 +6,3 @@ ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}("
409 ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
410 ZSH_THEME_GIT_PROMPT_CLEAN=""
411 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}"
412-