18ef1ee6481dbeca4fbecf3de627f946860ffd5a
- Author
- Dawid Ferenczy <dawid@ferenczy.cz>
- Committer
- Dawid Ferenczy <dawid@ferenczy.cz>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt
2index 6eb8aab34f66de325a336c327b9abb1b476e6ad3..dfbd90035cc448b0c75d935ef98d2144cf49fc84 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-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
9+Copyright (c) 2009-2015 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.markdown b/README.markdown
14new file mode 100644
15index 0000000000000000000000000000000000000000..d4d3fdbaf273203bf635f392b8df83a5e128d16f
16--- /dev/null
17+++ b/README.markdown
18@@ -0,0 +1,201 @@
19+
20+
21+
22+Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. That sounds boring. Let's try this again.
23+
24diff --git a/README.textile b/README.textile
25deleted file mode 100644
26index 4325c91eb94d1fbd2ab5bb5ac5d8fcc29f21f963..0000000000000000000000000000000000000000
27--- a/README.textile
28+++ /dev/null
29@@ -1,110 +0,0 @@
30-!https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png!
31-
32-oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout...
33-
34-bq. "OH MY ZSHELL!"
35-
36-h2. Setup
37-
38-@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
39-
40-h3. The automatic installer... (do you trust me?)
41-
42-You can install this via the command line with either `curl` or `wget`.
43-
44-h4. via `curl`
45-
46-@curl -L http://install.ohmyz.sh | sh@
47-
48-h4. via `wget`
49-
50-@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
51-
52-h4. Optional: change the install directory
53-
54-The default location is `~/.oh-my-zsh` (hidden in your home directory).
55-
56-You can change the install directory with the ZSH environment variable, either
57-by running `export ZSH=/your/path` before installing, or setting it before the
58-end of the install pipeline like this:
59-
60-@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
61-
62-
63-h3. The manual way
64-
65-1. Clone the repository
66-
67- @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
68-
69-2. *OPTIONAL* Backup your existing ~/.zshrc file
70-
71- @cp ~/.zshrc ~/.zshrc.orig@
72-
73-3. Create a new zsh config by copying the zsh template we've provided.
74-
75- @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
76-
77-4. Set zsh as your default shell:
78-
79- @chsh -s /bin/zsh@
80-
81-5. Start / restart zsh (open a new terminal is easy enough...)
82-
83-h3. Problems?
84-
85-You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
86-
87-If you installed manually or changed the install location, check ZSH in ~/.zshrc
88-
89-h2. Usage
90-
91-* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's possible)
92-** example: @plugins=(git osx ruby)@
93-* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
94-** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
95-* much much more... take a look at @lib/@ what _Oh My Zsh_ offers...
96-
97-h2. Useful
98-
99-the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips.
100-
101-h3. Customization
102-
103-If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
104-If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
105-If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
106-
107-h3. Updates
108-
109-By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your ~/.zshrc
110-
111-@DISABLE_UPDATE_PROMPT=true@
112-
113-To disable updates entirely, put this in your ~/.zshrc
114-
115-@DISABLE_AUTO_UPDATE=true@
116-
117-To upgrade directly from the command line, just run @upgrade_oh_my_zsh@
118-
119-h3. Uninstalling
120-
121-If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
122-
123-h2. Help out!
124-
125-I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
126-
127-h3. (Don't) Send us your theme! (for now)
128-
129diff --git a/cache/.easter-egg b/cache/.easter-egg
130new file mode 100644
131index 0000000000000000000000000000000000000000..4b6164edb73afb30641afba795954a22564a299a
132--- /dev/null
133+++ b/cache/.easter-egg
134@@ -0,0 +1,4 @@
135+This file is only here so that Git will keep a cache directory as .gitignore is ignoring all the files within it.
136+
137+Feel free to add love notes for people here.
138+
139diff --git a/lib/aliases.zsh b/lib/aliases.zsh
140deleted file mode 100644
141index 3044c966099cd8b1ac397859d5ad98af08309e3b..0000000000000000000000000000000000000000
142--- a/lib/aliases.zsh
143+++ /dev/null
144@@ -1,36 +0,0 @@
145-# Push and pop directories on directory stack
146-alias pu='pushd'
147-alias po='popd'
148-
149-# Basic directory operations
150-alias ...='cd ../..'
151-alias -- -='cd -'
152-
153-# Super user
154-alias _='sudo'
155-alias please='sudo'
156-
157-#alias g='grep -in'
158-
159-# Show history
160-if [ "$HIST_STAMPS" = "mm/dd/yyyy" ]
161-then
162- alias history='fc -fl 1'
163-elif [ "$HIST_STAMPS" = "dd.mm.yyyy" ]
164-then
165- alias history='fc -El 1'
166-elif [ "$HIST_STAMPS" = "yyyy-mm-dd" ]
167-then
168- alias history='fc -il 1'
169-else
170- alias history='fc -l 1'
171-fi
172-# List direcory contents
173-alias lsa='ls -lah'
174-alias l='ls -lah'
175-alias ll='ls -lh'
176-alias la='ls -lAh'
177-alias sl=ls # often screw this up
178-
179-alias afind='ack-grep -il'
180-
181diff --git a/lib/completion.zsh b/lib/completion.zsh
182index c54249c527b04b4c51ef014f2d9cdeddcf7ee252..452c0dfe765539dd6cf0a83f85037c7ac5f571a9 100644
183--- a/lib/completion.zsh
184+++ b/lib/completion.zsh
185@@ -15,7 +15,12 @@ if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
186 zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
187 unset CASE_SENSITIVE
188 else
189- zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
190+ if [ "x$HYPHEN_INSENSITIVE" = "xtrue" ]; then
191+ zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
192+ unset HYPHEN_INSENSITIVE
193+ else
194+ zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
195+ fi
196 fi
197
198 zstyle ':completion:*' list-colors ''
199@@ -25,15 +30,19 @@ bindkey -M menuselect '^o' accept-and-infer-next-history
200
201 zstyle ':completion:*:*:*:*:*' menu select
202 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
203-zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
204+if [ "$OSTYPE[0,7]" = "solaris" ]
205+then
206+ zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
207+else
208+ zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
209+fi
210
211 # disable named-directories autocompletion
212 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
213-cdpath=(.)
214
215 # Use caching so that commands like apt and dpkg complete are useable
216 zstyle ':completion::complete:*' use-cache 1
217-zstyle ':completion::complete:*' cache-path $ZSH/cache/
218+zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
219
220 # Don't complete uninteresting users
221 zstyle ':completion:*:*:*:users' ignored-patterns \
222@@ -44,7 +53,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
223 named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
224 operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
225 rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
226- usbmux uucp vcsa wwwrun xfs
227+ usbmux uucp vcsa wwwrun xfs '_*'
228
229 # ... unless we really want to.
230 zstyle '*' single-ignored show
231diff --git a/lib/correction.zsh b/lib/correction.zsh
232index 47eb83b1d523f2b0ae828fa0273377b967001734..3e1415a0ba840c1298e583c66c87eb2d6bb5f9ae 100644
233--- a/lib/correction.zsh
234+++ b/lib/correction.zsh
235@@ -1,13 +1,13 @@
236-alias man='nocorrect man'
237-alias mv='nocorrect mv'
238-alias mysql='nocorrect mysql'
239-alias mkdir='nocorrect mkdir'
240-alias gist='nocorrect gist'
241-alias heroku='nocorrect heroku'
242-alias ebuild='nocorrect ebuild'
243-alias hpodder='nocorrect hpodder'
244-alias sudo='nocorrect sudo'
245-
246 if [[ "$ENABLE_CORRECTION" == "true" ]]; then
247+ alias ebuild='nocorrect ebuild'
248+ alias gist='nocorrect gist'
249+ alias heroku='nocorrect heroku'
250+ alias hpodder='nocorrect hpodder'
251+ alias man='nocorrect man'
252+ alias mkdir='nocorrect mkdir'
253+ alias mv='nocorrect mv'
254+ alias mysql='nocorrect mysql'
255+ alias sudo='nocorrect sudo'
256+
257 setopt correct_all
258 fi
259diff --git a/lib/directories.zsh b/lib/directories.zsh
260index 1896945f46948f68ec5e3d67b54e36429d42c910..3bffa9fd96cef66fbd669c6e5087dddd1bb54d0b 100644
261--- a/lib/directories.zsh
262+++ b/lib/directories.zsh
263@@ -1,15 +1,12 @@
264 # Changing/making/removing directory
265-setopt auto_name_dirs
266 setopt auto_pushd
267 setopt pushd_ignore_dups
268 setopt pushdminus
269
270-alias ..='cd ..'
271-alias cd..='cd ..'
272-alias cd...='cd ../..'
273-alias cd....='cd ../../..'
274-alias cd.....='cd ../../../..'
275-alias cd/='cd /'
276+alias -g ...='../..'
277+alias -g ....='../../..'
278+alias -g .....='../../../..'
279+alias -g ......='../../../../..'
280
281 alias 1='cd -'
282 alias 2='cd -2'
283@@ -21,23 +18,16 @@ alias 7='cd -7'
284 alias 8='cd -8'
285 alias 9='cd -9'
286
287-cd () {
288- if [[ "x$*" == "x..." ]]; then
289- cd ../..
290- elif [[ "x$*" == "x...." ]]; then
291- cd ../../..
292- elif [[ "x$*" == "x....." ]]; then
293- cd ../../../..
294- elif [[ "x$*" == "x......" ]]; then
295- cd ../../../../..
296- elif [ -d ~/.autoenv ]; then
297- source ~/.autoenv/activate.sh
298- autoenv_cd "$@"
299- else
300- builtin cd "$@"
301- fi
302-}
303-
304 alias md='mkdir -p'
305 alias rd=rmdir
306 alias d='dirs -v | head -10'
307+
308+# List directory contents
309+alias lsa='ls -lah'
310+alias l='ls -lah'
311+alias ll='ls -lh'
312+alias la='ls -lAh'
313+
314+# Push and pop directories on directory stack
315+alias pu='pushd'
316+alias po='popd'
317diff --git a/lib/functions.zsh b/lib/functions.zsh
318index fda84a953907f770ab30c974ead543a72874e4f7..0d632a2686693f5d624ebd17694d9c4e18bc3d3e 100644
319--- a/lib/functions.zsh
320+++ b/lib/functions.zsh
321@@ -3,11 +3,11 @@ function zsh_stats() {
322 }
323
324 function uninstall_oh_my_zsh() {
325- /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
326+ env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
327 }
328
329 function upgrade_oh_my_zsh() {
330- /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
331+ env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
332 }
333
334 function take() {
335@@ -15,6 +15,22 @@ function take() {
336 cd $1
337 }
338
339+function open_command() {
340+ local open_cmd
341+
342+ # define the open command
343+ case "$OSTYPE" in
344+ darwin*) open_cmd="open" ;;
345+ cygwin*) open_cmd="cygstart" ;;
346+ linux*) open_cmd="xdg-open" ;;
347+ *) echo "Platform $OSTYPE not supported"
348+ return 1
349+ ;;
350+ esac
351+
352+ nohup $open_cmd "$@" &>/dev/null
353+}
354+
355 #
356 # Get the value of an alias.
357 #
358diff --git a/lib/git.zsh b/lib/git.zsh
359index 305a77aff087716a9148ea0b2aa40012e989109e..caa7e632913251f9694b3a3b7cb357e2879e02cf 100644
360--- a/lib/git.zsh
361+++ b/lib/git.zsh
362@@ -1,8 +1,8 @@
363 # get the name of the branch we are on
364 function git_prompt_info() {
365- if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
366+ if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
367 ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
368- ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
369+ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
370 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
371 fi
372 }
373@@ -10,23 +10,20 @@ function git_prompt_info() {
374
375 # Checks if working tree is dirty
376 parse_git_dirty() {
377- local SUBMODULE_SYNTAX=''
378- local GIT_STATUS=''
379- local CLEAN_MESSAGE='nothing to commit (working directory clean)'
380- if [[ "$(command git config --get oh-my-zsh.hide-status)" != "1" ]]; then
381+ local STATUS=''
382+ local FLAGS
383+ FLAGS=('--porcelain')
384+ if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
385 if [[ $POST_1_7_2_GIT -gt 0 ]]; then
386- SUBMODULE_SYNTAX="--ignore-submodules=dirty"
387+ FLAGS+='--ignore-submodules=dirty'
388 fi
389 if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
390- GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
391- else
392- GIT_STATUS=$(command git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
393- fi
394- if [[ -n $GIT_STATUS ]]; then
395- echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
396- else
397- echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
398+ FLAGS+='--untracked-files=no'
399 fi
400+ STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
401+ fi
402+ if [[ -n $STATUS ]]; then
403+ echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
404 else
405 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
406 fi
407@@ -39,26 +36,60 @@ git_remote_status() {
408 ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
409 behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
410
411- if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
412+ if [ $ahead -gt 0 ] && [ $behind -eq 0 ]
413 then
414- echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
415- elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
416+ git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
417+ git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
418+ elif [ $behind -gt 0 ] && [ $ahead -eq 0 ]
419 then
420- echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
421+ git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
422+ git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
423 elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
424 then
425- echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
426+ git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
427+ git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
428+ fi
429+
430+ if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]
431+ then
432+ git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
433 fi
434+
435+ echo $git_remote_status
436 fi
437 }
438
439-# Checks if there are commits ahead from remote
440+# Gets the number of commits ahead from remote
441+function git_commits_ahead() {
442+ if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
443+ COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
444+ echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
445+ fi
446+}
447+
448+# Outputs if current branch is ahead of remote
449 function git_prompt_ahead() {
450- if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
451+ if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then
452 echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
453 fi
454 }
455
456+# Outputs if current branch is behind remote
457+function git_prompt_behind() {
458+ if [[ -n "$(command git rev-list HEAD..origin/$(current_branch) 2> /dev/null)" ]]; then
459+ echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
460+ fi
461+}
462diff --git a/lib/grep.zsh b/lib/grep.zsh
463index 276fec382ffbb056fc4f77ef01c0f0a94f22ef94..3fa103d19a5827f021742f442aaf3c1148d980a5 100644
464--- a/lib/grep.zsh
465+++ b/lib/grep.zsh
466@@ -1,24 +1,28 @@
467-#
468-# Color grep results
469-# Examples: http://rubyurl.com/ZXv
470-#
471-
472-GREP_OPTIONS="--color=auto"
473-
474-# avoid VCS folders (if the necessary grep flags are available)
475+# is x grep argument available?
476 grep-flag-available() {
477 echo | grep $1 "" >/dev/null 2>&1
478 }
479+
480+GREP_OPTIONS=""
481+
482+# color grep results
483+if grep-flag-available --color=auto; then
484+ GREP_OPTIONS+=" --color=auto"
485+fi
486+
487+# ignore VCS folders (if the necessary grep flags are available)
488+VCS_FOLDERS="{.bzr,.cvs,.git,.hg,.svn}"
489+
490 if grep-flag-available --exclude-dir=.cvs; then
491- for PATTERN in .cvs .git .hg .svn; do
492- GREP_OPTIONS+=" --exclude-dir=$PATTERN"
493- done
494+ GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
495 elif grep-flag-available --exclude=.cvs; then
496- for PATTERN in .cvs .git .hg .svn; do
497- GREP_OPTIONS+=" --exclude=$PATTERN"
498- done
499+ GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
500 fi
501-unfunction grep-flag-available
502
503-export GREP_OPTIONS="$GREP_OPTIONS"
504-export GREP_COLOR='1;32'
505+# export grep settings
506+alias grep="grep $GREP_OPTIONS"
507+
508+# clean up
509+unset GREP_OPTIONS
510+unset VCS_FOLDERS
511+unfunction grep-flag-available
512diff --git a/lib/history.zsh b/lib/history.zsh
513index 1d83e56e3a63391133304d3f92596fab97fa1d55..5de71c2d3e0fdd0296cc8d46da9fbd1724fd7a00 100644
514--- a/lib/history.zsh
515+++ b/lib/history.zsh
516@@ -1,10 +1,20 @@
517 ## Command history configuration
518-if [ -z $HISTFILE ]; then
519+if [ -z "$HISTFILE" ]; then
520 HISTFILE=$HOME/.zsh_history
521 fi
522+
523 HISTSIZE=10000
524 SAVEHIST=10000
525
526+# Show history
527+case $HIST_STAMPS in
528+ "mm/dd/yyyy") alias history='fc -fl 1' ;;
529+ "dd.mm.yyyy") alias history='fc -El 1' ;;
530+ "yyyy-mm-dd") alias history='fc -il 1' ;;
531+ *) alias history='fc -l 1' ;;
532+esac
533+
534+setopt append_history
535 setopt extended_history
536 setopt hist_expire_dups_first
537 setopt hist_ignore_dups # ignore duplication command history list
538diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
539index 9063c6a18c2778056832654e5a300b25ec32a084..eb2b58058cee10471175530ee3fa67bb04436543 100644
540--- a/lib/key-bindings.zsh
541+++ b/lib/key-bindings.zsh
542@@ -64,6 +64,9 @@ autoload -U edit-command-line
543 zle -N edit-command-line
544 bindkey '\C-x\C-e' edit-command-line
545
546+# file rename magick
547+bindkey "^[m" copy-prev-shell-word
548+
549 # consider emacs keybindings:
550
551 #bindkey -e ## emacs key bindings
552diff --git a/lib/misc.zsh b/lib/misc.zsh
553index a8678b8ecd0185d66500e79bab39224676def2a6..6d1a64e8dbc540fcbe3a84df20082d2416a4e1de 100644
554--- a/lib/misc.zsh
555+++ b/lib/misc.zsh
556@@ -1,9 +1,10 @@
557-## smart urls
558-autoload -U url-quote-magic
559-zle -N self-insert url-quote-magic
560-
561-## file rename magick
562-bindkey "^[m" copy-prev-shell-word
563+## Load smart urls if available
564+for d in $fpath; do
565+ if [[ -e "$d/url-quote-magic" ]]; then
566+ autoload -U url-quote-magic
567+ zle -N self-insert url-quote-magic
568+ fi
569+done
570
571 ## jobs
572 setopt long_list_jobs
573@@ -12,4 +13,17 @@ setopt long_list_jobs
574 export PAGER="less"
575 export LESS="-R"
576
577-export LC_CTYPE=$LANG
578+## super user alias
579+alias _='sudo'
580+alias please='sudo'
581+
582+## more intelligent acking for ubuntu users
583+alias afind='ack-grep -il'
584+
585+# only define LC_CTYPE if undefined
586+if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
587+ export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
588+fi
589+
590+# recognize comments
591+setopt interactivecomments
592diff --git a/lib/nvm.zsh b/lib/nvm.zsh
593index 5cadf706195fcb84b0f7e32f9f831d5cd2539a9a..61d997fc07806ccb114df0895a8c6dc4c96866d8 100644
594--- a/lib/nvm.zsh
595+++ b/lib/nvm.zsh
596@@ -1,6 +1,6 @@
597 # get the node.js version
598 function nvm_prompt_info() {
599- [ -f $HOME/.nvm/nvm.sh ] || return
600+ [ -f "$HOME/.nvm/nvm.sh" ] || return
601 local nvm_prompt
602 nvm_prompt=$(node -v 2>/dev/null)
603 [[ "${nvm_prompt}x" == "x" ]] && return
604diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
605index 9c0a430fb9bc676fec0810822de552c655687894..babbaa95789afb3233e8b4eb74216ceed44ce716 100644
606--- a/lib/termsupport.zsh
607+++ b/lib/termsupport.zsh
608@@ -1,39 +1,73 @@
609-#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
610-#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
611-#Fully support screen, iterm, and probably most modern xterm and rxvt
612-#Limited support for Apple Terminal (Terminal can't set window or tab separately)
613+# Set terminal window and tab/icon title
614+#
615+# usage: title short_tab_title [long_window_title]
616+#
617+# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
618+# Fully supports screen, iterm, and probably most modern xterm and rxvt
619+# (In screen, only short_tab_title is used)
620+# Limited support for Apple Terminal (Terminal can't set window and tab separately)
621 function title {
622- if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
623- return
624- fi
625+ emulate -L zsh
626+ setopt prompt_subst
627+
628+ [[ "$EMACS" == *term* ]] && return
629+
630+ # if $2 is unset use $1 as default
631+ # if it is set and empty, leave it as is
632+ : ${2=$1}
633+
634 if [[ "$TERM" == screen* ]]; then
635 print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
636- elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
637+ elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]] || [[ "$TERM" == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
638 print -Pn "\e]2;$2:q\a" #set window name
639- print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
640+ print -Pn "\e]1;$1:q\a" #set icon (=tab) name
641 fi
642 }
643
644 ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
645 ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
646+# Avoid duplication of directory in terminals with independent dir display
647+if [[ $TERM_PROGRAM == Apple_Terminal ]]; then
648+ ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
649+fi
650
651-#Appears when you have the prompt
652+# Runs before showing the prompt
653 function omz_termsupport_precmd {
654+ if [[ $DISABLE_AUTO_TITLE == true ]]; then
655+ return
656+ fi
657+
658 title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
659 }
660
661-#Appears at the beginning of (and during) of command execution
662+# Runs before executing the command
663 function omz_termsupport_preexec {
664+ if [[ $DISABLE_AUTO_TITLE == true ]]; then
665+ return
666+ fi
667+
668 emulate -L zsh
669 setopt extended_glob
670
671 # cmd name only, or if this is sudo or ssh, the next cmd
672- local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%}
673+ local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
674 local LINE="${2:gs/%/%%}"
675
676 title '$CMD' '%100>...>$LINE%<<'
677 }
678
679-autoload -U add-zsh-hook
680-add-zsh-hook precmd omz_termsupport_precmd
681-add-zsh-hook preexec omz_termsupport_preexec
682+precmd_functions+=(omz_termsupport_precmd)
683+preexec_functions+=(omz_termsupport_preexec)
684+
685+
686+# Runs before showing the prompt, to update the current directory in Terminal.app
687+function omz_termsupport_cwd {
688+ # Notify Terminal.app of current directory using undocumented OSC sequence
689+ # found in OS X 10.9 and 10.10's /etc/bashrc
690+ if [[ $TERM_PROGRAM == Apple_Terminal ]] && [[ -z $INSIDE_EMACS ]]; then
691+ local PWD_URL="file://$HOSTNAME${PWD// /%20}"
692+ printf '\e]7;%s\a' "$PWD_URL"
693+ fi
694+}
695+
696+precmd_functions+=(omz_termsupport_cwd)
697diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
698index 0353f9db4d1c5ac973264132c316fde2dc084cf7..926303ca4509cd89bbc30187fd99879c1fbeb771 100644
699--- a/lib/theme-and-appearance.zsh
700+++ b/lib/theme-and-appearance.zsh
701@@ -1,14 +1,13 @@
702 # ls colors
703-autoload colors; colors;
704+autoload -U colors && colors
705 export LSCOLORS="Gxfxcxdxbxegedabagacad"
706-#export LS_COLORS
707
708 # Enable ls colors
709 if [ "$DISABLE_LS_COLORS" != "true" ]
710 then
711 # Find the option for using colors in ls, depending on the version: Linux or BSD
712 if [[ "$(uname -s)" == "NetBSD" ]]; then
713- # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
714+ # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
715 # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
716 gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
717 elif [[ "$(uname -s)" == "OpenBSD" ]]; then
718@@ -23,7 +22,7 @@ fi
719 #setopt no_beep
720 setopt auto_cd
721 setopt multios
722-setopt cdablevarS
723+setopt cdablevars
724
725 if [[ x$WINDOW != x ]]
726 then
727@@ -43,4 +42,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c
728
729 # Setup the prompt with pretty colors
730 setopt prompt_subst
731-
732diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
733index 3c0f4f8f5f990e09d26d000176bb344d06a7c564..4e5f77990dd567ca1495ed2af948473609ed1bfe 100644
734--- a/oh-my-zsh.sh
735+++ b/oh-my-zsh.sh
736@@ -1,6 +1,6 @@
737 # Check for updates on initial load...
738 if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
739- /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
740+ env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
741 fi
742
743 # Initializes Oh My Zsh
744@@ -8,18 +8,27 @@ fi
745 # add a function path
746 fpath=($ZSH/functions $ZSH/completions $fpath)
747
748-# Load all of the config files in ~/oh-my-zsh that end in .zsh
749-# TIP: Add files you don't want in git to .gitignore
750-for config_file ($ZSH/lib/*.zsh); do
751- source $config_file
752-done
753-
754 # Set ZSH_CUSTOM to the path where your custom config files
755 # and plugins exists, or else we will use the default custom/
756 if [[ -z "$ZSH_CUSTOM" ]]; then
757 ZSH_CUSTOM="$ZSH/custom"
758 fi
759
760+# Set ZSH_CACHE_DIR to the path where cache files should be created
761+# or else we will use the default cache/
762+if [[ -z "$ZSH_CACHE_DIR" ]]; then
763+ ZSH_CACHE_DIR="$ZSH/cache/"
764+fi
765+
766+
767+# Load all of the config files in ~/oh-my-zsh that end in .zsh
768+# TIP: Add files you don't want in git to .gitignore
769+for config_file ($ZSH/lib/*.zsh); do
770+ custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
771+ [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
772+ source $config_file
773+done
774+
775
776 is_plugin() {
777 local base_dir=$1
778@@ -38,15 +47,17 @@ for plugin ($plugins); do
779 done
780
781 # Figure out the SHORT hostname
782-if [ -n "$commands[scutil]" ]; then
783- # OS X
784- SHORT_HOST=$(scutil --get ComputerName)
785+if [[ "$OSTYPE" = darwin* ]]; then
786+ # OS X's $HOST changes with dhcp, etc. Use ComputerName if possible.
787+ SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
788 else
789 SHORT_HOST=${HOST/.*/}
790 fi
791
792 # Save the location of the current completion dump file.
793-ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
794+if [ -z "$ZSH_COMPDUMP" ]; then
795+ ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
796+fi
797
798 # Load and run compinit
799 autoload -U compinit
800diff --git a/plugins/adb/README.md b/plugins/adb/README.md
801new file mode 100644
802index 0000000000000000000000000000000000000000..075beec0e3733e06035f7e982a9aef58b5438f1b
803--- /dev/null
804+++ b/plugins/adb/README.md
805@@ -0,0 +1,8 @@
806+# adb autocomplete plugin
807+
808+* Adds autocomplete options for all adb commands.
809+
810+
811+## Requirements
812+
813+In order to make this work, you will need to have the Android adb tools set up in your path.
814diff --git a/plugins/adb/_adb b/plugins/adb/_adb
815new file mode 100644
816index 0000000000000000000000000000000000000000..f30f3247f1ecbb884b260f83e6507e94fcab7203
817--- /dev/null
818+++ b/plugins/adb/_adb
819@@ -0,0 +1,48 @@
820+#compdef adb
821+#autoload
822+
823+# in order to make this work, you will need to have the android adb tools
824+
825+# adb zsh completion, based on homebrew completion
826+
827+local -a _1st_arguments
828+_1st_arguments=(
829+'bugreport:return all information from the device that should be included in a bug report.'
830+'connect:connect to a device via TCP/IP Port 5555 is default.'
831+'devices:list all connected devices'
832+'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
833+'emu:run emulator console command'
834+'forward:forward socket connections'
835+'help:show the help message'
836+'install:push this package file to the device and install it'
837+'jdwp:list PIDs of processes hosting a JDWP transport'
838+'kill-server:kill the server if it is running'
839+'logcat:view device log'
840+'pull:copy file/dir from device'
841+'push:copy file/dir to device'
842+'reboot:reboots the device, optionally into the bootloader or recovery program'
843+'reboot-bootloader:reboots the device into the bootloader'
844+'remount:remounts the partitions on the device read-write'
845+'root:restarts the adbd daemon with root permissions'
846+'sideload:push a ZIP to device and install it'
847+'shell:run remote shell interactively'
848+'sync:copy host->device only if changed (-l means list but dont copy)'
849+'start-server:ensure that there is a server running'
850+'tcpip:restart host adb in tcpip mode'
851+'uninstall:remove this app package from the device'
852+'version:show version num'
853+'wait-for-device:block until device is online'
854+)
855+
856+local expl
857+local -a pkgs installed_pkgs
858+
859+_arguments \
860+ '*:: :->subcmds' && return 0
861+
862+if (( CURRENT == 1 )); then
863+ _describe -t commands "adb subcommand" _1st_arguments
864+ return
865+fi
866+
867+_files
868diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
869index 45f2b06eb600511408934471ca4320f2497ab218..0b738c94fc8ff1f0f1683fc7684c6b042100ff7a 100644
870--- a/plugins/ant/ant.plugin.zsh
871+++ b/plugins/ant/ant.plugin.zsh
872@@ -1,15 +1,15 @@
873 _ant_does_target_list_need_generating () {
874 [ ! -f .ant_targets ] && return 0;
875- [ .ant_targets -nt build.xml ] && return 0;
876+ [ build.xml -nt .ant_targets ] && return 0;
877 return 1;
878 }
879
880 _ant () {
881 if [ -f build.xml ]; then
882 if _ant_does_target_list_need_generating; then
883- sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
884+ ant -p | awk -F " " 'NR > 5 { print lastTarget }{lastTarget = $1}' > .ant_targets
885 fi
886- compadd `cat .ant_targets`
887+ compadd -- `cat .ant_targets`
888 fi
889 }
890
891diff --git a/plugins/apache2-macports/README.md b/plugins/apache2-macports/README.md
892new file mode 100644
893index 0000000000000000000000000000000000000000..099fc8da31dbe0fb2850e3336c45357b14ec5dbd
894--- /dev/null
895+++ b/plugins/apache2-macports/README.md
896@@ -0,0 +1,19 @@
897+## APACHE2 MACPORTS PLUGIN
898+
899+
900+---
901+
902+### FEATURES
903+
904+| Alias | Function | Description |
905+|:--------------:|:-------------------------------------------------------------------------------|----------------------:|
906+| apache2restart | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart | Restart apache daemon |
907+| apache2start | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start | Start apache daemon |
908+| apache2stop | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop | Stop apache daemon |
909+
910+---
911+
912+### CONTRIBUTORS
913+ - Alexander Rinass (alex@rinass.net)
914+
915+---
916diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
917new file mode 100644
918index 0000000000000000000000000000000000000000..ad42d4cd282bfe7047d9e10b5c9bb834431f8234
919--- /dev/null
920+++ b/plugins/archlinux/README.md
921@@ -0,0 +1,64 @@
922+## ARCHLINUX PLUGIN
923+
924+
925+---
926+
927+### FEATURES
928+
929+| Alias | Function | Description |
930+|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
931+| pacin | sudo pacman -S | Install specific package(s) from the repositories |
932+| pacins | sudo pacman -U | Install specific package not from the repositories but from a file |
933+| pacinsd | sudo pacman -S --asdeps | Install given package(s) as dependencies of another package |
934+| pacloc | pacman -Qi | Display information about a given package in the local database |
935+| paclocs | pacman -Qs | Search for package(s) in the local database |
936+| paclsorphans | sudo pacman -Qdt' | List all orphaned packages |
937+| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist |
938+| pacre | sudo pacman -R | Remove the specified package(s), retaining its configuration(s) and required dependencies |
939+| pacrem | sudo pacman -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies |
940+| pacrep | pacman -Si | Display information about a given package in the repositories |
941+| pacreps | pacman -Ss | Search for package(s) in the repositories |
942+| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)' | Delete all orphaned packages |
943+| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories |
944+| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories |
945+| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories |
946+| pacupd | sudo pacman -Sy | Update and refresh the local package database against repositories |
947+| pacupg | sudo pacman -Syu | Synchronize with repositories before upgrading packages that are out of date on the local system. |
948+| yaconf | yaourt -C | Fix all configuration files with vimdiff |
949+| yain | yaourt -S | Install specific package(s) from the repositories |
950+| yains | yaourt -U | Install specific package not from the repositories but from a file |
951+| yainsd | yaourt -S --asdeps | Install given package(s) as dependencies of another package |
952+| yaloc | yaourt -Qi | Display information about a given package in the local database |
953+| yalocs | yaourt -Qs | Search for package(s) in the local database |
954+| yalst | yaourt -Qe | List installed packages, even those installed from AUR (they're tagged as "local") |
955+| yamir | yaourt -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist |
956+| yaorph | yaourt -Qtd | Remove orphans using yaourt |
957+| yare | yaourt -R | Remove the specified package(s), retaining its configuration(s) and required dependencies |
958+| yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies |
959+| yarep | yaourt -Si | Display information about a given package in the repositories |
960+| yareps | yaourt -Ss | Search for package(s) in the repositories |
961+| yasu | yaourt --sucre | Same as yaupg, but without confirmation |
962+| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories |
963+| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories |
964+| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories |
965+| yaupd | yaourt -Sy | Update and refresh the local package database against repositories |
966+| yaupg | yaourt -Syua | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system |
967+
968+| Function | Description |
969+|----------------|:------------------------------------------------------------------------------------------------------------------|
970+| pacdisowned | List all disowned files in your system |
971+| paclist | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) |
972+| pacmanallkeys | Get all keys for developers and trusted users |
973+| pacmansignkeys | |
974+
975+---
976+
977+### CONTRIBUTORS
978+ - Benjamin Boudreau - dreurmail@gmail.com
979+ - Celso Miranda - contacto@celsomiranda.net
980+ - KhasMek - Boushh@gmail.com
981+ - Martin Putniorz - mputniorz@gmail.com
982+ - MatthR3D - matthr3d@gmail.com
983+ - ornicar - thibault.duplessis@gmail.com
984+
985+---
986diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
987index bffe9657af9e762adf41ca0fd651a27f410dc298..b83c24560bf84c65629b90b7f0f5790ab966270f 100644
988--- a/plugins/archlinux/archlinux.plugin.zsh
989+++ b/plugins/archlinux/archlinux.plugin.zsh
990@@ -2,7 +2,7 @@
991 # Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
992
993 # Look for yaourt, and add some useful functions if we have it.
994-if [[ -x `which yaourt` ]]; then
995+if [[ -x `command -v yaourt` ]]; then
996 upgrade () {
997 yaourt -Syu
998 }
999@@ -21,10 +21,14 @@ if [[ -x `which yaourt` ]]; then
1000 alias yalst='yaourt -Qe' # List installed packages, even those installed from AUR (they're tagged as "local")
1001 alias yaorph='yaourt -Qtd' # Remove orphans using yaourt
1002 # Additional yaourt alias examples
1003- if [[ -x `which abs` ]]; then
1004+ if [[ -x `command -v abs` && -x `command -v aur` ]]; then
1005+ alias yaupd='yaourt -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
1006+ elif [[ -x `command -v abs` ]]; then
1007 alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
1008+ elif [[ -x `command -v aur` ]]; then
1009+ alias yaupd='yaourt -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
1010 else
1011- alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories
1012+ alias yaupd='yaourt -Sy' # Update and refresh the local package database against repositories
1013 fi
1014 alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package
1015 alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
1016@@ -45,17 +49,21 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
1017 alias pacloc='pacman -Qi' # Display information about a given package in the local database
1018 alias paclocs='pacman -Qs' # Search for package(s) in the local database
1019 # Additional pacman alias examples
1020-if [[ -x `which abs` ]]; then
1021- alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
1022+if [[ -x `command -v abs` && -x `command -v aur` ]]; then
1023+ alias pacupd='sudo pacman -Sy && sudo abs && sudo aur' # Update and refresh the local package, ABS and AUR databases against repositories
1024+elif [[ -x `command -v abs` ]]; then
1025+ alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
1026+elif [[ -x `command -v aur` ]]; then
1027+ alias pacupd='sudo pacman -Sy && sudo aur' # Update and refresh the local package and AUR databases against repositories
1028 else
1029- alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories
1030+ alias pacupd='sudo pacman -Sy' # Update and refresh the local package database against repositories
1031 fi
1032 alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package
1033 alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
1034
1035 # https://bbs.archlinux.org/viewtopic.php?id=93683
1036 paclist() {
1037- sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
1038+ LC_ALL=C pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
1039 }
1040
1041 alias paclsorphans='sudo pacman -Qdt'
1042diff --git a/plugins/atom/README.md b/plugins/atom/README.md
1043new file mode 100644
1044index 0000000000000000000000000000000000000000..75d77a0ac1c3732be4dbab1b4062e4f8e1d315fc
1045--- /dev/null
1046+++ b/plugins/atom/README.md
1047@@ -0,0 +1,17 @@
1048+## atom
1049+
1050+Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows.
1051+
1052+### Requirements
1053+
1054+ * [Atom](https://atom.io/)
1055+
1056+### Usage
1057+
1058+ * If `at` command is called without an argument, launch Atom
1059+
1060+ * If `at` is passed a directory, `cd` to it and open it in Atom
1061+
1062+ * If `at` is passed a file, open it in Atom
1063+
1064+ * if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom
1065diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
1066index ca5666979cd7de508643295b7625835643847e8a..a8271849e3004255b2acb29b6cdefa089e917ddb 100644
1067--- a/plugins/autoenv/autoenv.plugin.zsh
1068+++ b/plugins/autoenv/autoenv.plugin.zsh
1069@@ -1,6 +1,17 @@
1070+# Activates autoenv or reports its failure
1071+if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
1072+ echo '-------- AUTOENV ---------'
1073+ echo 'Could not find ~/.autoenv/activate.sh.'
1074+ echo 'Please check if autoenv is correctly installed.'
1075+ echo 'In the meantime the autoenv plugin is DISABLED.'
1076+ echo '--------------------------'
1077+ return 1
1078+fi
1079+
1080 # The use_env call below is a reusable command to activate/create a new Python
1081 # virtualenv, requiring only a single declarative line of code in your .env files.
1082 # It only performs an action if the requested virtualenv is not the current one.
1083+
1084 use_env() {
1085 typeset venv
1086 venv="$1"
1087diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
1088index 0aa14959d3540d9d34b3570248b58d722bcdac7f..4cf0364013b2655dac01bf250d063ff2d7b2d1b5 100644
1089--- a/plugins/autojump/autojump.plugin.zsh
1090+++ b/plugins/autojump/autojump.plugin.zsh
1091@@ -1,5 +1,11 @@
1092 if [ $commands[autojump] ]; then # check if autojump is installed
1093- if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
1094+ if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
1095+ . $HOME/.autojump/etc/profile.d/autojump.zsh
1096+ elif [ -f $HOME/.autojump/share/autojump/autojump.zsh ]; then # another manual user-local installation
1097+ . $HOME/.autojump/share/autojump/autojump.zsh
1098+ elif [ -f $HOME/.nix-profile/etc/profile.d/autojump.zsh ]; then # nix installation
1099+ . $HOME/.nix-profile/etc/profile.d/autojump.zsh
1100+ elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
1101 . /usr/share/autojump/autojump.zsh
1102 elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
1103 . /etc/profile.d/autojump.zsh
1104@@ -7,8 +13,6 @@ if [ $commands[autojump] ]; then # check if autojump is installed
1105 . /etc/profile.d/autojump.sh
1106 elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
1107 . /usr/local/share/autojump/autojump.zsh
1108- elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
1109- . $HOME/.autojump/etc/profile.d/autojump.zsh
1110 elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
1111 . /opt/local/etc/profile.d/autojump.zsh
1112 elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
1113diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
1114index 3f7fb199581c399916ceae46ff60ef3c3edd7485..7246db9f0e10252a2c9bee1cff624e0b76ebc6c9 100644
1115--- a/plugins/aws/aws.plugin.zsh
1116+++ b/plugins/aws/aws.plugin.zsh
1117@@ -1,17 +1,32 @@
1118+_homebrew-installed() {
1119+ type brew &> /dev/null
1120+}
1121+
1122+_awscli-homebrew-installed() {
1123+ brew list awscli &> /dev/null
1124+}
1125+
1126 export AWS_HOME=~/.aws
1127
1128 function agp {
1129 echo $AWS_DEFAULT_PROFILE
1130-
1131 }
1132 function asp {
1133 export AWS_DEFAULT_PROFILE=$1
1134- export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
1135-
1136+ export AWS_PROFILE=$1
1137+ export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$RPROMPT"
1138 }
1139 function aws_profiles {
1140 reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
1141 }
1142
1143 compctl -K aws_profiles asp
1144-source `which aws_zsh_completer.sh`
1145+
1146+if _homebrew-installed && _awscli-homebrew-installed ; then
1147+ _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh
1148+else
1149+ _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
1150+fi
1151+
1152+[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
1153+unset _aws_zsh_completer_path
1154diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
1155index 32dd4b624dfd96081f3a2d518af1d4b763089bc7..014bb15dd0ce0c79be54012a9a5add21c45433b1 100644
1156--- a/plugins/battery/battery.plugin.zsh
1157+++ b/plugins/battery/battery.plugin.zsh
1158@@ -8,7 +8,7 @@
1159 # Modified to add support for Apple Mac #
1160 ###########################################
1161
1162-if [[ $(uname) == "Darwin" ]] ; then
1163+if [[ "$OSTYPE" = darwin* ]] ; then
1164
1165 function battery_pct() {
1166 local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
1167diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md
1168new file mode 100644
1169index 0000000000000000000000000000000000000000..ec2b743d6a29bebc1bb5bec6d195ed90d0f74ccf
1170--- /dev/null
1171+++ b/plugins/bbedit/README.md
1172@@ -0,0 +1,20 @@
1173+## bbedit
1174+
1175+Plugin for BBEdit, an HTML and text editor for Mac OS X
1176+
1177+### Requirements
1178+
1179+ * [BBEdit](http://www.barebones.com/products/bbedit/)
1180+ * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html)
1181+
1182+### Usage
1183+
1184+ * If the `bb` command is called without an argument, launch BBEdit
1185+
1186+ * If `bb` is passed a directory, cd to it and open it in BBEdit
1187+
1188+ * If `bb` is passed a file, open it in BBEdit
1189+
1190+ * If `bbpb` create a new BBEdit document with the contents of the clipboard
1191+
1192+ * If `bbd` alias for BBEdit diff tool
1193diff --git a/plugins/bbedit/bbedit.plugin.zsh b/plugins/bbedit/bbedit.plugin.zsh
1194new file mode 100644
1195index 0000000000000000000000000000000000000000..fe9e72c6567946c00ee172d188574873f9c5014d
1196--- /dev/null
1197+++ b/plugins/bbedit/bbedit.plugin.zsh
1198@@ -0,0 +1,21 @@
1199+alias bbpb='pbpaste | bbedit --clean --view-top'
1200+
1201+alias bbd=bbdiff
1202+
1203+#
1204+# If the bb command is called without an argument, launch BBEdit
1205+# If bb is passed a directory, cd to it and open it in BBEdit
1206+# If bb is passed a file, open it in BBEdit
1207+#
1208+function bb() {
1209+ if [[ -z "$1" ]]
1210+ then
1211+ bbedit --launch
1212+ else
1213+ bbedit "$1"
1214+ if [[ -d "$1" ]]
1215+ then
1216+ cd "$1"
1217+ fi
1218+ fi
1219+}
1220diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md
1221new file mode 100644
1222index 0000000000000000000000000000000000000000..b154916d61f2d0b2b1d1f1cb63e93fb69066e6c9
1223--- /dev/null
1224+++ b/plugins/bgnotify/README.md
1225@@ -0,0 +1,54 @@
1226+# bgnotify zsh plugin
1227+
1228+cross-platform background notifications for long running commands! Supports OSX and Ubuntu linux.
1229+
1230+Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-background-notify)
1231+
1232+----------------------------------
1233+
1234+## How to use!
1235+
1236+Just add bgnotify to your plugins list in your `.zshrc`
1237+
1238+- On OS X you'll need [terminal-notifer](https://github.com/alloy/terminal-notifier)
1239+ * `brew install terminal-notifier` (or `gem install terminal-notifier`)
1240+- On ubuntu you're already all set!
1241+- On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
1242+
1243+
1244+## Screenshots
1245+
1246+**Linux**
1247+
1248+
1249+
1250+**OS X**
1251+
1252+
1253+
1254+**Windows**
1255+
1256+
1257+
1258+
1259+## Configuration
1260+
1261+One can configure a few things:
1262+
1263+- `bgnotify_threshold` sets the notification threshold time (default 6 seconds)
1264+- `function bgnotify_formatted` lets you change the notification
1265+
1266+Use these by adding a function definition before the your call to source. Example:
1267+
1268+~~~ sh
1269+bgnotify_threshold=4 ## set your own notification threshold
1270+
1271+function bgnotify_formatted {
1272+ ## $1=exit_status, $2=command, $3=elapsed_time
1273+ [ $1 -eq 0 ] && title="Holy Smokes Batman!" || title="Holy Graf Zeppelin!"
1274+ bgnotify "$title -- after $3 s" "$2";
1275+}
1276+
1277+plugins=(git bgnotify) ## add to plugins list
1278+source $ZSH/oh-my-zsh.sh ## existing source call
1279+~~~
1280diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
1281new file mode 100755
1282index 0000000000000000000000000000000000000000..b70b42f984540b2d58e9a6720e57234ec5ae21d6
1283--- /dev/null
1284+++ b/plugins/bgnotify/bgnotify.plugin.zsh
1285@@ -0,0 +1,67 @@
1286+#!/usr/bin/env zsh
1287+
1288+## setup ##
1289+
1290+[[ -o interactive ]] || return #interactive only!
1291+zmodload zsh/datetime || { print "can't load zsh/datetime"; return } # faster than date()
1292+autoload -Uz add-zsh-hook || { print "can't add zsh hook!"; return }
1293+
1294+(( ${+bgnotify_threshold} )) || bgnotify_threshold=5 #default 10 seconds
1295+
1296+
1297+## definitions ##
1298+
1299+if ! (type bgnotify_formatted | grep -q 'function'); then
1300+ function bgnotify_formatted {
1301+ ## exit_status, command, elapsed_time
1302+ [ $1 -eq 0 ] && title="#win (took $3 s)" || title="#fail (took $3 s)"
1303+ bgnotify "$title" "$2"
1304+ }
1305+fi
1306+
1307+currentWindowId () {
1308+ if hash osascript 2>/dev/null; then #osx
1309+ osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0"
1310+ elif hash notify-send 2>/dev/null; then #ubuntu!
1311+ xprop -root | awk '/NET_ACTIVE_WINDOW/ { print $5; exit }'
1312+ else
1313+ echo $EPOCHSECONDS #fallback for windows
1314+ fi
1315+}
1316+
1317+bgnotify () {
1318+ if hash terminal-notifier 2>/dev/null; then #osx
1319+ terminal-notifier -message "$2" -title "$1"
1320+ elif hash growlnotify 2>/dev/null; then #osx growl
1321+ growlnotify -m "$1" "$2"
1322+ elif hash notify-send 2>/dev/null; then #ubuntu!
1323+ notify-send "$1" "$2"
1324+ elif hash notifu 2>/dev/null; then #cygwyn support!
1325+ notifu /m "$2" /p "$1"
1326+ fi
1327+}
1328+
1329+
1330+## Zsh hooks ##
1331+
1332+bgnotify_begin() {
1333+ bgnotify_timestamp=$EPOCHSECONDS
1334+ bgnotify_lastcmd=$1
1335+ bgnotify_windowid=$(currentWindowId)
1336+}
1337+
1338+bgnotify_end() {
1339+ didexit=$?
1340+ elapsed=$(( EPOCHSECONDS - bgnotify_timestamp ))
1341+ past_threshold=$(( elapsed >= bgnotify_threshold ))
1342+ if (( bgnotify_timestamp > 0 )) && (( past_threshold )); then
1343+ if [ $(currentWindowId) != "$bgnotify_windowid" ]; then
1344+ print -n "\a"
1345+ bgnotify_formatted "$didexit" "$bgnotify_lastcmd" "$elapsed"
1346+ fi
1347+ fi
1348+ bgnotify_timestamp=0 #reset it to 0!
1349+}
1350+
1351+add-zsh-hook preexec bgnotify_begin
1352+add-zsh-hook precmd bgnotify_end
1353diff --git a/plugins/boot2docker/README.md b/plugins/boot2docker/README.md
1354new file mode 100644
1355index 0000000000000000000000000000000000000000..9551e235109d0be2b4c182507496be150ae10e30
1356--- /dev/null
1357+++ b/plugins/boot2docker/README.md
1358@@ -0,0 +1,6 @@
1359+## Boot2docker autocomplete plugin
1360+
1361+- Adds autocomplete options for all boot2docker commands.
1362+
1363+
1364+Maintainer : Manfred Touron ([@moul](https://github.com/moul))
1365diff --git a/plugins/boot2docker/_boot2docker b/plugins/boot2docker/_boot2docker
1366new file mode 100644
1367index 0000000000000000000000000000000000000000..3116bd14c3e7aec0cad9ede724da70c4e17ee29c
1368--- /dev/null
1369+++ b/plugins/boot2docker/_boot2docker
1370@@ -0,0 +1,73 @@
1371+#compdef boot2docker
1372+
1373+# Boot2docker autocompletion for oh-my-zsh
1374+# Requires: Boot2docker installed
1375+# Author: Manfred Touron (@moul)
1376+
1377+local -a _1st_arguments
1378+_1st_arguments=(
1379+ "init":"Create a new Boot2Docker VM."
1380+ "up":"Start VM from any states."
1381+ "start":"Start VM from any states."
1382+ "boot":"Start VM from any states."
1383+ "ssh":"[ssh-command] Login to VM via SSH."
1384+ "save":"Suspend VM and save state to disk."
1385+ "suspend":"Suspend VM and save state to disk."
1386+ "down":"Gracefully shutdown the VM."
1387+ "stop":"Gracefully shutdown the VM."
1388+ "halt":"Gracefully shutdown the VM."
1389+ "restart":"Gracefully reboot the VM."
1390+ "poweroff":"Forcefully power off the VM (may corrupt disk image)."
1391+ "reset":"Forcefully power cycle the VM (may corrupt disk image)."
1392+ "delete":"Delete Boot2Docker VM and its disk image."
1393+ "destroy":"Delete Boot2Docker VM and its disk image."
1394+ "config":"Show selected profile file settings."
1395+ "cfg":"Show selected profile file settings."
1396+ "info":"Display detailed information of VM."
1397+ "ip":"Display the IP address of the VM's Host-only network."
1398+ "socket":"Display the DOCKER_HOST socket to connect to."
1399+ "shellinit":"Display the shell command to set up the Docker client."
1400+ "status":"Display current state of VM."
1401+ "download":"Download Boot2Docker ISO image."
1402+ "upgrade":"Upgrade the Boot2Docker ISO image (restart if running)."
1403+ "version":"Display version information."
1404+)
1405+
1406+_arguments \
1407+ '(--basevmdk)--basevmdk[Path to VMDK to use as base for persistent partition]' \
1408+ '(--cpus)'{-c,--cpus}'[number of CPUs for boot2docker.]' \
1409+ '(--clobber)--clobber[overwrite Docker client binary on boot2docker upgrade]' \
1410+ '(--dhcp)--dhcp[enable VirtualBox host-only network DHCP.]' \
1411+ '(--dhcpip)--dhcpip[VirtualBox host-only network DHCP server address.]' \
1412+ '(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB).]' \
1413+ '(--dockerport)--dockerport[host Docker port (forward to port 2376 in VM). (deprecated - use with care)]' \
1414+ '(--driver)--driver[hypervisor driver.]' \
1415+ '(--force-upgrade-download)--force-upgrade-download[always download on boot2docker upgrade, never skip.]' \
1416+ '(--hostip)--hostip[VirtualBox host-only network IP address.]' \
1417+ '(--iso)--iso[path to boot2docker ISO image.]' \
1418+ '(--iso-url)--iso-url[/api.github.com/repos/boot2docker/boot2docker/releases": source URL to provision the boot2docker ISO image.]' \
1419+ '(--lowerip)--lowerip[VirtualBox host-only network DHCP lower bound.]' \
1420+ '(--memory)'{-m,--memory}'[virtual machine memory size (in MB).]' \
1421+ '(--netmask)--netmask[VirtualBox host-only network mask.]' \
1422+ '(--no-dummy)--no-dummy[Example parameter for the dummy driver.]' \
1423+ '(--retries)--retries[number of port knocking retries during 'start']' \
1424+ '(--serial)--serial[try serial console to get IP address (experimental)]' \
1425+ '(--serialfile)--serialfile[path to the serial socket/pipe.]' \
1426+ '(--ssh)--ssh[path to SSH client utility.]' \
1427+ '(--ssh-keygen)--ssh-keygen[path to ssh-keygen utility.]' \
1428+ '(--sshkey)--sshkey[path to SSH key to use.]' \
1429+ '(--sshport)--sshport[host SSH port (forward to port 22 in VM).]' \
1430+ '(--upperip)--upperip[VirtualBox host-only network DHCP upper bound.]' \
1431+ '(--vbm)--vbm[path to VirtualBox management utility.]' \
1432diff --git a/plugins/bower/_bower b/plugins/bower/_bower
1433index 9eb3bb557c261e27d853c68e5a396e5ad4bc0596..4c99a383ae237077bf0a5f9241a6aa7fddba2ee7 100644
1434--- a/plugins/bower/_bower
1435+++ b/plugins/bower/_bower
1436@@ -19,56 +19,47 @@ _brew_outdated_formulae() {
1437 outdated_formulae=(`brew outdated`)
1438 }
1439
1440-_brew_running_services() {
1441- running_services=(`brew services list | awk '{print $1}'`)
1442-}
1443-
1444 local -a _1st_arguments
1445 _1st_arguments=(
1446 'audit:check formulae for Homebrew coding style'
1447- 'bundle:look for a Brewfile and run each line as a brew command'
1448 'cat:display formula file for a formula'
1449 'cleanup:uninstall unused and old versions of packages'
1450 'commands:show a list of commands'
1451 'create:create a new formula'
1452- 'deps:list dependencies and dependants of a formula'
1453+ 'deps:list dependencies of a formula'
1454 'doctor:audits your installation for common issues'
1455 'edit:edit a formula'
1456+ 'fetch:download formula resources to the cache'
1457+ 'gist-logs:generate a gist of the full build logs'
1458 'home:visit the homepage of a formula or the brew project'
1459 'info:information about a formula'
1460 'install:install a formula'
1461 'reinstall:install a formula anew; re-using its current options'
1462+ 'leaves:show installed formulae that are not dependencies of another installed formula'
1463 'link:link a formula'
1464 'list:list files in a formula or not-installed formulae'
1465 'log:git commit log for a formula'
1466 'missing:check all installed formuale for missing dependencies.'
1467 'outdated:list formulae for which a newer version is available'
1468 'pin:pin specified formulae'
1469+ 'postinstall:perform post_install for a given formula'
1470 'prune:remove dead links'
1471 'remove:remove a formula'
1472 'search:search for a formula (/regex/ or string)'
1473- 'server:start a local web app that lets you browse formulae (requires Sinatra)'
1474- 'services:small wrapper around `launchctl` for supported formulae'
1475+ 'switch:switch linkage between installed versions of a formula'
1476 'tap:tap a new formula repository from GitHub, or list existing taps'
1477+ 'test-bot:test a formula and build a bottle'
1478+ 'uninstall:uninstall a formula'
1479 'unlink:unlink a formula'
1480 'unpin:unpin specified formulae'
1481 'untap:remove a tapped repository'
1482- 'update:freshen up links'
1483+ 'update:pull latest repository'
1484 'upgrade:upgrade outdated formulae'
1485 'uses:show formulae which depend on a formula'
1486 )
1487
1488-local -a _service_arguments
1489-_service_arguments=(
1490- 'cleanup:get rid of stale services and unused plists'
1491- 'list:list all services managed by `brew services`'
1492- 'restart:gracefully restart selected service'
1493- 'start:start selected service'
1494- 'stop:stop selected service'
1495-)
1496-
1497 local expl
1498-local -a formulae installed_formulae installed_taps outdated_formulae running_services
1499+local -a formulae installed_formulae installed_taps outdated_formulae
1500
1501 _arguments \
1502 '(-v)-v[verbose]' \
1503@@ -79,6 +70,7 @@ _arguments \
1504 '(--version)--version[version information]' \
1505 '(--prefix)--prefix[where brew lives on this system]' \
1506 '(--cache)--cache[brew cache]' \
1507+ '(--force)--force[brew force]' \
1508 '*:: :->subcmds' && return 0
1509
1510 if (( CURRENT == 1 )); then
1511@@ -108,16 +100,6 @@ case "$words[1]" in
1512 _arguments \
1513 '(--macports)--macports[search the macports repository]' \
1514 '(--fink)--fink[search the fink repository]' ;;
1515- services)
1516- if [[ -n "$words[2]" ]]; then
1517- case "$words[2]" in
1518- restart|start|stop)
1519- _brew_running_services
1520- _wanted running_services expl 'running services' compadd -a running_services ;;
1521- esac
1522- else
1523- _describe -t commands "brew services subcommand" _service_arguments
1524- fi ;;
1525 untap)
1526 _brew_installed_taps
1527 _wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
1528diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
1529index c2e95884e96fd6bb5faba415ebdbe6e9b11153f0..5b5847328bb60cbb0ddc4991855b58fe4af05f96 100644
1530--- a/plugins/brew/brew.plugin.zsh
1531+++ b/plugins/brew/brew.plugin.zsh
1532@@ -1 +1,4 @@
1533 alias brews='brew list -1'
1534+alias bubo='brew update && brew outdated'
1535+alias bubc='brew upgrade && brew cleanup'
1536+alias bubu='bubo && bubc'
1537diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
1538new file mode 100644
1539index 0000000000000000000000000000000000000000..edd95ccc23a37bf04bf46930c080fd4c5a40d985
1540--- /dev/null
1541+++ b/plugins/bundler/README.md
1542@@ -0,0 +1,49 @@
1543+# Bundler
1544+
1545+- adds completion for basic bundler commands
1546+- adds short aliases for common bundler commands
1547+ - `be` aliased to `bundle exec`
1548+ - `bl` aliased to `bundle list`
1549+ - `bp` aliased to `bundle package`
1550+ - `bo` aliased to `bundle open`
1551+ - `bu` aliased to `bundle update`
1552+ - `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
1553+- adds a wrapper for common gems:
1554+ - looks for a binstub under `./bin/` and executes it (if present)
1555+ - calls `bundle exec <gem executable>` otherwise
1556+
1557+For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
1558+
1559+## Configuration
1560+
1561+Please use the exact name of the executable and not the gem name.
1562+
1563+### Add additional gems to be wrapped
1564+
1565+Add this before the plugin-list in your `.zshrc`:
1566+```sh
1567+BUNDLED_COMMANDS=(rubocop)
1568+plugins=(... bundler ...)
1569+```
1570+This will add the wrapper for the `rubocop` gem (i.e. the executable).
1571+
1572+
1573+### Exclude gems from being wrapped
1574+
1575+Add this before the plugin-list in your `.zshrc`:
1576+```sh
1577+UNBUNDLED_COMMANDS=(foreman spin)
1578+plugins=(... bundler ...)
1579+```
1580+This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped.
1581+
1582+## Excluded gems
1583+
1584+These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification.
1585+
1586+`berks`
1587+`foreman`
1588+`mailcatcher`
1589+`rails`
1590+`ruby`
1591+`spin`
1592diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
1593index 2ec3a5f9c7c97ea821c3ec6ac4e57108b8cc923d..ba647ab80a2abaf31724a9fdb8db0b0a8e769f63 100644
1594--- a/plugins/bundler/_bundler
1595+++ b/plugins/bundler/_bundler
1596@@ -18,11 +18,13 @@ case $state in
1597 "check[Determine whether the requirements for your application are installed]" \
1598 "list[Show all of the gems in the current bundle]" \
1599 "show[Show the source location of a particular gem in the bundle]" \
1600+ "outdated[Show all of the outdated gems in the current bundle]" \
1601 "console[Start an IRB session in the context of the current bundle]" \
1602 "open[Open an installed gem in the editor]" \
1603 "viz[Generate a visual representation of your dependencies]" \
1604 "init[Generate a simple Gemfile, placed in the current directory]" \
1605 "gem[Create a simple gem, suitable for development with bundler]" \
1606+ "platform[Displays platform compatibility information]" \
1607 "clean[Cleans up unused gems in your bundler directory]" \
1608 "help[Describe available tasks or one specific task]"
1609 ret=0
1610@@ -39,11 +41,13 @@ case $state in
1611 'check' \
1612 'list' \
1613 'show' \
1614+ 'outdated' \
1615 'console' \
1616 'open' \
1617 'viz' \
1618 'init' \
1619 'gem' \
1620+ 'platform' \
1621 'help' && ret=0
1622 ;;
1623 install)
1624@@ -71,6 +75,15 @@ case $state in
1625 '(--verbose)--verbose[Enable verbose output mode]'
1626 ret=0
1627 ;;
1628+ outdated)
1629+ _arguments \
1630+ '(--pre)--pre[Check for newer pre-release gems]' \
1631+ '(--source)--source[Check against a specific source]' \
1632+ '(--local)--local[Do not attempt to fetch gems remotely and use the gem cache instead]' \
1633+ '(--no-color)--no-color[Disable colorization in output]' \
1634+ '(--verbose)--verbose[Enable verbose output mode]'
1635+ ret=0
1636+ ;;
1637 (open|show)
1638 _gems=( $(bundle show 2> /dev/null | sed -e '/^ \*/!d; s/^ \* \([^ ]*\) .*/\1/') )
1639 if [[ $_gems != "" ]]; then
1640diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
1641index 3338d78bec588a6465a5b6c24518c1184c212bd6..dfff6956e8be91232dcdcfee1b239abf7316e60a 100644
1642--- a/plugins/bundler/bundler.plugin.zsh
1643+++ b/plugins/bundler/bundler.plugin.zsh
1644@@ -3,23 +3,59 @@ alias bl="bundle list"
1645 alias bp="bundle package"
1646 alias bo="bundle open"
1647 alias bu="bundle update"
1648+alias bi="bundle_install"
1649+alias bcn="bundle clean"
1650
1651-# The following is based on https://github.com/gma/bundler-exec
1652-
1653-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 strainer tailor taps thin thor unicorn unicorn_rails)
1654+bundled_commands=(
1655+ annotate
1656+ cap
1657+ capify
1658+ cucumber
1659+ foodcritic
1660+ guard
1661+ irb
1662+ jekyll
1663+ kitchen
1664+ knife
1665+ middleman
1666+ nanoc
1667+ pry
1668+ puma
1669+ rackup
1670+ rainbows
1671+ rake
1672+ rspec
1673+ shotgun
1674+ sidekiq
1675+ spec
1676+ spork
1677+ spring
1678+ strainer
1679+ tailor
1680+ taps
1681+ thin
1682+ thor
1683+ unicorn
1684+ unicorn_rails
1685+)
1686
1687 # Remove $UNBUNDLED_COMMANDS from the bundled_commands list
1688 for cmd in $UNBUNDLED_COMMANDS; do
1689 bundled_commands=(${bundled_commands#$cmd});
1690 done
1691
1692+# Add $BUNDLED_COMMANDS to the bundled_commands list
1693+for cmd in $BUNDLED_COMMANDS; do
1694+ bundled_commands+=($cmd);
1695+done
1696+
1697 ## Functions
1698
1699-bi() {
1700+bundle_install() {
1701 if _bundler-installed && _within-bundled-project; then
1702 local bundler_version=`bundle version | cut -d' ' -f3`
1703 if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
1704- if [[ "$(uname)" == 'Darwin' ]]
1705+ if [[ "$OSTYPE" = darwin* ]]
1706 then
1707 local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
1708 else
1709@@ -39,17 +75,25 @@ _bundler-installed() {
1710 }
1711
1712 _within-bundled-project() {
1713- local check_dir=$PWD
1714- while [ $check_dir != "/" ]; do
1715+ local check_dir="$PWD"
1716+ while [ "$check_dir" != "/" ]; do
1717 [ -f "$check_dir/Gemfile" ] && return
1718 check_dir="$(dirname $check_dir)"
1719 done
1720 false
1721 }
1722
1723+_binstubbed() {
1724+ [ -f "./bin/${1}" ]
1725+}
1726+
1727 _run-with-bundler() {
1728 if _bundler-installed && _within-bundled-project; then
1729- bundle exec $@
1730+ if _binstubbed $1; then
1731+ ./bin/$@
1732+ else
1733+ bundle exec $@
1734+ fi
1735 else
1736 $@
1737 fi
1738@@ -62,7 +106,6 @@ for cmd in $bundled_commands; do
1739 alias $cmd=bundled_$cmd
1740
1741 if which _$cmd > /dev/null 2>&1; then
1742- compdef _$cmd bundled_$cmd=$cmd
1743+ compdef _$cmd bundled_$cmd=$cmd
1744diff --git a/plugins/cabal/cabal.plugin.zsh b/plugins/cabal/cabal.plugin.zsh
1745index 9f76add7a30a791add54a4b5af864b4d18172262..a9a05b01245e67dd554d0ff1af87092a7f4967bc 100644
1746--- a/plugins/cabal/cabal.plugin.zsh
1747+++ b/plugins/cabal/cabal.plugin.zsh
1748@@ -17,13 +17,16 @@ function _cabal_commands() {
1749 subcommand)
1750 subcommands=(
1751 "bench:Run the benchmark, if any (configure with UserHooks)"
1752- "build:Make this package ready for installation"
1753+ "build:Compile all targets or specific target."
1754 "check:Check the package for common mistakes"
1755 "clean:Clean up after a build"
1756- "copy:Copy teh files into the install locations"
1757+ "copy:Copy the files into the install locations"
1758 "configure:Prepare to build the package"
1759+ "exec:Run a command with the cabal environment"
1760 "fetch:Downloads packages for later installation"
1761- "haddock:Generate HAddock HTML documentation"
1762+ "freeze:Freeze dependencies."
1763+ "get:Gets a package's source code"
1764+ "haddock:Generate Haddock HTML documentation"
1765 "help:Help about commands"
1766 "hscolour:Generate HsColour colourised code, in HTML format"
1767 "info:Display detailed information about a particular package"
1768@@ -31,7 +34,10 @@ function _cabal_commands() {
1769 "install:Installs a list of packages"
1770 "list:List packages matching a search string"
1771 "register:Register this package with the compiler"
1772+ "repl:Open an interpreter session for the given target"
1773 "report:Upload build reports to a remote server"
1774+ "run:Runs the compiled executable"
1775+ "sandbox:Create/modify/delete a sandbox"
1776 "sdist:Generate a source distribution file (.tar.gz)"
1777 "test:Run the test suite, if any (configure with UserHooks)"
1778 "unpack:Unpacks packages for user inspection"
1779@@ -45,3 +51,43 @@ function _cabal_commands() {
1780 }
1781
1782 compdef _cabal_commands cabal
1783+
1784+function _cab_commands() {
1785+ local ret=1 state
1786+ _arguments ':subcommand:->subcommand' && ret=0
1787+
1788+ case $state in
1789+ subcommand)
1790+ subcommands=(
1791+ "sync:Fetch the latest package index"
1792+ "install:Install packages"
1793+ "uninstall:Uninstall packages"
1794+ "installed:List installed packages"
1795+ "configure:Configure a cabal package"
1796+ "build:Build a cabal package"
1797+ "clean:Clean up a build directory"
1798+ "outdated:Display outdated packages"
1799+ "info:Display information of a package"
1800+ "sdist:Make tar.gz for source distribution"
1801+ "upload:Uploading tar.gz to HackageDB"
1802+ "get:Untar a package in the current directory"
1803+ "deps:Show dependencies of this package"
1804+ "revdeps:Show reverse dependencies of this package"
1805+ "check:Check consistency of packages"
1806+ "genpaths:Generate Paths_<pkg>.hs"
1807+ "search:Search available packages by package name"
1808+ "add:Add a source directory"
1809+ "test:Run tests"
1810+ "bench:Run benchmarks"
1811+ "doc:Generate manuals"
1812+ "ghci:Run GHCi (with a sandbox)"
1813+ "init:Initialize a sandbox"
1814+ "help:Display the help message of the command"
1815+ )
1816+ _describe -t subcommands 'cab subcommands' subcommands && ret=0
1817+ esac
1818+
1819+ return ret
1820+}
1821+
1822+command -v cab >/dev/null 2>&1 && { compdef _cab_commands cab }
1823diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
1824index 44cc47470200264729bd9e8d745683aa80037344..2370df9493238f90249cb63473a29783fc981c3d 100644
1825--- a/plugins/cake/cake.plugin.zsh
1826+++ b/plugins/cake/cake.plugin.zsh
1827@@ -15,7 +15,7 @@ _cake_does_target_list_need_generating () {
1828 fi
1829
1830 [ ! -f ${_cake_task_cache_file} ] && return 0;
1831- [ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
1832+ [ Cakefile -nt ${_cake_task_cache_file} ] && return 0;
1833 return 1;
1834 }
1835
1836diff --git a/plugins/cakephp3/cakephp3.plugin.zsh b/plugins/cakephp3/cakephp3.plugin.zsh
1837new file mode 100644
1838index 0000000000000000000000000000000000000000..28d5af2ea5c1a3bfd418850ab0c0508776f80558
1839--- /dev/null
1840+++ b/plugins/cakephp3/cakephp3.plugin.zsh
1841@@ -0,0 +1,19 @@
1842+# CakePHP 3 basic command completion
1843+_cakephp3_get_command_list () {
1844+ cakephp3commands=($(bin/cake completion commands));printf "%s\n" "${cakephp3commands[@]}"
1845+}
1846+
1847+_cakephp3 () {
1848+ if [ -f bin/cake ]; then
1849+ compadd `_cakephp3_get_command_list`
1850+ fi
1851+}
1852+
1853+compdef _cakephp3 bin/cake
1854+compdef _cakephp3 cake
1855+
1856+#Alias
1857+alias c3='bin/cake'
1858+
1859+alias c3cache='bin/cake orm_cache clear'
1860+alias c3migrate='bin/cake migrations migrate'
1861diff --git a/plugins/cask/cask.plugin.zsh b/plugins/cask/cask.plugin.zsh
1862new file mode 100644
1863index 0000000000000000000000000000000000000000..c558629243d2274d8c380bc807f08d5f53690824
1864--- /dev/null
1865+++ b/plugins/cask/cask.plugin.zsh
1866@@ -0,0 +1,5 @@
1867+if which cask &> /dev/null; then
1868+ source $(dirname $(which cask))/../etc/cask_completion.zsh
1869+else
1870+ print "zsh cask plugin: cask not found"
1871+fi
1872diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
1873index 2a2c80cf67e637fada84a931134debb3e5f1df15..b461b0c9be7d5b39a27ebc7d646e93434e57e15a 100644
1874--- a/plugins/chruby/chruby.plugin.zsh
1875+++ b/plugins/chruby/chruby.plugin.zsh
1876@@ -24,7 +24,7 @@ _homebrew-installed() {
1877 }
1878
1879 _chruby-from-homebrew-installed() {
1880- brew --prefix chruby &> /dev/null
1881+ [ -r $(brew --prefix chruby)] &> /dev/null
1882 }
1883
1884 _ruby-build_installed() {
1885@@ -45,11 +45,11 @@ _source_from_omz_settings() {
1886 zstyle -s :omz:plugins:chruby path _chruby_path
1887 zstyle -s :omz:plugins:chruby auto _chruby_auto
1888
1889- if _chruby_path && [[ -r _chruby_path ]]; then
1890+ if ${_chruby_path} && [[ -r ${_chruby_path} ]]; then
1891 source ${_chruby_path}
1892 fi
1893
1894- if _chruby_auto && [[ -r _chruby_auto ]]; then
1895+ if ${_chruby_auto} && [[ -r ${_chruby_auto} ]]; then
1896 source ${_chruby_auto}
1897 fi
1898 }
1899diff --git a/plugins/chucknorris/.gitignore b/plugins/chucknorris/.gitignore
1900new file mode 100644
1901index 0000000000000000000000000000000000000000..267c504a61c5520e92c975758f5a61674e41020c
1902--- /dev/null
1903+++ b/plugins/chucknorris/.gitignore
1904@@ -0,0 +1 @@
1905+fortunes/chucknorris.dat
1906diff --git a/plugins/chucknorris/LICENSE b/plugins/chucknorris/LICENSE
1907new file mode 100644
1908index 0000000000000000000000000000000000000000..5f40edd1ef61de7e43ddbc61ef2d78b3e1ad0cf6
1909--- /dev/null
1910+++ b/plugins/chucknorris/LICENSE
1911@@ -0,0 +1,2 @@
1912+License: GPL v2
1913+Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.
1914diff --git a/plugins/chucknorris/chucknorris.plugin.zsh b/plugins/chucknorris/chucknorris.plugin.zsh
1915new file mode 100644
1916index 0000000000000000000000000000000000000000..09636463350cf2b7a7e5b351d3a56c7992e9a574
1917--- /dev/null
1918+++ b/plugins/chucknorris/chucknorris.plugin.zsh
1919@@ -0,0 +1,6 @@
1920+if [ ! -f $ZSH/plugins/chucknorris/fortunes/chucknorris.dat ]; then
1921+ strfile $ZSH/plugins/chucknorris/fortunes/chucknorris $ZSH/plugins/chucknorris/fortunes/chucknorris.dat
1922+fi
1923+
1924+alias chuck="fortune -a $ZSH/plugins/chucknorris/fortunes"
1925+alias chuck_cow="chuck | cowthink"
1926diff --git a/plugins/chucknorris/fortunes/chucknorris b/plugins/chucknorris/fortunes/chucknorris
1927new file mode 100644
1928index 0000000000000000000000000000000000000000..b8edf9ac388069ead3d05b06d0d33a283d3e0942
1929--- /dev/null
1930+++ b/plugins/chucknorris/fortunes/chucknorris
1931@@ -0,0 +1,904 @@
1932+Chuck Norris' tears cure cancer. Too bad he has never cried. Ever.
1933+%
1934+Chuck Norris does not sleep. He waits.
1935+%
1936+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
1937+%
1938+The chief export of Chuck Norris is pain.
1939+%
1940+If you can see Chuck Norris, he can see you. If you can't see Chuck Norris, you may be only seconds away from death.
1941+%
1942+Chuck Norris has counted to infinity. Twice.
1943+%
1944+Chuck Norris does not hunt because the word hunting implies the probability of failure. Chuck Norris goes killing.
1945+%
1946+Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only with heavy construction equipment, tanks, and fighter jets.
1947+%
1948+Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
1949+%
1950+In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.
1951+There is no chin behind Chuck Norris' beard. There is only another fist.
1952+%
1953+Chuck Norris does not teabag the ladies. He potato-sacks them.
1954+Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face.
1955+%
1956+When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.
1957+%
1958+There are no steroids in baseball. Just players Chuck Norris has breathed on.
1959+%
1960+Chuck Norris once challenged Lance Armstrong in a "Who has more testicles?" contest. Chuck Norris won by 5.
1961+%
1962diff --git a/plugins/coffee/README.md b/plugins/coffee/README.md
1963new file mode 100644
1964index 0000000000000000000000000000000000000000..d0e7bbe74b59716d99bdd103c7f229d8b1119ebb
1965--- /dev/null
1966+++ b/plugins/coffee/README.md
1967@@ -0,0 +1,31 @@
1968+## Coffeescript Plugin
1969+
1970+This plugin provides aliases for quickly compiling and previewing your
1971+cofeescript code.
1972+
1973+When writing Coffeescript it's very common to want to preview the output of a
1974+certain snippet of code, either because you want to test the output or because
1975+you'd like to execute it in a browser console which doesn't accept Coffeescript.
1976+
1977+Preview the compiled result of your coffeescript with `cf "code"` as per the
1978+following:
1979+
1980+```zsh
1981+$ cf 'if a then be else c'
1982+if (a) {
1983+ b;
1984+} else {
1985+ c;
1986+}
1987+```
1988+
1989+Also provides the following aliases:
1990+
1991+* **cfc:** Copies the compiled JS to your clipboard. Very useful when you want
1992+ to run the code in a JS console.
1993+
1994+* **cfp:** Compiles from your currently copied clipboard. Useful when you want
1995+ to compile large/multi-line snippets
1996+
1997+* **cfpc:** Paste coffeescript from clipboard, compile to JS, then copy the
1998+ the result back to clipboard.