8c95c52353118643ac3dbd9b0c185a3129b84bf8
- Author
- Kozlov Alexander <badryke@gmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/LICENSE.txt b/LICENSE.txt
2index ed0ae75fcc002fba34dc28521bb388847dd11ffa..7af38f21746237dc2d9f0d8c1fd2994dd9c93fc6 100644
3--- a/LICENSE.txt
4+++ b/LICENSE.txt
5@@ -1,6 +1,6 @@
6 The MIT License (MIT)
7
8-Copyright (c) 2009-2017 Robby Russell and contributors
9+Copyright (c) 2009-2018 Robby Russell and contributors
10 See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors
11
12 Permission is hereby granted, free of charge, to any person obtaining a copy
13diff --git a/README.md b/README.md
14index 541f48d405eb617a92e7d7b396afd4dc2c634605..b3651a99cfa6d4d43b833eeadb160c0f4abdddf0 100644
15--- a/README.md
16+++ b/README.md
17@@ -2,7 +2,7 @@
18 <img src="https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png" alt="Oh My Zsh">
19 </p>
20
21-Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration.
22+Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
23
24 Sounds boring. Let's try again.
25
26@@ -12,7 +12,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo
27
28 Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬
29
30-To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
31+To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
32
33 ## Getting Started
34
35@@ -21,7 +21,7 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t
36 __Disclaimer:__ _Oh My Zsh works best on macOS and Linux._
37
38 * Unix-like operating system (macOS or Linux)
39-* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
40+* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
41 * `curl` or `wget` should be installed
42 * `git` should be installed
43
44@@ -141,7 +141,7 @@ export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubus
45 ##### 1. Clone the repository:
46
47 ```shell
48-git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
49+git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
50 ```
51
52 ##### 2. *Optionally*, backup your existing `~/.zshrc` file:
53@@ -215,7 +215,7 @@ If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the co
54
55 ## Contributing
56
57-I'm far from being a [Zsh](http://www.zsh.org/) 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!
58+I'm far from being a [Zsh](https://www.zsh.org/) 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!
59
60 We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can.
61
62@@ -238,7 +238,7 @@ We're on the social media.
63
64 ## Merchandise
65
66diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme
67new file mode 100644
68index 0000000000000000000000000000000000000000..ef8f1c630b7c39783a3f65ff17678cfba81c932d
69--- /dev/null
70+++ b/custom/themes/example.zsh-theme
71@@ -0,0 +1,4 @@
72+# Put your custom themes in this folder.
73+# Example:
74+
75+PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
76diff --git a/lib/compfix.zsh b/lib/compfix.zsh
77index 208aaadb1ebad0e25ebdef29192da815be8136bd..68decc1ed4d6fc5b51476fc9224f0d0171e96804 100644
78--- a/lib/compfix.zsh
79+++ b/lib/compfix.zsh
80@@ -2,10 +2,6 @@
81 # insecure ownership or permissions) by:
82 #
83 # * Human-readably notifying the user of these insecurities.
84-# * Moving away all existing completion caches to a temporary directory. Since
85-# any of these caches may have been generated from insecure directories, they
86-# are all suspect now. Failing to do so typically causes subsequent compinit()
87-# calls to fail with "command not found: compdef" errors. (That's bad.)
88 function handle_completion_insecurities() {
89 # List of the absolute paths of all unique insecure directories, split on
90 # newline from compaudit()'s output resembling:
91@@ -22,39 +18,27 @@ function handle_completion_insecurities() {
92 insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
93
94 # If no such directories exist, get us out of here.
95- if (( ! ${#insecure_dirs} )); then
96- print "[oh-my-zsh] No insecure completion-dependent directories detected."
97- return
98- fi
99+ (( ! ${#insecure_dirs} )) && return
100
101 # List ownership and permissions of all insecure directories.
102 print "[oh-my-zsh] Insecure completion-dependent directories detected:"
103 ls -ld "${(@)insecure_dirs}"
104- print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
105- print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
106- print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
107
108- # Locally enable the "NULL_GLOB" option, thus removing unmatched filename
109- # globs from argument lists *AND* printing no warning when doing so. Failing
110- # to do so prints an unreadable warning if no completion caches exist below.
111- setopt local_options null_glob
112+ cat <<EOD
113
114- # List of the absolute paths of all unique existing completion caches.
115- local -aU zcompdump_files
116- zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
117+[oh-my-zsh] For safety, we will not load completions from these directories until
118+[oh-my-zsh] you fix their permissions and ownership and restart zsh.
119+[oh-my-zsh] See the above list for directories with group or other writability.
120
121- # Move such caches to a temporary directory.
122- if (( ${#zcompdump_files} )); then
123- # Absolute path of the directory to which such files will be moved.
124- local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
125+[oh-my-zsh] To fix your permissions you can do so by disabling
126+[oh-my-zsh] the write permission of "group" and "others" and making sure that the
127+[oh-my-zsh] owner of these directories is either root or your current user.
128+[oh-my-zsh] The following command may help:
129+[oh-my-zsh] compaudit | xargs chmod g-w,o-w
130
131- # List such files first.
132- print "[oh-my-zsh] Insecure completion caches also detected:"
133- ls -l "${(@)zcompdump_files}"
134+[oh-my-zsh] If the above didn't help or you want to skip the verification of
135+[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
136+[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
137
138- # For safety, move rather than permanently remove such files.
139- print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
140- mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
141- mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
142- fi
143+EOD
144 }
145diff --git a/lib/completion.zsh b/lib/completion.zsh
146index a1e934315f66c290c04f203f890bd1b97e6cd728..c7db2eb7b20abde827d46858e03d3b8f87b9957a 100644
147--- a/lib/completion.zsh
148+++ b/lib/completion.zsh
149@@ -25,6 +25,9 @@ else
150 fi
151 unset CASE_SENSITIVE HYPHEN_INSENSITIVE
152
153+# Complete . and .. special directories
154+zstyle ':completion:*' special-dirs true
155+
156 zstyle ':completion:*' list-colors ''
157 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
158
159diff --git a/lib/correction.zsh b/lib/correction.zsh
160index 3e1415a0ba840c1298e583c66c87eb2d6bb5f9ae..c635236b5b06f31d523849a0756f06b9aed65704 100644
161--- a/lib/correction.zsh
162+++ b/lib/correction.zsh
163@@ -1,4 +1,5 @@
164 if [[ "$ENABLE_CORRECTION" == "true" ]]; then
165+ alias cp='nocorrect cp'
166 alias ebuild='nocorrect ebuild'
167 alias gist='nocorrect gist'
168 alias heroku='nocorrect heroku'
169diff --git a/lib/directories.zsh b/lib/directories.zsh
170index a50a692c8abaff1a94afff1c6ecf1c14e0cd8197..14064b86f28fc8f8d180b8e8b465c276ff172c70 100644
171--- a/lib/directories.zsh
172+++ b/lib/directories.zsh
173@@ -28,7 +28,3 @@ alias lsa='ls -lah'
174 alias l='ls -lah'
175 alias ll='ls -lh'
176 alias la='ls -lAh'
177-
178-# Push and pop directories on directory stack
179-alias pu='pushd'
180-alias po='popd'
181diff --git a/lib/functions.zsh b/lib/functions.zsh
182index f306537846c9662462c127dc61018dfb58bbaa5f..4ef8920f60ef6017ffe3dcb6ed4b90db675f9dbb 100644
183--- a/lib/functions.zsh
184+++ b/lib/functions.zsh
185@@ -11,21 +11,20 @@ function upgrade_oh_my_zsh() {
186 }
187
188 function take() {
189- mkdir -p $1
190- cd $1
191+ mkdir -p $@ && cd ${@:$#}
192 }
193
194 function open_command() {
195- emulate -L zsh
196- setopt shwordsplit
197-
198 local open_cmd
199
200 # define the open command
201 case "$OSTYPE" in
202 darwin*) open_cmd='open' ;;
203 cygwin*) open_cmd='cygstart' ;;
204- linux*) open_cmd='xdg-open' ;;
205+ linux*) ! [[ $(uname -a) =~ "Microsoft" ]] && open_cmd='xdg-open' || {
206+ open_cmd='cmd.exe /c start ""'
207+ [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 }
208+ } ;;
209 msys*) open_cmd='start ""' ;;
210 *) echo "Platform $OSTYPE not supported"
211 return 1
212@@ -34,9 +33,9 @@ function open_command() {
213
214 # don't use nohup on OSX
215 if [[ "$OSTYPE" == darwin* ]]; then
216- $open_cmd "$@" &>/dev/null
217+ ${=open_cmd} "$@" &>/dev/null
218 else
219- nohup $open_cmd "$@" &>/dev/null
220+ nohup ${=open_cmd} "$@" &>/dev/null
221 fi
222 }
223
224@@ -52,8 +51,7 @@ function open_command() {
225 # 1 if it does not exist
226 #
227 function alias_value() {
228- alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
229- test $(alias "$1")
230+ (( $+aliases[$1] )) && echo $aliases[$1]
231 }
232
233 #
234diff --git a/lib/git.zsh b/lib/git.zsh
235index 167b4b0eae639fca500d973210320bf5647ab177..b92373153cef764f2c35ded0bc9bfdda57566ce8 100644
236--- a/lib/git.zsh
237+++ b/lib/git.zsh
238@@ -77,8 +77,8 @@ function git_current_branch() {
239 # Gets the number of commits ahead from remote
240 function git_commits_ahead() {
241 if command git rev-parse --git-dir &>/dev/null; then
242- local commits="$(git rev-list --count @{upstream}..HEAD)"
243- if [[ "$commits" != 0 ]]; then
244+ local commits="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
245+ if [[ -n "$commits" && "$commits" != 0 ]]; then
246 echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
247 fi
248 fi
249@@ -87,8 +87,8 @@ function git_commits_ahead() {
250 # Gets the number of commits behind remote
251 function git_commits_behind() {
252 if command git rev-parse --git-dir &>/dev/null; then
253- local commits="$(git rev-list --count HEAD..@{upstream})"
254- if [[ "$commits" != 0 ]]; then
255+ local commits="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
256+ if [[ -n "$commits" && "$commits" != 0 ]]; then
257 echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
258 fi
259 fi
260@@ -141,11 +141,15 @@ function git_prompt_status() {
261 STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
262 elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
263 STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
264+ elif $(echo "$INDEX" | grep '^MM ' &> /dev/null); then
265+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
266 fi
267 if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
268 STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
269 elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
270 STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
271+ elif $(echo "$INDEX" | grep '^MM ' &> /dev/null); then
272+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
273 elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
274 STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
275 fi
276@@ -181,7 +185,7 @@ function git_prompt_status() {
277 # Outputs -1, 0, or 1 if the installed version is less than, equal to, or
278 # greater than the input version, respectively.
279 function git_compare_version() {
280- local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
281+ local INPUT_GIT_VERSION INSTALLED_GIT_VERSION i
282 INPUT_GIT_VERSION=(${(s/./)1})
283 INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
284 INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
285diff --git a/lib/history.zsh b/lib/history.zsh
286index 5de71c2d3e0fdd0296cc8d46da9fbd1724fd7a00..d8bbd41c448563b7ad67cc1741c90eec9c121165 100644
287--- a/lib/history.zsh
288+++ b/lib/history.zsh
289@@ -1,24 +1,40 @@
290-## Command history configuration
291-if [ -z "$HISTFILE" ]; then
292- HISTFILE=$HOME/.zsh_history
293-fi
294+## History wrapper
295+function omz_history {
296+ local clear list
297+ zparseopts -E c=clear l=list
298
299-HISTSIZE=10000
300-SAVEHIST=10000
301+ if [[ -n "$clear" ]]; then
302+ # if -c provided, clobber the history file
303+ echo -n >| "$HISTFILE"
304+ echo >&2 History file deleted. Reload the session to see its effects.
305+ elif [[ -n "$list" ]]; then
306+ # if -l provided, run as if calling `fc' directly
307+ builtin fc "$@"
308+ else
309+ # unless a number is provided, show all history events (starting from 1)
310+ [[ ${@[-1]} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
311+ fi
312+}
313
314-# Show history
315+# Timestamp format
316 case $HIST_STAMPS in
317- "mm/dd/yyyy") alias history='fc -fl 1' ;;
318- "dd.mm.yyyy") alias history='fc -El 1' ;;
319- "yyyy-mm-dd") alias history='fc -il 1' ;;
320- *) alias history='fc -l 1' ;;
321+ "mm/dd/yyyy") alias history='omz_history -f' ;;
322+ "dd.mm.yyyy") alias history='omz_history -E' ;;
323+ "yyyy-mm-dd") alias history='omz_history -i' ;;
324+ "") alias history='omz_history' ;;
325+ *) alias history="omz_history -t '$HIST_STAMPS'" ;;
326 esac
327
328-setopt append_history
329-setopt extended_history
330-setopt hist_expire_dups_first
331-setopt hist_ignore_dups # ignore duplication command history list
332-setopt hist_ignore_space
333-setopt hist_verify
334-setopt inc_append_history
335-setopt share_history # share command history data
336+## History file configuration
337+[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
338+HISTSIZE=50000
339+SAVEHIST=10000
340+
341+## History command configuration
342+setopt extended_history # record timestamp of command in HISTFILE
343+setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
344+setopt hist_ignore_dups # ignore duplicated commands history list
345+setopt hist_ignore_space # ignore commands that start with space
346+setopt hist_verify # show command with history expansion to user before running it
347+setopt inc_append_history # add commands to HISTFILE in order of execution
348+setopt share_history # share command history data
349diff --git a/lib/misc.zsh b/lib/misc.zsh
350index 3052b77108ee5eb8bedc6b2a02f30c1e71ddfc0d..f45c1075790d0103a0291255ac232fbecee3cf14 100644
351--- a/lib/misc.zsh
352+++ b/lib/misc.zsh
353@@ -18,9 +18,8 @@ fi
354 ## jobs
355 setopt long_list_jobs
356
357-## pager
358-env_default PAGER 'less'
359-env_default LESS '-R'
360+env_default 'PAGER' 'less'
361+env_default 'LESS' '-R'
362
363 ## super user alias
364 alias _='sudo'
365diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
366index 335c02a3d03867efa8674d778189d82a377896c6..1d5c23e41815f2a51555f6fe84d63202fc5ed6e1 100644
367--- a/lib/prompt_info_functions.zsh
368+++ b/lib/prompt_info_functions.zsh
369@@ -12,7 +12,7 @@
370 # Real implementations will be used when the respective plugins are loaded
371 function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
372 rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
373- virtualenv_prompt_info {
374+ virtualenv_prompt_info jenv_prompt_info {
375 return 1
376 }
377
378diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh
379index 87092d8ae8b036c6105314b0669fe7accf2f671b..312ab22482176acf25bedd74276f6ce2f6048384 100644
380--- a/lib/spectrum.zsh
381+++ b/lib/spectrum.zsh
382@@ -1,7 +1,7 @@
383 #! /bin/zsh
384 # A script to make using 256 colors in zsh less painful.
385 # P.C. Shyamshankar <sykora@lucentbeing.com>
386-# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
387+# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
388
389 typeset -AHg FX FG BG
390
391diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
392index 871ab28dfa82f8c63d43538c64c18409b393c78b..87d55ee89983f7662549bfd035f9fabfb15225c5 100644
393--- a/lib/termsupport.zsh
394+++ b/lib/termsupport.zsh
395@@ -80,7 +80,7 @@ preexec_functions+=(omz_termsupport_preexec)
396
397
398 # Keep Apple Terminal.app's current working directory updated
399-# Based on this answer: http://superuser.com/a/315029
400+# Based on this answer: https://superuser.com/a/315029
401 # With extra fixes to handle multibyte chars and non-UTF-8 locales
402
403 if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
404diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
405index 7f78e4140da5ccae7094572ed34908e9359b571c..d7c68d35c7513f0beadb5ed39c50d1a6b82e4636 100644
406--- a/oh-my-zsh.sh
407+++ b/oh-my-zsh.sh
408@@ -1,6 +1,17 @@
409+# Set ZSH_CACHE_DIR to the path where cache files should be created
410+# or else we will use the default cache/
411+if [[ -z "$ZSH_CACHE_DIR" ]]; then
412+ ZSH_CACHE_DIR="$ZSH/cache"
413+fi
414+
415+# Migrate .zsh-update file to $ZSH_CACHE_DIR
416+if [ -f ~/.zsh-update ] && [ ! -f ${ZSH_CACHE_DIR}/.zsh-update ]; then
417+ mv ~/.zsh-update ${ZSH_CACHE_DIR}/.zsh-update
418+fi
419+
420 # Check for updates on initial load...
421 if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
422- env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
423+ env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
424 fi
425
426 # Initializes Oh My Zsh
427@@ -11,20 +22,12 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
428 # Load all stock functions (from $fpath files) called below.
429 autoload -U compaudit compinit
430
431-: ${ZSH_DISABLE_COMPFIX:=true}
432-
433 # Set ZSH_CUSTOM to the path where your custom config files
434 # and plugins exists, or else we will use the default custom/
435 if [[ -z "$ZSH_CUSTOM" ]]; then
436 ZSH_CUSTOM="$ZSH/custom"
437 fi
438
439-# Set ZSH_CACHE_DIR to the path where cache files should be created
440-# or else we will use the default cache/
441-if [[ -z "$ZSH_CACHE_DIR" ]]; then
442- ZSH_CACHE_DIR="$ZSH/cache"
443-fi
444-
445
446 # Load all of the config files in ~/oh-my-zsh that end in .zsh
447 # TIP: Add files you don't want in git to .gitignore
448@@ -65,16 +68,15 @@ if [ -z "$ZSH_COMPDUMP" ]; then
449 fi
450
451 if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
452- # If completion insecurities exist, warn the user without enabling completions.
453+ # If completion insecurities exist, warn the user
454 if ! compaudit &>/dev/null; then
455- # This function resides in the "lib/compfix.zsh" script sourced above.
456 handle_completion_insecurities
457- # Else, enable and cache completions to the desired file.
458- else
459- compinit -d "${ZSH_COMPDUMP}"
460 fi
461-else
462+ # Load only from secure directories
463 compinit -i -d "${ZSH_COMPDUMP}"
464+else
465+ # If the user wants it, load from all found directories
466+ compinit -u -d "${ZSH_COMPDUMP}"
467 fi
468
469 # Load all of the plugins that were defined in ~/.zshrc
470diff --git a/plugins/adb/_adb b/plugins/adb/_adb
471index 8cbf6593cc076325e85578f2e90f2417fdacf4b8..e3c20d75141d7674b6675047a94f491b0f83f5de 100644
472--- a/plugins/adb/_adb
473+++ b/plugins/adb/_adb
474@@ -48,8 +48,8 @@ _arguments \
475
476 case "$state" in
477 specify_device)
478- _values 'devices' $(adb devices -l|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \
479- {printf "%s[%s] ",$1,$6 }')
480+ _values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \
481+ {sub(/ +/," ",$0);gsub(":","\\:",$1); printf "%s[%s] ",$1, $NF}'):-""}
482 return
483 ;;
484 esac
485diff --git a/plugins/ant/README.md b/plugins/ant/README.md
486new file mode 100644
487index 0000000000000000000000000000000000000000..5f88984ac30a7607358d2fa12578d6a1e244d7eb
488--- /dev/null
489+++ b/plugins/ant/README.md
490@@ -0,0 +1,12 @@
491+# Ant
492+
493+This plugin provides completion for [Ant](https://ant.apache.org/).
494+
495+To use it add ant to the plugins array in your zshrc file.
496+
497+```bash
498+plugins=(... ant)
499+```
500+
501+It caches ant targets in a file named `.ant_targets`, you might want to add that to
502+your `.gitignore` file.
503diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
504index e408db13dabd93959e4ff423619062588adc416a..7ebe8e53d79cd42e1821fe4ffdbb018fcb70401c 100644
505--- a/plugins/archlinux/README.md
506+++ b/plugins/archlinux/README.md
507@@ -2,6 +2,51 @@
508
509 ## Features
510
511+#### YAY
512+
513+| Alias | Command | Description |
514+|---------|------------------------------------|---------------------------------------------------------------------|
515+| yaconf | yay -Pg | Print current configuration |
516+| yain | yay -S | Install packages from the repositories |
517+| yains | yay -U | Install a package from a local file |
518+| yainsd | yay -S --asdeps | Install packages as dependencies of another package |
519+| yaloc | yay -Qi | Display information about a package in the local database |
520+| yalocs | yay -Qs | Search for packages in the local database |
521+| yalst | yay -Qe | List installed packages including from AUR (tagged as "local") |
522+| yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist |
523+| yaorph | yay -Qtd | Remove orphans using yaourt |
524+| yare | yay -R | Remove packages, keeping its settings and dependencies |
525+| yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies |
526+| yarep | yay -Si | Display information about a package in the repositories |
527+| yareps | yay -Ss | Search for packages in the repositories |
528+| yaupg | yay -Syu | Sync with repositories before upgrading packages |
529+| yasu | yay -Syu --no-confirm | Same as `yaupg`, but without confirmation |
530+
531+#### TRIZEN
532+
533+| Alias | Command | Description |
534+|---------|------------------------------------|---------------------------------------------------------------------|
535+| trconf | trizen -C | Fix all configuration files with vimdiff |
536+| trin | trizen -S | Install packages from the repositories |
537+| trins | trizen -U | Install a package from a local file |
538+| trinsd | trizen -S --asdeps | Install packages as dependencies of another package |
539+| trloc | trizen -Qi | Display information about a package in the local database |
540+| trlocs | trizen -Qs | Search for packages in the local database |
541+| trlst | trizen -Qe | List installed packages including from AUR (tagged as "local") |
542+| trmir | trizen -Syy | Force refresh of all package lists after updating mirrorlist |
543+| trorph | trizen -Qtd | Remove orphans using yaourt |
544+| trre | trizen -R | Remove packages, keeping its settings and dependencies |
545+| trrem | trizen -Rns | Remove packages, including its settings and unneeded dependencies |
546+| trrep | trizen -Si | Display information about a package in the repositories |
547+| trreps | trizen -Ss | Search for packages in the repositories |
548+| trupd | trizen -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
549+| trupd | trizen -Sy && sudo abs | Update and refresh the local package and ABS databases |
550+| trupd | trizen -Sy && sudo aur | Update and refresh the local package and AUR databases |
551+| trupd | trizen -Sy | Update and refresh the local package database |
552+| trupg | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
553+| trsu | trizen -Syua --no-confirm | Same as `trupg`, but without confirmation |
554+| upgrade | trizen -Syu | Sync with repositories before upgrading packages |
555+
556 #### YAOURT
557
558 | Alias | Command | Description |
559@@ -27,7 +72,7 @@
560 | yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
561 | upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
562
563-### PACAUR
564+#### PACAUR
565
566 | Alias | Command | Description |
567 |---------|------------------------------------|---------------------------------------------------------------------|
568@@ -74,7 +119,9 @@
569 | pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages |
570 | upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages |
571 | pacfileupg | sudo pacman -Fy | Download fresh package databases from the server |
572-| pacfiles | pacman -Fs | Search package file names for matching strings. |
573+| pacfiles | pacman -Fs | Search package file names for matching strings |
574+| pacls | pacman -Ql | List files in a package |
575+| pacown | pacman -Qo | Show which package owns a file |
576
577 | Function | Description |
578 |----------------|------------------------------------------------------|
579@@ -82,6 +129,7 @@
580 | paclist | List all installed packages with a short description |
581 | pacmanallkeys | Get all keys for developers and trusted users |
582 | pacmansignkeys | Locally trust all keys passed as parameters |
583+| pacweb | Open the website of an ArchLinux package |
584
585 ---
586
587@@ -95,3 +143,4 @@
588 - ornicar - thibault.duplessis@gmail.com
589 - Juraj Fiala - doctorjellyface@riseup.net
590 - Majora320 (Moses Miller) - Majora320@gmail.com
591+- Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info
592diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
593index 0fab1252b7121b06d77072006568e4a2110b7303..e0101c7eb57daf3a9abad44612d8d9ab9ad8dd3e 100644
594--- a/plugins/archlinux/archlinux.plugin.zsh
595+++ b/plugins/archlinux/archlinux.plugin.zsh
596@@ -1,3 +1,32 @@
597+if (( $+commands[trizen] )); then
598+ alias trconf='trizen -C'
599+ alias trupg='trizen -Syua'
600+ alias trsu='trizen -Syua --noconfirm'
601+ alias trin='trizen -S'
602+ alias trins='trizen -U'
603+ alias trre='trizen -R'
604+ alias trrem='trizen -Rns'
605+ alias trrep='trizen -Si'
606+ alias trreps='trizen -Ss'
607+ alias trloc='trizen -Qi'
608+ alias trlocs='trizen -Qs'
609+ alias trlst='trizen -Qe'
610+ alias trorph='trizen -Qtd'
611+ alias trinsd='trizen -S --asdeps'
612+ alias trmir='trizen -Syy'
613+
614+
615+ if (( $+commands[abs] && $+commands[aur] )); then
616+ alias trupd='trizen -Sy && sudo abs && sudo aur'
617+ elif (( $+commands[abs] )); then
618+ alias trupd='trizen -Sy && sudo abs'
619+ elif (( $+commands[aur] )); then
620+ alias trupd='trizen -Sy && sudo aur'
621+ else
622+ alias trupd='trizen -Sy'
623+ fi
624+fi
625+
626 if (( $+commands[yaourt] )); then
627 alias yaconf='yaourt -C'
628 alias yaupg='yaourt -Syua'
629@@ -27,6 +56,35 @@ if (( $+commands[yaourt] )); then
630 fi
631 fi
632
633+if (( $+commands[yay] )); then
634+ alias yaconf='yay -Pg'
635+ alias yaupg='yay -Syu'
636+ alias yasu='yay -Syu --noconfirm'
637+ alias yain='yay -S'
638+ alias yains='yay -U'
639+ alias yare='yay -R'
640+ alias yarem='yay -Rns'
641+ alias yarep='yay -Si'
642+ alias yareps='yay -Ss'
643+ alias yaloc='yay -Qi'
644+ alias yalocs='yay -Qs'
645+ alias yalst='yay -Qe'
646+ alias yaorph='yay -Qtd'
647+ alias yainsd='yay -S --asdeps'
648+ alias yamir='yay -Syy'
649+
650+
651+ if (( $+commands[abs] && $+commands[aur] )); then
652+ alias yaupd='yay -Sy && sudo abs && sudo aur'
653+ elif (( $+commands[abs] )); then
654+ alias yaupd='yay -Sy && sudo abs'
655+ elif (( $+commands[aur] )); then
656+ alias yaupd='yay -Sy && sudo aur'
657+ else
658+ alias yaupd='yay -Sy'
659+ fi
660+fi
661+
662 if (( $+commands[pacaur] )); then
663 alias paupg='pacaur -Syu'
664 alias pasu='pacaur -Syu --noconfirm'
665@@ -54,16 +112,24 @@ if (( $+commands[pacaur] )); then
666 fi
667 fi
668
669-if (( $+commands[pacaur] )); then
670- upgrade() {
671+if (( $+commands[trizen] )); then
672+ function upgrade() {
673+ trizen -Syu
674+ }
675+elif (( $+commands[pacaur] )); then
676+ function upgrade() {
677 pacaur -Syu
678 }
679 elif (( $+commands[yaourt] )); then
680- upgrade() {
681+ function upgrade() {
682 yaourt -Syu
683 }
684+elif (( $+commands[yay] )); then
685+ function upgrade() {
686+ yay -Syu
687+ }
688 else
689- upgrade() {
690+ function upgrade() {
691 sudo pacman -Syu
692 }
693 fi
694@@ -83,7 +149,9 @@ alias pacmir='sudo pacman -Syy'
695 alias paclsorphans='sudo pacman -Qdt'
696diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
697index 8736d2ff8363cc77227ea70ec121e94b7612b7ee..75395c718a0c40627bbe523852de1d9a80fe44b5 100644
698--- a/plugins/asdf/asdf.plugin.zsh
699+++ b/plugins/asdf/asdf.plugin.zsh
700@@ -1,7 +1,17 @@
701-# Find where asdf should be installed.
702+# Find where asdf should be installed
703 ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
704
705-# Load asdf, if found.
706-if [ -f $ASDF_DIR/asdf.sh ]; then
707- . $ASDF_DIR/asdf.sh
708+# If not found, check for Homebrew package
709+if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then
710+ ASDF_DIR="$(brew --prefix asdf)"
711+fi
712+
713+# Load command
714+if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
715+ . "$ASDF_DIR/asdf.sh"
716+
717+ # Load completions
718+ if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then
719+ . "$ASDF_DIR/completions/asdf.bash"
720+ fi
721 fi
722diff --git a/plugins/autojump/README.md b/plugins/autojump/README.md
723new file mode 100644
724index 0000000000000000000000000000000000000000..18ff793cdc45dae57752bb63c2b2a35372f3d57b
725--- /dev/null
726+++ b/plugins/autojump/README.md
727@@ -0,0 +1,11 @@
728+# Autojump plugin
729+
730+This plugin loads the [autojump navigation tool](https://github.com/wting/autojump).
731+
732+To use it, add `autojump` to the plugins array in your zshrc file:
733+
734+```zsh
735+plugins=(... autojump)
736+```
737+
738+More info on the usage: https://github.com/wting/autojump
739diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
740index 7339fad9ebeb83893074c1ccecb748ddc0ee3fbe..c0af676317ac3a6e478e0428bbe2d6a4ce1df71d 100644
741--- a/plugins/autojump/autojump.plugin.zsh
742+++ b/plugins/autojump/autojump.plugin.zsh
743@@ -15,8 +15,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
744 . /etc/profile.d/autojump.sh
745 elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
746 . /usr/local/share/autojump/autojump.zsh
747- elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
748- . /opt/local/etc/profile.d/autojump.zsh
749+ elif [ -f /opt/local/etc/profile.d/autojump.sh ]; then # mac os x with ports
750+ . /opt/local/etc/profile.d/autojump.sh
751 elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew
752 . `brew --prefix`/etc/autojump.sh
753 fi
754diff --git a/plugins/autopep8/README.md b/plugins/autopep8/README.md
755new file mode 100644
756index 0000000000000000000000000000000000000000..02bbb9af4860d67bc09f4c33f221970708e06913
757--- /dev/null
758+++ b/plugins/autopep8/README.md
759@@ -0,0 +1,8 @@
760+# autopep8 plugin
761+
762+This plugin adds completion for [autopep8](https://pypi.org/project/autopep8/), a tool that automatically formats Python code to conform to the [PEP 8](http://www.python.org/dev/peps/pep-0008/) style guide.
763+
764+To use it, add autopep8 to the plugins array of your zshrc file:
765+```
766+plugins=(... autopep8)
767+```
768diff --git a/plugins/autopep8/autopep8.plugin.zsh b/plugins/autopep8/autopep8.plugin.zsh
769deleted file mode 100644
770index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
771--- a/plugins/autopep8/autopep8.plugin.zsh
772+++ /dev/null
773diff --git a/plugins/aws/README.md b/plugins/aws/README.md
774new file mode 100644
775index 0000000000000000000000000000000000000000..8a45199b8e95d0882fbac95219b3375a5278f53b
776--- /dev/null
777+++ b/plugins/aws/README.md
778@@ -0,0 +1,20 @@
779+# aws
780+
781+This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html)
782+and a few utilities to manage AWS profiles: a function to change profiles with autocompletion support
783+and a function to get the current AWS profile. The current AWS profile is also displayed in `RPROMPT`.
784+
785+To use it, add `aws` to the plugins array in your zshrc file.
786+
787+```zsh
788+plugins=(... aws)
789+```
790+
791+## Plugin commands
792+
793+* `asp <profile>`: Sets `AWS_PROFILE` and `AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
794+It also adds it to your RPROMPT.
795+
796+* `agp`: Gets the current value of `AWS_PROFILE`.
797+
798+* `aws_profiles`: Lists the available profiles in the file referenced in `AWS_CONFIG_FILE` (default: ~/.aws/config). Used to provide completion for the `asp` function.
799diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
800index 6a0e04add6e2454390dd89d4bb064de7f1e2ca72..f78e96ce361c157d3c05e64d4049d6436b914a32 100644
801--- a/plugins/aws/aws.plugin.zsh
802+++ b/plugins/aws/aws.plugin.zsh
803@@ -21,10 +21,8 @@ _awscli-homebrew-installed() {
804 [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null
805 }
806
807-export AWS_HOME=~/.aws
808-
809 function agp {
810- echo $AWS_DEFAULT_PROFILE
811+ echo $AWS_PROFILE
812 }
813
814 function asp {
815@@ -33,20 +31,19 @@ function asp {
816 export AWS_DEFAULT_PROFILE=$1
817 export AWS_PROFILE=$1
818
819- export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
820+ export RPROMPT="<aws:$AWS_PROFILE>$rprompt"
821 }
822
823 function aws_profiles {
824- reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
825+ reply=($(grep profile "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
826 }
827-
828 compctl -K aws_profiles asp
829
830-if _homebrew-installed && _awscli-homebrew-installed ; then
831+if which aws_zsh_completer.sh &>/dev/null; then
832+ _aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null)
833+elif _homebrew-installed && _awscli-homebrew-installed; then
834 _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
835-else
836- _aws_zsh_completer_path=$(which aws_zsh_completer.sh)
837 fi
838
839-[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
840+[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
841 unset _aws_zsh_completer_path
842diff --git a/plugins/battery/README.md b/plugins/battery/README.md
843new file mode 100644
844index 0000000000000000000000000000000000000000..b7a13a7ecc2ac6aa79c1492d2d6e2cda8237155a
845--- /dev/null
846+++ b/plugins/battery/README.md
847@@ -0,0 +1,13 @@
848+# Battery Plugin
849+
850+This plugin adds some functions you can use to display battery information in your custom theme.
851+
852+To use, add `battery` to the list of plugins in your `.zshrc` file:
853+
854+`plugins=(... battery)`
855+
856+Then, add the `battery_pct_prompt` function to your custom theme. For example:
857+
858+```
859+RPROMPT='$(battery_pct_prompt)'
860+```
861diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md
862index ec2b743d6a29bebc1bb5bec6d195ed90d0f74ccf..263c54c47bd0d4872ab282a5c2deac08c201eafc 100644
863--- a/plugins/bbedit/README.md
864+++ b/plugins/bbedit/README.md
865@@ -1,11 +1,11 @@
866 ## bbedit
867
868-Plugin for BBEdit, an HTML and text editor for Mac OS X
869+Plugin for BBEdit, an HTML and text editor for Mac OS X
870
871 ### Requirements
872
873- * [BBEdit](http://www.barebones.com/products/bbedit/)
874- * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html)
875+ * [BBEdit](https://www.barebones.com/products/bbedit/)
876+ * [BBEdit Command-Line Tools](https://www.barebones.com/support/bbedit/cmd-line-tools.html)
877
878 ### Usage
879
880diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md
881index b154916d61f2d0b2b1d1f1cb63e93fb69066e6c9..1d8fac54d03e77b8d33fba6f15635186e97ab391 100644
882--- a/plugins/bgnotify/README.md
883+++ b/plugins/bgnotify/README.md
884@@ -10,10 +10,10 @@ Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-ba
885
886 Just add bgnotify to your plugins list in your `.zshrc`
887
888-- On OS X you'll need [terminal-notifer](https://github.com/alloy/terminal-notifier)
889+- On OS X you'll need [terminal-notifier](https://github.com/alloy/terminal-notifier)
890 * `brew install terminal-notifier` (or `gem install terminal-notifier`)
891 - On ubuntu you're already all set!
892-- On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
893+- On windows you can use [notifu](https://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
894
895
896 ## Screenshots
897diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
898old mode 100755
899new mode 100644
900index 459f5214e62c07d62d65dbd98901ea2c4dc82bcc..b3a6890b8f3aa7fd4ffa9bac49d0e36b5b1f2c1a
901--- a/plugins/bgnotify/bgnotify.plugin.zsh
902+++ b/plugins/bgnotify/bgnotify.plugin.zsh
903@@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle)
904 elif hash notify-send 2>/dev/null; then #ubuntu gnome!
905 notify-send "$1" "$2"
906 elif hash kdialog 2>/dev/null; then #ubuntu kde!
907- kdialog -title "$1" --passivepopup "$2" 5
908+ kdialog --title "$1" --passivepopup "$2" 5
909 elif hash notifu 2>/dev/null; then #cygwyn support!
910 notifu /m "$2" /p "$1"
911 fi
912diff --git a/plugins/bower/README.md b/plugins/bower/README.md
913new file mode 100644
914index 0000000000000000000000000000000000000000..743b6a0ea9e451f082d4d79c40f41054896d7f66
915--- /dev/null
916+++ b/plugins/bower/README.md
917@@ -0,0 +1,18 @@
918+# Bower plugin
919+
920+This plugin adds completion for [Bower](https://bower.io/) and a few useful aliases for common Bower commands.
921+
922+To use it, add `bower` to the plugins array in your zshrc file:
923+
924+```
925+plugins=(... bower)
926+```
927+
928+## Aliases
929+
930+| Alias | Command | Description |
931+|-------|-----------------|--------------------------------------------------------|
932+| bi | `bower install` | Installs the project dependencies listed in bower.json |
933+| bl | `bower list` | List local packages and possible updates |
934+| bs | `bower search` | Finds all packages or a specific package. |
935+
936diff --git a/plugins/brew/README.md b/plugins/brew/README.md
937new file mode 100644
938index 0000000000000000000000000000000000000000..aab55ea390d8802260a8de20de97eeb3ccc71355
939--- /dev/null
940+++ b/plugins/brew/README.md
941@@ -0,0 +1,19 @@
942+# brew plugin
943+
944+The plugin adds several aliases for common [brew](https://brew.sh) commands.
945+
946+To use it, add `brew` to the plugins array of your zshrc file:
947+```
948+plugins=(... brew)
949+```
950+
951+## Aliases
952+
953+| Alias | Command | Description |
954+|--------|----------------------|---------------|
955+| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade <formulae> command. |
956+| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. |
957+| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. |
958+| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. |
959+| bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. |
960+| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. |
961diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
962index 6fb7f345313a073eb6efa6aa4fc0143f654f4fae..60b81f8ecb66357b768f8203f88c84a5b4de44d5 100644
963--- a/plugins/brew/brew.plugin.zsh
964+++ b/plugins/brew/brew.plugin.zsh
965@@ -1,4 +1,6 @@
966+alias brewp='brew pin'
967 alias brews='brew list -1'
968+alias brewsp='brew list --pinned'
969 alias bubo='brew update && brew outdated'
970 alias bubc='brew upgrade && brew cleanup'
971 alias bubu='bubo && bubc'
972diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
973index 04d55144757fd6296cf424c930be663cdeae5b57..dc2f170087ec2c69128e81e8816664e317645a47 100644
974--- a/plugins/bundler/README.md
975+++ b/plugins/bundler/README.md
976@@ -2,7 +2,8 @@
977
978 - adds completion for basic bundler commands
979 - adds short aliases for common bundler commands
980- - `be` aliased to `bundle exec`
981+ - `be` aliased to `bundle exec`.
982+ It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`).
983 - `bl` aliased to `bundle list`
984 - `bp` aliased to `bundle package`
985 - `bo` aliased to `bundle open`
986@@ -13,7 +14,8 @@
987 - looks for a binstub under `./bin/` and executes it (if present)
988 - calls `bundle exec <gem executable>` otherwise
989
990-For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
991+Common gems wrapped by default (by name of the executable):
992diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
993index c5284dbb19d6853f8353f2f2ffc14dc064a905a8..668e15d2f98a48f94ea2f098a136f3c7c5379df8 100644
994--- a/plugins/bundler/bundler.plugin.zsh
995+++ b/plugins/bundler/bundler.plugin.zsh
996@@ -14,6 +14,7 @@ bundled_commands=(
997 cucumber
998 foodcritic
999 guard
1000+ hanami
1001 irb
1002 jekyll
1003 kitchen
1004@@ -53,10 +54,14 @@ done
1005 ## Functions
1006
1007 bundle_install() {
1008- if _bundler-installed && _within-bundled-project; then
1009+ if ! _bundler-installed; then
1010+ echo "Bundler is not installed"
1011+ elif ! _within-bundled-project; then
1012+ echo "Can't 'bundle install' outside a bundled project"
1013+ else
1014 local bundler_version=`bundle version | cut -d' ' -f3`
1015 if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
1016- if [[ "$OSTYPE" = darwin* ]]
1017+ if [[ "$OSTYPE" = (darwin|freebsd)* ]]
1018 then
1019 local cores_num="$(sysctl -n hw.ncpu)"
1020 else
1021@@ -66,8 +71,6 @@ bundle_install() {
1022 else
1023 bundle install $@
1024 fi
1025- else
1026- echo "Can't 'bundle install' outside a bundled project"
1027 fi
1028 }
1029
1030diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md
1031new file mode 100644
1032index 0000000000000000000000000000000000000000..8cbeaa32e0ff57adfe8425f76352866715bd4e86
1033--- /dev/null
1034+++ b/plugins/bwana/README.md
1035@@ -0,0 +1,9 @@
1036+# Bwana
1037+
1038+This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/).
1039+
1040+To use it add bwana to the plugins array in your zshrc file.
1041+
1042+```bash
1043+plugins=(... bwana)
1044+```
1045diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh
1046index 455da862151d56f299dbd3923e09b28dc73895f0..b9a04793f67cf7742277279c3dbf11175a8b5f61 100644
1047--- a/plugins/bwana/bwana.plugin.zsh
1048+++ b/plugins/bwana/bwana.plugin.zsh
1049@@ -1,5 +1,5 @@
1050 #
1051-# Requires http://www.bruji.com/bwana/
1052+# Requires https://www.bruji.com/bwana/
1053 #
1054 if [[ -e /Applications/Bwana.app ]] ||
1055 ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
1056@@ -9,5 +9,5 @@ then
1057 }
1058 else
1059 echo "Bwana lets you read man files in Safari through a man: URI scheme"
1060- echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
1061+ echo "To use it within Zsh, install it from https://www.bruji.com/bwana/"
1062 fi
1063diff --git a/plugins/cabal/README.md b/plugins/cabal/README.md
1064new file mode 100644
1065index 0000000000000000000000000000000000000000..b1106c40feff48af770dc591e3633a9511fe562c
1066--- /dev/null
1067+++ b/plugins/cabal/README.md
1068@@ -0,0 +1,9 @@
1069+# Cabal
1070+
1071+This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It
1072+also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox.
1073+
1074+To use it, add cabal to the plugins array of your zshrc file:
1075+```
1076+plugins=(... cabal)
1077+```
1078diff --git a/plugins/capistrano/README.md b/plugins/capistrano/README.md
1079new file mode 100644
1080index 0000000000000000000000000000000000000000..335b794faf5e34c29dcc314bc49b82d9a71e3ce8
1081--- /dev/null
1082+++ b/plugins/capistrano/README.md
1083@@ -0,0 +1,14 @@
1084+# Capistrano
1085+
1086+This plugin provides completion for [Capistrano](https://capistranorb.com/).
1087+
1088+To use it add capistrano to the plugins array in your zshrc file.
1089+
1090+```bash
1091+plugins=(... capistrano)
1092+```
1093+
1094+For a working completion use the `capit` command instead of `cap`, because cap is a
1095+[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module).
1096+
1097+`capit` automatically runs cap with bundler if a Gemfile is found.
1098diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh
1099index 0b555979122c213d1fb038049fc00ec192dcb2c6..81957282554e2be325431caa4fa9abda8c802ad4 100644
1100--- a/plugins/capistrano/capistrano.plugin.zsh
1101+++ b/plugins/capistrano/capistrano.plugin.zsh
1102@@ -1,7 +1,7 @@
1103-# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
1104+# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work.
1105 # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
1106
1107-func capit() {
1108+function capit() {
1109 if [ -f Gemfile ]
1110 then
1111 bundle exec cap $*
1112diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md
1113new file mode 100644
1114index 0000000000000000000000000000000000000000..2fc28a1c606fcd21423523afec6efb7bfdbf8690
1115--- /dev/null
1116+++ b/plugins/catimg/README.md
1117@@ -0,0 +1,35 @@
1118+# catimg
1119+
1120+Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg)
1121+
1122+## Requirements
1123+
1124+- `convert` (ImageMagick)
1125+
1126+## Enabling the plugin
1127+
1128+1. Open your `.zshrc` file and add `catimg` in the plugins section:
1129+
1130+ ```zsh
1131+ plugins=(
1132+ # all your enabled plugins
1133+ catimg
1134+ )
1135+ ```
1136+
1137+2. Reload the source file or restart your Terminal session:
1138+
1139+ ```console
1140+ $ source ~/.zshrc
1141+ $
1142+ ```
1143+
1144+## Functions
1145+
1146+| Function | Description |
1147+| -------- | ---------------------------------------- |
1148+| `catimg` | Displays the given image on the terminal |
1149+
1150+## Usage examples
1151+
1152+[](https://asciinema.org/a/204702)
1153diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh
1154index cb92f5986bed461891798be5019ee45b3b53c3d2..5f58ecde399496eefd957fefdf42038a1298830f 100644
1155--- a/plugins/catimg/catimg.plugin.zsh
1156+++ b/plugins/catimg/catimg.plugin.zsh
1157@@ -1,6 +1,6 @@
1158 ################################################################################
1159 # catimg script by Eduardo San Martin Morote aka Posva #
1160-# http://posva.net #
1161+# https://posva.net #
1162 # #
1163 # Ouput the content of an image to the stdout using the 256 colors of the #
1164 # terminal. #
1165diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh
1166old mode 100755
1167new mode 100644
1168index cd0f2e3335e537083ed6e1211c8e96d3e2a4d0e4..83ccf6a9595687c1ff733528117b62f6e2e0a533
1169--- a/plugins/catimg/catimg.sh
1170+++ b/plugins/catimg/catimg.sh
1171@@ -1,6 +1,6 @@
1172 ################################################################################
1173 # catimg script by Eduardo San Martin Morote aka Posva #
1174-# http://posva.net #
1175+# https://posva.net #
1176 # #
1177 # Ouput the content of an image to the stdout using the 256 colors of the #
1178 # terminal. #
1179diff --git a/plugins/celery/README.md b/plugins/celery/README.md
1180new file mode 100644
1181index 0000000000000000000000000000000000000000..d2597f70215afe4faf03a9c50b828a41ce20756e
1182--- /dev/null
1183+++ b/plugins/celery/README.md
1184@@ -0,0 +1,9 @@
1185+# Celery
1186+
1187+This plugin provides completion for [Celery](http://www.celeryproject.org/).
1188+
1189+To use it add celery to the plugins array in your zshrc file.
1190+
1191+```bash
1192+plugins=(... celery)
1193+```
1194diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
1195index 998d92098fa5f9cac16da21c370238ea96373541..f7fedb5f250cc9bdab4642230fe063b0f6c6e9e0 100644
1196--- a/plugins/chruby/chruby.plugin.zsh
1197+++ b/plugins/chruby/chruby.plugin.zsh
1198@@ -111,5 +111,11 @@ function chruby_prompt_info() {
1199 }
1200
1201 # complete on installed rubies
1202-_chruby() { compadd $(chruby | tr -d '* ') }
1203+_chruby() {
1204+ compadd $(chruby | tr -d '* ')
1205+ local default_path='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
1206+ if PATH=${default_path} type ruby &> /dev/null; then
1207+ compadd system
1208+ fi
1209+}
1210 compdef _chruby chruby
1211diff --git a/plugins/chucknorris/LICENSE b/plugins/chucknorris/LICENSE
1212deleted file mode 100644
1213index 5f40edd1ef61de7e43ddbc61ef2d78b3e1ad0cf6..0000000000000000000000000000000000000000
1214--- a/plugins/chucknorris/LICENSE
1215+++ /dev/null
1216@@ -1,2 +0,0 @@
1217-License: GPL v2
1218-Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.
1219diff --git a/plugins/chucknorris/README.md b/plugins/chucknorris/README.md
1220new file mode 100644
1221index 0000000000000000000000000000000000000000..be7b97e2475fbadfbd05d5a014d950cf54a421ec
1222--- /dev/null
1223+++ b/plugins/chucknorris/README.md
1224@@ -0,0 +1,20 @@
1225+# chucknorris
1226+
1227+Chuck Norris fortunes plugin for oh-my-zsh
1228+
1229+**Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff)
1230+
1231+To use it add `chucknorris` to the plugins array in you zshrc file.
1232+
1233+```zsh
1234+plugins=(... chucknorris)
1235+```
1236+
1237+
1238+Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD.
1239+
1240+
1241+| Command | Description |
1242+| ----------- | ------------------------------- |
1243+| `chuck` | Print random Chuck Norris quote |
1244+| `chuck_cow` | Print quote in cowthink |
1245diff --git a/plugins/chucknorris/fortunes/chucknorris b/plugins/chucknorris/fortunes/chucknorris
1246index e705d1c13e28c0a2ec065e0276f3e77a40ddb823..2a13b060f32fc68169cbe6bf44b1be122bb93117 100644
1247--- a/plugins/chucknorris/fortunes/chucknorris
1248+++ b/plugins/chucknorris/fortunes/chucknorris
1249@@ -1,907 +1,2544 @@
1250-Chuck Norris' tears cure cancer. Too bad he has never cried. Ever.
1251+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
1252 %
1253-Chuck Norris does not sleep. He waits.
1254+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
1255 %
1256-Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
1257+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
1258 %
1259-The chief export of Chuck Norris is pain.
1260+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
1261 %
1262-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.
1263+Chuck Norris does not sleep. He waits.
1264 %
1265-Chuck Norris has counted to infinity. Twice.
1266+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
1267 %
1268-Chuck Norris does not hunt because the word hunting implies the probability of failure. Chuck Norris goes killing.
1269+Chuck Norris is the reason why Waldo is hiding.
1270 %
1271-Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only with heavy construction equipment, tanks, and fighter jets.
1272+Chuck Norris counted to infinity - twice.
1273 %
1274-Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
1275+There is no chin behind Chuck Norris’ beard. There is only another fist.
1276 %
1277-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.
1278+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.
1279 %
1280 There is no chin behind Chuck Norris' beard. There is only another fist.
1281 %
1282-Chuck Norris does not teabag the ladies. He potato-sacks them.
1283+Chuck Norris does not teabag the ladies. He potato-sacks them.
1284 %
1285-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.
1286+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.
1287 %
1288-When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.
1289+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
1290 %
1291-There are no steroids in baseball. Just players Chuck Norris has breathed on.
1292+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
1293 %
1294-Chuck Norris once challenged Lance Armstrong in a "Who has more testicles?" contest. Chuck Norris won by 5.
1295+Chuck Norris' hand is the only hand that can beat a Royal Flush.
1296 %
1297diff --git a/plugins/cloudfoundry/README.md b/plugins/cloudfoundry/README.md
1298new file mode 100644
1299index 0000000000000000000000000000000000000000..89dd9d1ce2da1a75c2b5cef3ed0fcf539b634dfd
1300--- /dev/null
1301+++ b/plugins/cloudfoundry/README.md
1302@@ -0,0 +1,58 @@
1303+# Cloudfoundry Plugin
1304+
1305diff --git a/plugins/cloudfoundry/cloudfoundry.plugin.zsh b/plugins/cloudfoundry/cloudfoundry.plugin.zsh
1306new file mode 100644
1307index 0000000000000000000000000000000000000000..b6715787e3cb15f301939613aa0f8d5c6f74ff00
1308--- /dev/null
1309+++ b/plugins/cloudfoundry/cloudfoundry.plugin.zsh
1310@@ -0,0 +1,34 @@
1311+# Some Useful CloudFoundry Aliases & Functions
1312+alias cfl="cf login"
1313+alias cft="cf target"
1314+alias cfa="cf apps"
1315+alias cfs="cf services"
1316+alias cfm="cf marketplace"
1317+alias cfp="cf push"
1318+alias cfcs="cf create-service"
1319+alias cfbs="cf bind-service"
1320+alias cfus="cf unbind-service"
1321+alias cfds="cf delete-service"
1322+alias cfup="cf cups"
1323+alias cflg="cf logs"
1324+alias cfr="cf routes"
1325+alias cfe="cf env"
1326+alias cfsh="cf ssh"
1327+alias cfsc="cf scale"
1328+alias cfev="cf events"
1329+alias cfdor="cf delete-orphaned-routes"
1330+alias cfbpk="cf buildpacks"
1331+alias cfdm="cf domains"
1332+alias cfsp="cf spaces"
1333+function cfap() { cf app $1 }
1334+function cfh.() { export CF_HOME=$PWD/.cf }
1335+function cfh~() { export CF_HOME=~/.cf }
1336+function cfhu() { unset CF_HOME }
1337+function cfpm() { cf push -f $1 }
1338+function cflr() { cf logs $1 --recent }
1339+function cfsrt() { cf start $1 }
1340+function cfstp() { cf stop $1 }
1341+function cfstg() { cf restage $1 }
1342+function cfdel() { cf delete $1 }
1343+function cfsrtall() {cf apps | awk '/stopped/ { system("cf start " $1)}'}
1344+function cfstpall() {cf apps | awk '/started/ { system("cf stop " $1)}'}