0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/.github/main.workflow b/.github/main.workflow
2new file mode 100644
3index 0000000000000000000000000000000000000000..0dbb0247ab0e6bbaafe84671948aff9e43657229
4--- /dev/null
5+++ b/.github/main.workflow
6@@ -0,0 +1,17 @@
7+workflow "Triage Pull Request" {
8+ on = "pull_request"
9+ resolves = ["Triage"]
10+}
11+
12+# Only act if there are code changes: if the pull_request
13+# event's action is either 'opened' (new PR) or 'synchronize' (new commits)
14+action "Filter actions" {
15+ uses = "actions/bin/filter@0ac6d44"
16+ args = "action 'opened|synchronize'"
17+}
18+
19+action "Triage" {
20+ needs = ["Filter actions"]
21+ uses = "ohmyzsh/github-actions/pull-request-triage@master"
22+ secrets = ["GITHUB_TOKEN"]
23+}
24diff --git a/.gitignore b/.gitignore
25index b2022081ae8fcdeb51e08b113e98853fc5d5d3ae..87a79cdae3464823e307182badbf1d1ffc4b5aad 100644
26--- a/.gitignore
27+++ b/.gitignore
28@@ -1,7 +1,5 @@
29 # custom files
30 custom/
31-!custom/plugins/example
32-!custom/example.zsh
33
34 # temp files directories
35 cache/
36diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
37new file mode 100644
38index 0000000000000000000000000000000000000000..20ad1cceecd280fe6a2bbeca64c3b448d1dce776
39--- /dev/null
40+++ b/CODE_OF_CONDUCT.md
41@@ -0,0 +1,76 @@
42+# Contributor Covenant Code of Conduct
43+
44+## Our Pledge
45+
46+In the interest of fostering an open and welcoming environment, we as
47+contributors and maintainers pledge to making participation in our project and
48+our community a harassment-free experience for everyone, regardless of age, body
49+size, disability, ethnicity, sex characteristics, gender identity and expression,
50+level of experience, education, socio-economic status, nationality, personal
51+appearance, race, religion, or sexual identity and orientation.
52+
53+## Our Standards
54+
55+Examples of behavior that contributes to creating a positive environment
56+include:
57+
58+* Using welcoming and inclusive language
59+* Being respectful of differing viewpoints and experiences
60+* Gracefully accepting constructive criticism
61+* Focusing on what is best for the community
62+* Showing empathy towards other community members
63+
64+Examples of unacceptable behavior by participants include:
65+
66+* The use of sexualized language or imagery and unwelcome sexual attention or
67+ advances
68+* Trolling, insulting/derogatory comments, and personal or political attacks
69+* Public or private harassment
70+* Publishing others' private information, such as a physical or electronic
71+ address, without explicit permission
72+* Other conduct which could reasonably be considered inappropriate in a
73+ professional setting
74+
75+## Our Responsibilities
76+
77+Project maintainers are responsible for clarifying the standards of acceptable
78+behavior and are expected to take appropriate and fair corrective action in
79+response to any instances of unacceptable behavior.
80+
81+Project maintainers have the right and responsibility to remove, edit, or
82+reject comments, commits, code, wiki edits, issues, and other contributions
83+that are not aligned to this Code of Conduct, or to ban temporarily or
84+permanently any contributor for other behaviors that they deem inappropriate,
85+threatening, offensive, or harmful.
86+
87+## Scope
88+
89+This Code of Conduct applies within all project spaces, and it also applies when
90+an individual is representing the project or its community in public spaces.
91+Examples of representing a project or community include using an official
92+project e-mail address, posting via an official social media account, or acting
93+as an appointed representative at an online or offline event. Representation of
94+a project may be further defined and clarified by project maintainers.
95+
96+## Enforcement
97+
98+Instances of abusive, harassing, or otherwise unacceptable behavior may be
99+reported by contacting the project team at ohmyzsh@planetargon.com. All
100+complaints will be reviewed and investigated and will result in a response that
101+is deemed necessary and appropriate to the circumstances. The project team is
102+obligated to maintain confidentiality with regard to the reporter of an incident.
103+Further details of specific enforcement policies may be posted separately.
104+
105+Project maintainers who do not follow or enforce the Code of Conduct in good
106+faith may face temporary or permanent repercussions as determined by other
107+members of the project's leadership.
108+
109+## Attribution
110+
111+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
112+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
113+
114+[homepage]: https://www.contributor-covenant.org
115+
116+For answers to common questions about this code of conduct, see
117+https://www.contributor-covenant.org/faq
118diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
119index ac263fd181110841bdb106599aa5848154d7ff19..f575157c21876fc09fb9bfa48297ad6a4ad1f158 100644
120--- a/CONTRIBUTING.md
121+++ b/CONTRIBUTING.md
122@@ -1,8 +1,10 @@
123 # CONTRIBUTING GUIDELINES
124
125-Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged and appreciated.
126+Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged, and appreciated.
127 It is also essential for the development of the project.
128
129+First, please take a moment to review our [code of conduct](CODE_OF_CONDUCT.md).
130+
131 These guidelines are an attempt at better addressing the huge amount of pending
132 issues and pull requests. Please read them closely.
133
134diff --git a/LICENSE.txt b/LICENSE.txt
135index 7af38f21746237dc2d9f0d8c1fd2994dd9c93fc6..4d465b1c31fc0c7d9cca130ad273c160c5955ef5 100644
136--- a/LICENSE.txt
137+++ b/LICENSE.txt
138@@ -1,6 +1,6 @@
139 The MIT License (MIT)
140
141-Copyright (c) 2009-2018 Robby Russell and contributors
142+Copyright (c) 2009-2019 Robby Russell and contributors
143 See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors
144
145 Permission is hereby granted, free of charge, to any person obtaining a copy
146diff --git a/README.md b/README.md
147index a6d74cbd2bfe8c2874bdd20a2ee65c013d8a8ebd..38f6ae9f318733b77dc2ab070f6f7e84b28bd4bf 100644
148--- a/README.md
149+++ b/README.md
150@@ -2,7 +2,7 @@
151 <img src="https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png" alt="Oh My Zsh">
152 </p>
153
154-Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration.
155+Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
156
157 Sounds boring. Let's try again.
158
159@@ -12,7 +12,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo
160
161 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. 😬
162
163-To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
164+To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
165
166 ## Getting Started
167
168@@ -21,7 +21,7 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t
169 __Disclaimer:__ _Oh My Zsh works best on macOS and Linux._
170
171 * Unix-like operating system (macOS or Linux)
172-* [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)
173+* [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)
174 * `curl` or `wget` should be installed
175 * `git` should be installed
176
177@@ -75,7 +75,7 @@ Most plugins (should! we're working on this) include a __README__, which documen
178
179 ### Themes
180
181-We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out!
182+We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes) on the wiki. Check them out!
183
184 #### Selecting a Theme
185
186@@ -141,7 +141,7 @@ export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubus
187 ##### 1. Clone the repository:
188
189 ```shell
190-git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
191+git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
192 ```
193
194 ##### 2. *Optionally*, backup your existing `~/.zshrc` file:
195@@ -163,6 +163,7 @@ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
196 ```shell
197 chsh -s /bin/zsh
198 ```
199+You must log out and log back in to see this change.
200
201 ##### 5. Initialize your new zsh configuration
202
203@@ -213,12 +214,16 @@ Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy b
204
205 If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration.
206
207-## Contributing
208+## How do I contribute to Oh My Zsh?
209
210-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!
211+Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md).
212+
213+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!
214
215 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.
216
217+See [Contributing](CONTRIBUTING.md) for more details.
218+
219 ### Do NOT send us themes
220
221 We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page.
222@@ -238,7 +243,7 @@ We're on the social media.
223
224 ## Merchandise
225
226diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme
227new file mode 100644
228index 0000000000000000000000000000000000000000..ef8f1c630b7c39783a3f65ff17678cfba81c932d
229--- /dev/null
230+++ b/custom/themes/example.zsh-theme
231@@ -0,0 +1,4 @@
232+# Put your custom themes in this folder.
233+# Example:
234+
235+PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
236diff --git a/lib/compfix.zsh b/lib/compfix.zsh
237index 208aaadb1ebad0e25ebdef29192da815be8136bd..b09b283f2785967468ece63506b4d6d34df60283 100644
238--- a/lib/compfix.zsh
239+++ b/lib/compfix.zsh
240@@ -2,10 +2,6 @@
241 # insecure ownership or permissions) by:
242 #
243 # * Human-readably notifying the user of these insecurities.
244-# * Moving away all existing completion caches to a temporary directory. Since
245-# any of these caches may have been generated from insecure directories, they
246-# are all suspect now. Failing to do so typically causes subsequent compinit()
247-# calls to fail with "command not found: compdef" errors. (That's bad.)
248 function handle_completion_insecurities() {
249 # List of the absolute paths of all unique insecure directories, split on
250 # newline from compaudit()'s output resembling:
251@@ -22,39 +18,27 @@ function handle_completion_insecurities() {
252 insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
253
254 # If no such directories exist, get us out of here.
255- if (( ! ${#insecure_dirs} )); then
256- print "[oh-my-zsh] No insecure completion-dependent directories detected."
257- return
258- fi
259+ [[ -z "${insecure_dirs}" ]] && return
260
261 # List ownership and permissions of all insecure directories.
262 print "[oh-my-zsh] Insecure completion-dependent directories detected:"
263 ls -ld "${(@)insecure_dirs}"
264- print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
265- print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
266- print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
267
268- # Locally enable the "NULL_GLOB" option, thus removing unmatched filename
269- # globs from argument lists *AND* printing no warning when doing so. Failing
270- # to do so prints an unreadable warning if no completion caches exist below.
271- setopt local_options null_glob
272+ cat <<EOD
273
274- # List of the absolute paths of all unique existing completion caches.
275- local -aU zcompdump_files
276- zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
277+[oh-my-zsh] For safety, we will not load completions from these directories until
278+[oh-my-zsh] you fix their permissions and ownership and restart zsh.
279+[oh-my-zsh] See the above list for directories with group or other writability.
280
281- # Move such caches to a temporary directory.
282- if (( ${#zcompdump_files} )); then
283- # Absolute path of the directory to which such files will be moved.
284- local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
285+[oh-my-zsh] To fix your permissions you can do so by disabling
286+[oh-my-zsh] the write permission of "group" and "others" and making sure that the
287+[oh-my-zsh] owner of these directories is either root or your current user.
288+[oh-my-zsh] The following command may help:
289+[oh-my-zsh] compaudit | xargs chmod g-w,o-w
290
291- # List such files first.
292- print "[oh-my-zsh] Insecure completion caches also detected:"
293- ls -l "${(@)zcompdump_files}"
294+[oh-my-zsh] If the above didn't help or you want to skip the verification of
295+[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
296+[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.
297
298- # For safety, move rather than permanently remove such files.
299- print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
300- mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
301- mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
302- fi
303+EOD
304 }
305diff --git a/lib/completion.zsh b/lib/completion.zsh
306index a1e934315f66c290c04f203f890bd1b97e6cd728..c7db2eb7b20abde827d46858e03d3b8f87b9957a 100644
307--- a/lib/completion.zsh
308+++ b/lib/completion.zsh
309@@ -25,6 +25,9 @@ else
310 fi
311 unset CASE_SENSITIVE HYPHEN_INSENSITIVE
312
313+# Complete . and .. special directories
314+zstyle ':completion:*' special-dirs true
315+
316 zstyle ':completion:*' list-colors ''
317 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
318
319diff --git a/lib/correction.zsh b/lib/correction.zsh
320index 3e1415a0ba840c1298e583c66c87eb2d6bb5f9ae..c635236b5b06f31d523849a0756f06b9aed65704 100644
321--- a/lib/correction.zsh
322+++ b/lib/correction.zsh
323@@ -1,4 +1,5 @@
324 if [[ "$ENABLE_CORRECTION" == "true" ]]; then
325+ alias cp='nocorrect cp'
326 alias ebuild='nocorrect ebuild'
327 alias gist='nocorrect gist'
328 alias heroku='nocorrect heroku'
329diff --git a/lib/directories.zsh b/lib/directories.zsh
330index a50a692c8abaff1a94afff1c6ecf1c14e0cd8197..cf87bd7e4f7028d29746c9b806738eeba1d29065 100644
331--- a/lib/directories.zsh
332+++ b/lib/directories.zsh
333@@ -21,14 +21,18 @@ alias 9='cd -9'
334
335 alias md='mkdir -p'
336 alias rd=rmdir
337-alias d='dirs -v | head -10'
338+
339+function d () {
340+ if [[ -n $1 ]]; then
341+ dirs "$@"
342+ else
343+ dirs -v | head -10
344+ fi
345+}
346+compdef _dirs d
347
348 # List directory contents
349 alias lsa='ls -lah'
350 alias l='ls -lah'
351 alias ll='ls -lh'
352 alias la='ls -lAh'
353-
354-# Push and pop directories on directory stack
355-alias pu='pushd'
356-alias po='popd'
357diff --git a/lib/functions.zsh b/lib/functions.zsh
358index f306537846c9662462c127dc61018dfb58bbaa5f..9f8736bd7e2967321fd95b561a5480f5c5d42e5e 100644
359--- a/lib/functions.zsh
360+++ b/lib/functions.zsh
361@@ -11,21 +11,20 @@ function upgrade_oh_my_zsh() {
362 }
363
364 function take() {
365- mkdir -p $1
366- cd $1
367+ mkdir -p $@ && cd ${@:$#}
368 }
369
370 function open_command() {
371- emulate -L zsh
372- setopt shwordsplit
373-
374 local open_cmd
375
376 # define the open command
377 case "$OSTYPE" in
378 darwin*) open_cmd='open' ;;
379 cygwin*) open_cmd='cygstart' ;;
380- linux*) open_cmd='xdg-open' ;;
381+ linux*) ! [[ $(uname -a) =~ "Microsoft" ]] && open_cmd='xdg-open' || {
382+ open_cmd='cmd.exe /c start ""'
383+ [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 }
384+ } ;;
385 msys*) open_cmd='start ""' ;;
386 *) echo "Platform $OSTYPE not supported"
387 return 1
388@@ -34,9 +33,9 @@ function open_command() {
389
390 # don't use nohup on OSX
391 if [[ "$OSTYPE" == darwin* ]]; then
392- $open_cmd "$@" &>/dev/null
393+ ${=open_cmd} "$@" &>/dev/null
394 else
395- nohup $open_cmd "$@" &>/dev/null
396+ nohup ${=open_cmd} "$@" &>/dev/null
397 fi
398 }
399
400@@ -52,8 +51,7 @@ function open_command() {
401 # 1 if it does not exist
402 #
403 function alias_value() {
404- alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
405- test $(alias "$1")
406+ (( $+aliases[$1] )) && echo $aliases[$1]
407 }
408
409 #
410@@ -81,7 +79,7 @@ function try_alias_value() {
411 # 0 if the variable exists, 3 if it was set
412 #
413 function default() {
414- test `typeset +m "$1"` && return 0
415+ (( $+parameters[$1] )) && return 0
416 typeset -g "$1"="$2" && return 3
417 }
418
419@@ -95,8 +93,8 @@ function default() {
420 # 0 if the env variable exists, 3 if it was set
421 #
422 function env_default() {
423- env | grep -q "^$1=" && return 0
424- export "$1=$2" && return 3
425+ (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0
426+ export "$1=$2" && return 3
427 }
428
429
430diff --git a/lib/git.zsh b/lib/git.zsh
431index 9b0f6e36feecd17883dbc95552e605b4f2ea8a62..640561e97563e1aeffde3a9067674213e439a5ac 100644
432--- a/lib/git.zsh
433+++ b/lib/git.zsh
434@@ -10,13 +10,10 @@ function git_prompt_info() {
435
436 # Checks if working tree is dirty
437 function parse_git_dirty() {
438- local STATUS=''
439+ local STATUS
440 local -a FLAGS
441- FLAGS=('--porcelain')
442+ FLAGS=('--porcelain' '--ignore-submodules=dirty')
443 if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
444- if [[ $POST_1_7_2_GIT -gt 0 ]]; then
445- FLAGS+='--ignore-submodules=dirty'
446- fi
447 if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
448 FLAGS+='--untracked-files=no'
449 fi
450@@ -77,8 +74,8 @@ function git_current_branch() {
451 # Gets the number of commits ahead from remote
452 function git_commits_ahead() {
453 if command git rev-parse --git-dir &>/dev/null; then
454- local commits="$(git rev-list --count @{upstream}..HEAD)"
455- if [[ "$commits" != 0 ]]; then
456+ local commits="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
457+ if [[ -n "$commits" && "$commits" != 0 ]]; then
458 echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
459 fi
460 fi
461@@ -87,8 +84,8 @@ function git_commits_ahead() {
462 # Gets the number of commits behind remote
463 function git_commits_behind() {
464 if command git rev-parse --git-dir &>/dev/null; then
465- local commits="$(git rev-list --count HEAD..@{upstream})"
466- if [[ "$commits" != 0 ]]; then
467+ local commits="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
468+ if [[ -n "$commits" && "$commits" != 0 ]]; then
469 echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
470 fi
471 fi
472@@ -181,28 +178,6 @@ function git_prompt_status() {
473 echo $STATUS
474 }
475
476-# Compares the provided version of git to the version installed and on path
477-# Outputs -1, 0, or 1 if the installed version is less than, equal to, or
478-# greater than the input version, respectively.
479-function git_compare_version() {
480- local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
481- INPUT_GIT_VERSION=(${(s/./)1})
482- INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
483- INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
484-
485- for i in {1..3}; do
486- if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
487- echo 1
488- return 0
489- fi
490- if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
491- echo -1
492- return 0
493- fi
494- done
495- echo 0
496-}
497-
498 # Outputs the name of the current user
499 # Usage example: $(git_current_user_name)
500 function git_current_user_name() {
501@@ -214,8 +189,3 @@ function git_current_user_name() {
502 function git_current_user_email() {
503 command git config user.email 2>/dev/null
504 }
505-
506-# This is unlikely to change so make it all statically assigned
507-POST_1_7_2_GIT=$(git_compare_version "1.7.2")
508-# Clean up the namespace slightly by removing the checker function
509-unfunction git_compare_version
510diff --git a/lib/history.zsh b/lib/history.zsh
511index 5de71c2d3e0fdd0296cc8d46da9fbd1724fd7a00..52e45bf4ca7776c3415110f8678ccd2dbe451071 100644
512--- a/lib/history.zsh
513+++ b/lib/history.zsh
514@@ -1,24 +1,40 @@
515-## Command history configuration
516-if [ -z "$HISTFILE" ]; then
517- HISTFILE=$HOME/.zsh_history
518-fi
519+## History wrapper
520+function omz_history {
521+ local clear list
522+ zparseopts -E c=clear l=list
523
524-HISTSIZE=10000
525-SAVEHIST=10000
526+ if [[ -n "$clear" ]]; then
527+ # if -c provided, clobber the history file
528+ echo -n >| "$HISTFILE"
529+ echo >&2 History file deleted. Reload the session to see its effects.
530+ elif [[ -n "$list" ]]; then
531+ # if -l provided, run as if calling `fc' directly
532+ builtin fc "$@"
533+ else
534+ # unless a number is provided, show all history events (starting from 1)
535+ [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
536+ fi
537+}
538
539-# Show history
540-case $HIST_STAMPS in
541- "mm/dd/yyyy") alias history='fc -fl 1' ;;
542- "dd.mm.yyyy") alias history='fc -El 1' ;;
543- "yyyy-mm-dd") alias history='fc -il 1' ;;
544- *) alias history='fc -l 1' ;;
545+# Timestamp format
546+case ${HIST_STAMPS-} in
547+ "mm/dd/yyyy") alias history='omz_history -f' ;;
548+ "dd.mm.yyyy") alias history='omz_history -E' ;;
549+ "yyyy-mm-dd") alias history='omz_history -i' ;;
550+ "") alias history='omz_history' ;;
551+ *) alias history="omz_history -t '$HIST_STAMPS'" ;;
552 esac
553
554-setopt append_history
555-setopt extended_history
556-setopt hist_expire_dups_first
557-setopt hist_ignore_dups # ignore duplication command history list
558-setopt hist_ignore_space
559-setopt hist_verify
560-setopt inc_append_history
561-setopt share_history # share command history data
562+## History file configuration
563+[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
564+HISTSIZE=50000
565+SAVEHIST=10000
566+
567+## History command configuration
568+setopt extended_history # record timestamp of command in HISTFILE
569+setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
570+setopt hist_ignore_dups # ignore duplicated commands history list
571+setopt hist_ignore_space # ignore commands that start with space
572+setopt hist_verify # show command with history expansion to user before running it
573+setopt inc_append_history # add commands to HISTFILE in order of execution
574+setopt share_history # share command history data
575diff --git a/lib/misc.zsh b/lib/misc.zsh
576index 3052b77108ee5eb8bedc6b2a02f30c1e71ddfc0d..b30822b509f7755bd351e6c52d38447df7026ef2 100644
577--- a/lib/misc.zsh
578+++ b/lib/misc.zsh
579@@ -18,13 +18,11 @@ fi
580 ## jobs
581 setopt long_list_jobs
582
583-## pager
584-env_default PAGER 'less'
585-env_default LESS '-R'
586+env_default 'PAGER' 'less'
587+env_default 'LESS' '-R'
588
589 ## super user alias
590 alias _='sudo'
591-alias please='sudo'
592
593 ## more intelligent acking for ubuntu users
594 if which ack-grep &> /dev/null; then
595diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
596index 335c02a3d03867efa8674d778189d82a377896c6..5069c4b21751257d07cbdbf574ad5e37bd9ca1c0 100644
597--- a/lib/prompt_info_functions.zsh
598+++ b/lib/prompt_info_functions.zsh
599@@ -10,9 +10,15 @@
600 # Dummy implementations that return false to prevent command_not_found
601 # errors with themes, that implement these functions
602 # Real implementations will be used when the respective plugins are loaded
603-function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
604- rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
605- virtualenv_prompt_info {
606+function chruby_prompt_info \
607+ rbenv_prompt_info \
608+ hg_prompt_info \
609+ pyenv_prompt_info \
610+ svn_prompt_info \
611+ vi_mode_prompt_info \
612+ virtualenv_prompt_info \
613+ jenv_prompt_info \
614+{
615 return 1
616 }
617
618@@ -22,10 +28,13 @@ function rvm_prompt_info() {
619 [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
620 local rvm_prompt
621 rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
622- [[ "${rvm_prompt}x" == "x" ]] && return 1
623- echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
624+ [[ -z "${rvm_prompt}" ]] && return 1
625+ echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt}${ZSH_THEME_RUBY_PROMPT_SUFFIX}"
626 }
627
628+ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
629+
630+
631 # use this to enable users to see their ruby version, no matter which
632 # version management system they use
633 function ruby_prompt_info() {
634diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh
635index 87092d8ae8b036c6105314b0669fe7accf2f671b..312ab22482176acf25bedd74276f6ce2f6048384 100644
636--- a/lib/spectrum.zsh
637+++ b/lib/spectrum.zsh
638@@ -1,7 +1,7 @@
639 #! /bin/zsh
640 # A script to make using 256 colors in zsh less painful.
641 # P.C. Shyamshankar <sykora@lucentbeing.com>
642-# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
643+# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
644
645 typeset -AHg FX FG BG
646
647diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
648index 871ab28dfa82f8c63d43538c64c18409b393c78b..aa14f3f07fe4a12979cd9352b8a6ee6d917cadc0 100644
649--- a/lib/termsupport.zsh
650+++ b/lib/termsupport.zsh
651@@ -21,7 +21,7 @@ function title {
652 print -Pn "\e]2;$2:q\a" # set window name
653 print -Pn "\e]1;$1:q\a" # set tab name
654 ;;
655- screen*)
656+ screen*|tmux*)
657 print -Pn "\ek$1:q\e\\" # set screen hardstatus
658 ;;
659 *)
660@@ -80,7 +80,7 @@ preexec_functions+=(omz_termsupport_preexec)
661
662
663 # Keep Apple Terminal.app's current working directory updated
664-# Based on this answer: http://superuser.com/a/315029
665+# Based on this answer: https://superuser.com/a/315029
666 # With extra fixes to handle multibyte chars and non-UTF-8 locales
667
668 if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
669diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh
670index 96f34aa81fa495c1b092aa05896a8d47f33fd6d9..5016d86caadc92ce3192400926bc1df7c0c7a773 100644
671--- a/lib/theme-and-appearance.zsh
672+++ b/lib/theme-and-appearance.zsh
673@@ -19,7 +19,7 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
674 # coreutils, so prefer it to "gls".
675 gls --color -d . &>/dev/null && alias ls='gls --color=tty'
676 colorls -G -d . &>/dev/null && alias ls='colorls -G'
677- elif [[ "$OSTYPE" == darwin* ]]; then
678+ elif [[ "$OSTYPE" == (darwin|freebsd)* ]]; then
679 # this is a good alias, it works by default just using $LSCOLORS
680 ls -G . &>/dev/null && alias ls='ls -G'
681
682@@ -45,11 +45,10 @@ setopt prompt_subst
683
684 [[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
685
686-# Apply theming defaults
687-PS1="%n@%m:%~%# "
688-
689 # git theming default: Variables for theming the git info prompt
690 ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
691 ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
692 ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
693 ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
694+ZSH_THEME_RUBY_PROMPT_PREFIX="("
695+ZSH_THEME_RUBY_PROMPT_SUFFIX=")"
696diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
697index 7f78e4140da5ccae7094572ed34908e9359b571c..6b2662d5e8fdde23ad91d0557c43baff1206a5c1 100644
698--- a/oh-my-zsh.sh
699+++ b/oh-my-zsh.sh
700@@ -1,6 +1,17 @@
701+# Set ZSH_CACHE_DIR to the path where cache files should be created
702+# or else we will use the default cache/
703+if [[ -z "$ZSH_CACHE_DIR" ]]; then
704+ ZSH_CACHE_DIR="$ZSH/cache"
705+fi
706+
707+# Migrate .zsh-update file to $ZSH_CACHE_DIR
708+if [ -f ~/.zsh-update ] && [ ! -f ${ZSH_CACHE_DIR}/.zsh-update ]; then
709+ mv ~/.zsh-update ${ZSH_CACHE_DIR}/.zsh-update
710+fi
711+
712 # Check for updates on initial load...
713 if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
714- env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
715+ env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
716 fi
717
718 # Initializes Oh My Zsh
719@@ -11,29 +22,12 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
720 # Load all stock functions (from $fpath files) called below.
721 autoload -U compaudit compinit
722
723-: ${ZSH_DISABLE_COMPFIX:=true}
724-
725 # Set ZSH_CUSTOM to the path where your custom config files
726 # and plugins exists, or else we will use the default custom/
727 if [[ -z "$ZSH_CUSTOM" ]]; then
728 ZSH_CUSTOM="$ZSH/custom"
729 fi
730
731-# Set ZSH_CACHE_DIR to the path where cache files should be created
732-# or else we will use the default cache/
733-if [[ -z "$ZSH_CACHE_DIR" ]]; then
734- ZSH_CACHE_DIR="$ZSH/cache"
735-fi
736-
737-
738-# Load all of the config files in ~/oh-my-zsh that end in .zsh
739-# TIP: Add files you don't want in git to .gitignore
740-for config_file ($ZSH/lib/*.zsh); do
741- custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
742- [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
743- source $config_file
744-done
745-
746
747 is_plugin() {
748 local base_dir=$1
749@@ -41,6 +35,7 @@ is_plugin() {
750 test -f $base_dir/plugins/$name/$name.plugin.zsh \
751 || test -f $base_dir/plugins/$name/_$name
752 }
753+
754 # Add all defined plugins to fpath. This must be done
755 # before running compinit.
756 for plugin ($plugins); do
757@@ -48,6 +43,8 @@ for plugin ($plugins); do
758 fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
759 elif is_plugin $ZSH $plugin; then
760 fpath=($ZSH/plugins/$plugin $fpath)
761+ else
762+ echo "[oh-my-zsh] plugin '$plugin' not found"
763 fi
764 done
765
766@@ -65,18 +62,25 @@ if [ -z "$ZSH_COMPDUMP" ]; then
767 fi
768
769 if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
770- # If completion insecurities exist, warn the user without enabling completions.
771- if ! compaudit &>/dev/null; then
772- # This function resides in the "lib/compfix.zsh" script sourced above.
773- handle_completion_insecurities
774- # Else, enable and cache completions to the desired file.
775- else
776- compinit -d "${ZSH_COMPDUMP}"
777- fi
778+ source $ZSH/lib/compfix.zsh
779+ # If completion insecurities exist, warn the user
780+ handle_completion_insecurities
781+ # Load only from secure directories
782+ compinit -i -C -d "${ZSH_COMPDUMP}"
783 else
784- compinit -i -d "${ZSH_COMPDUMP}"
785+ # If the user wants it, load from all found directories
786+ compinit -u -C -d "${ZSH_COMPDUMP}"
787 fi
788
789+
790+# Load all of the config files in ~/oh-my-zsh that end in .zsh
791+# TIP: Add files you don't want in git to .gitignore
792+for config_file ($ZSH/lib/*.zsh); do
793+ custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
794+ [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
795+ source $config_file
796+done
797+
798 # Load all of the plugins that were defined in ~/.zshrc
799 for plugin ($plugins); do
800diff --git a/plugins/adb/_adb b/plugins/adb/_adb
801index 8cbf6593cc076325e85578f2e90f2417fdacf4b8..78c4577462cfea022527095f380ca39f0363b934 100644
802--- a/plugins/adb/_adb
803+++ b/plugins/adb/_adb
804@@ -48,8 +48,13 @@ _arguments \
805
806 case "$state" in
807 specify_device)
808- _values 'devices' $(adb devices -l|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \
809- {printf "%s[%s] ",$1,$6 }')
810+ _values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \
811+ {sub(/ +/," ",$0); \
812+ gsub(":","\\:",$1); \
813+ for(i=1;i<=NF;i++) {
814+ if($i ~ /model:/) { split($i,m,":") } \
815+ else if($i ~ /product:/) { split($i,p,":") } } \
816+ printf "%s[%s(%s)] ",$1, p[2], m[2]}'):-""}
817 return
818 ;;
819 esac
820@@ -59,4 +64,4 @@ if (( CURRENT == 1 )); then
821 return
822 fi
823
824-_files
825+_files
826diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md
827new file mode 100644
828index 0000000000000000000000000000000000000000..e0e6a19bb293fcec6b2e1e40570ce251434cfb6d
829--- /dev/null
830+++ b/plugins/ansible/README.md
831@@ -0,0 +1,34 @@
832+# ansible plugin
833+
834+## Introduction
835+
836+The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases).
837+
838+To use it, add `ansible` to the plugins array of your zshrc file:
839+
840+```
841+plugins=(... ansible)
842+```
843+
844+## Aliases
845+
846+| Command | Description |
847+|:-------------------------------------------|:--------------------------------------------------------------------|
848+| `ansible-version` / `aver` | Show the version on ansible installed in this host |
849+| `ansible-role-init <role name>` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard |
850+| `a` | command `ansible` |
851+| `aconf` | command `ansible-config` |
852+| `acon` | command `ansible-console` |
853+| `ainv` | command `ansible-inventory` |
854+| `aplaybook` | command `ansible-playbook` |
855+| `ainv` | command `ansible-inventory` |
856+| `adoc` | command `ansible-doc` |
857+| `agal` | command `ansible-galaxy` |
858+| `apull` | command `ansible-pull` |
859+| `aval` | command `ansible-vault` |
860+
861+## Maintainer
862+
863+### [Deepankumar](https://github.com/deepan10)
864+
865+[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin)
866diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh
867new file mode 100644
868index 0000000000000000000000000000000000000000..f68ff23a540f11902aeaf9c5b8515875ad85093f
869--- /dev/null
870+++ b/plugins/ansible/ansible.plugin.zsh
871@@ -0,0 +1,28 @@
872+# Functions
873+function ansible-version(){
874+ ansible --version
875+}
876+
877+function ansible-role-init(){
878+ if ! [ -z $1] ; then
879+ echo "Ansible Role : $1 Creating...."
880+ ansible-galaxy init $1
881+ tree $1
882+ else
883+ echo "Usage : ansible-role-init <role name>"
884+ echo "Example : ansible-role-init role1"
885+ fi
886+}
887+
888+# Alias
889+alias a='ansible '
890+alias aconf='ansible-config '
891+alias acon='ansible-console '
892+alias aver='ansible-version'
893+alias arinit='ansible-role-init'
894+alias aplaybook='ansible-playbook '
895+alias ainv='ansible-inventory '
896+alias adoc='ansible-doc '
897+alias agal='ansible-galaxy '
898+alias apull='ansible-pull '
899+alias aval='ansible-vault'
900diff --git a/plugins/ant/README.md b/plugins/ant/README.md
901new file mode 100644
902index 0000000000000000000000000000000000000000..5f88984ac30a7607358d2fa12578d6a1e244d7eb
903--- /dev/null
904+++ b/plugins/ant/README.md
905@@ -0,0 +1,12 @@
906+# Ant
907+
908+This plugin provides completion for [Ant](https://ant.apache.org/).
909+
910+To use it add ant to the plugins array in your zshrc file.
911+
912+```bash
913+plugins=(... ant)
914+```
915+
916+It caches ant targets in a file named `.ant_targets`, you might want to add that to
917+your `.gitignore` file.
918diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
919index e408db13dabd93959e4ff423619062588adc416a..ff2b6a4c40c78ca291770fba751c73bc311812fc 100644
920--- a/plugins/archlinux/README.md
921+++ b/plugins/archlinux/README.md
922@@ -2,6 +2,51 @@
923
924 ## Features
925
926+#### YAY
927+
928+| Alias | Command | Description |
929+|---------|------------------------------------|---------------------------------------------------------------------|
930+| yaconf | yay -Pg | Print current configuration |
931+| yain | yay -S | Install packages from the repositories |
932+| yains | yay -U | Install a package from a local file |
933+| yainsd | yay -S --asdeps | Install packages as dependencies of another package |
934+| yaloc | yay -Qi | Display information about a package in the local database |
935+| yalocs | yay -Qs | Search for packages in the local database |
936+| yalst | yay -Qe | List installed packages including from AUR (tagged as "local") |
937+| yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist |
938+| yaorph | yay -Qtd | Remove orphans using yay |
939+| yare | yay -R | Remove packages, keeping its settings and dependencies |
940+| yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies |
941+| yarep | yay -Si | Display information about a package in the repositories |
942+| yareps | yay -Ss | Search for packages in the repositories |
943+| yaupg | yay -Syu | Sync with repositories before upgrading packages |
944+| yasu | yay -Syu --no-confirm | Same as `yaupg`, but without confirmation |
945+
946+#### TRIZEN
947+
948+| Alias | Command | Description |
949+|---------|------------------------------------|---------------------------------------------------------------------|
950+| trconf | trizen -C | Fix all configuration files with vimdiff |
951+| trin | trizen -S | Install packages from the repositories |
952+| trins | trizen -U | Install a package from a local file |
953+| trinsd | trizen -S --asdeps | Install packages as dependencies of another package |
954+| trloc | trizen -Qi | Display information about a package in the local database |
955+| trlocs | trizen -Qs | Search for packages in the local database |
956+| trlst | trizen -Qe | List installed packages including from AUR (tagged as "local") |
957+| trmir | trizen -Syy | Force refresh of all package lists after updating mirrorlist |
958+| trorph | trizen -Qtd | Remove orphans using yaourt |
959+| trre | trizen -R | Remove packages, keeping its settings and dependencies |
960+| trrem | trizen -Rns | Remove packages, including its settings and unneeded dependencies |
961+| trrep | trizen -Si | Display information about a package in the repositories |
962+| trreps | trizen -Ss | Search for packages in the repositories |
963+| trupd | trizen -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
964+| trupd | trizen -Sy && sudo abs | Update and refresh the local package and ABS databases |
965+| trupd | trizen -Sy && sudo aur | Update and refresh the local package and AUR databases |
966+| trupd | trizen -Sy | Update and refresh the local package database |
967+| trupg | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
968+| trsu | trizen -Syua --no-confirm | Same as `trupg`, but without confirmation |
969+| upgrade | trizen -Syu | Sync with repositories before upgrading packages |
970+
971 #### YAOURT
972
973 | Alias | Command | Description |
974@@ -27,7 +72,7 @@
975 | yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
976 | upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
977
978-### PACAUR
979+#### PACAUR
980
981 | Alias | Command | Description |
982 |---------|------------------------------------|---------------------------------------------------------------------|
983@@ -74,7 +119,9 @@
984 | pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages |
985 | upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages |
986 | pacfileupg | sudo pacman -Fy | Download fresh package databases from the server |
987-| pacfiles | pacman -Fs | Search package file names for matching strings. |
988+| pacfiles | pacman -Fs | Search package file names for matching strings |
989+| pacls | pacman -Ql | List files in a package |
990+| pacown | pacman -Qo | Show which package owns a file |
991
992 | Function | Description |
993 |----------------|------------------------------------------------------|
994@@ -82,6 +129,7 @@
995 | paclist | List all installed packages with a short description |
996 | pacmanallkeys | Get all keys for developers and trusted users |
997 | pacmansignkeys | Locally trust all keys passed as parameters |
998+| pacweb | Open the website of an ArchLinux package |
999
1000 ---
1001
1002@@ -95,3 +143,4 @@
1003 - ornicar - thibault.duplessis@gmail.com
1004 - Juraj Fiala - doctorjellyface@riseup.net
1005 - Majora320 (Moses Miller) - Majora320@gmail.com
1006+- Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info
1007diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
1008index 0fab1252b7121b06d77072006568e4a2110b7303..e0101c7eb57daf3a9abad44612d8d9ab9ad8dd3e 100644
1009--- a/plugins/archlinux/archlinux.plugin.zsh
1010+++ b/plugins/archlinux/archlinux.plugin.zsh
1011@@ -1,3 +1,32 @@
1012+if (( $+commands[trizen] )); then
1013+ alias trconf='trizen -C'
1014+ alias trupg='trizen -Syua'
1015+ alias trsu='trizen -Syua --noconfirm'
1016+ alias trin='trizen -S'
1017+ alias trins='trizen -U'
1018+ alias trre='trizen -R'
1019+ alias trrem='trizen -Rns'
1020+ alias trrep='trizen -Si'
1021+ alias trreps='trizen -Ss'
1022+ alias trloc='trizen -Qi'
1023+ alias trlocs='trizen -Qs'
1024+ alias trlst='trizen -Qe'
1025+ alias trorph='trizen -Qtd'
1026+ alias trinsd='trizen -S --asdeps'
1027+ alias trmir='trizen -Syy'
1028+
1029+
1030+ if (( $+commands[abs] && $+commands[aur] )); then
1031+ alias trupd='trizen -Sy && sudo abs && sudo aur'
1032+ elif (( $+commands[abs] )); then
1033+ alias trupd='trizen -Sy && sudo abs'
1034+ elif (( $+commands[aur] )); then
1035+ alias trupd='trizen -Sy && sudo aur'
1036+ else
1037+ alias trupd='trizen -Sy'
1038+ fi
1039+fi
1040+
1041 if (( $+commands[yaourt] )); then
1042 alias yaconf='yaourt -C'
1043 alias yaupg='yaourt -Syua'
1044@@ -27,6 +56,35 @@ if (( $+commands[yaourt] )); then
1045 fi
1046 fi
1047
1048+if (( $+commands[yay] )); then
1049+ alias yaconf='yay -Pg'
1050+ alias yaupg='yay -Syu'
1051+ alias yasu='yay -Syu --noconfirm'
1052+ alias yain='yay -S'
1053+ alias yains='yay -U'
1054+ alias yare='yay -R'
1055+ alias yarem='yay -Rns'
1056+ alias yarep='yay -Si'
1057+ alias yareps='yay -Ss'
1058+ alias yaloc='yay -Qi'
1059+ alias yalocs='yay -Qs'
1060+ alias yalst='yay -Qe'
1061+ alias yaorph='yay -Qtd'
1062+ alias yainsd='yay -S --asdeps'
1063+ alias yamir='yay -Syy'
1064+
1065+
1066+ if (( $+commands[abs] && $+commands[aur] )); then
1067+ alias yaupd='yay -Sy && sudo abs && sudo aur'
1068+ elif (( $+commands[abs] )); then
1069+ alias yaupd='yay -Sy && sudo abs'
1070+ elif (( $+commands[aur] )); then
1071+ alias yaupd='yay -Sy && sudo aur'
1072+ else
1073+ alias yaupd='yay -Sy'
1074+ fi
1075+fi
1076+
1077 if (( $+commands[pacaur] )); then
1078 alias paupg='pacaur -Syu'
1079 alias pasu='pacaur -Syu --noconfirm'
1080@@ -54,16 +112,24 @@ if (( $+commands[pacaur] )); then
1081 fi
1082 fi
1083
1084-if (( $+commands[pacaur] )); then
1085- upgrade() {
1086+if (( $+commands[trizen] )); then
1087+ function upgrade() {
1088+ trizen -Syu
1089+ }
1090+elif (( $+commands[pacaur] )); then
1091+ function upgrade() {
1092 pacaur -Syu
1093 }
1094 elif (( $+commands[yaourt] )); then
1095- upgrade() {
1096+ function upgrade() {
1097 yaourt -Syu
1098 }
1099+elif (( $+commands[yay] )); then
1100+ function upgrade() {
1101+ yay -Syu
1102+ }
1103 else
1104- upgrade() {
1105+ function upgrade() {
1106 sudo pacman -Syu
1107 }
1108 fi
1109@@ -83,7 +149,9 @@ alias pacmir='sudo pacman -Syy'
1110 alias paclsorphans='sudo pacman -Qdt'
1111diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
1112index 8736d2ff8363cc77227ea70ec121e94b7612b7ee..38b2255383ef00ad7dd8ea0396b1c669fc229451 100644
1113--- a/plugins/asdf/asdf.plugin.zsh
1114+++ b/plugins/asdf/asdf.plugin.zsh
1115@@ -1,7 +1,19 @@
1116-# Find where asdf should be installed.
1117+# Find where asdf should be installed
1118 ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
1119+ASDF_COMPLETIONS="$ASDF_DIR/completions"
1120
1121-# Load asdf, if found.
1122-if [ -f $ASDF_DIR/asdf.sh ]; then
1123- . $ASDF_DIR/asdf.sh
1124+# If not found, check for Homebrew package
1125+if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then
1126+ ASDF_DIR="$(brew --prefix asdf)"
1127+ ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
1128+fi
1129+
1130+# Load command
1131+if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
1132+ . "$ASDF_DIR/asdf.sh"
1133+
1134+ # Load completions
1135+ if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then
1136+ . "$ASDF_COMPLETIONS/asdf.bash"
1137+ fi
1138 fi
1139diff --git a/plugins/autojump/README.md b/plugins/autojump/README.md
1140new file mode 100644
1141index 0000000000000000000000000000000000000000..18ff793cdc45dae57752bb63c2b2a35372f3d57b
1142--- /dev/null
1143+++ b/plugins/autojump/README.md
1144@@ -0,0 +1,11 @@
1145+# Autojump plugin
1146+
1147+This plugin loads the [autojump navigation tool](https://github.com/wting/autojump).
1148+
1149+To use it, add `autojump` to the plugins array in your zshrc file:
1150+
1151+```zsh
1152+plugins=(... autojump)
1153+```
1154+
1155+More info on the usage: https://github.com/wting/autojump
1156diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
1157index 7339fad9ebeb83893074c1ccecb748ddc0ee3fbe..13c1d00ed5f0f46d01b5250dfa001ddf6239567b 100644
1158--- a/plugins/autojump/autojump.plugin.zsh
1159+++ b/plugins/autojump/autojump.plugin.zsh
1160@@ -1,23 +1,39 @@
1161-if [ $commands[autojump] ]; then # check if autojump is installed
1162- if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
1163- . $HOME/.autojump/etc/profile.d/autojump.zsh
1164- elif [ -f $HOME/.autojump/share/autojump/autojump.zsh ]; then # another manual user-local installation
1165- . $HOME/.autojump/share/autojump/autojump.zsh
1166- elif [ -f $HOME/.nix-profile/etc/profile.d/autojump.zsh ]; then # nix installation
1167- . $HOME/.nix-profile/etc/profile.d/autojump.zsh
1168- elif [ -f /run/current-system/sw/share/autojump/autojump.zsh ]; then # nixos installation
1169- . /run/current-system/sw/share/autojump/autojump.zsh
1170- elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
1171- . /usr/share/autojump/autojump.zsh
1172- elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
1173- . /etc/profile.d/autojump.zsh
1174- elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation
1175- . /etc/profile.d/autojump.sh
1176- elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation
1177- . /usr/local/share/autojump/autojump.zsh
1178- elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
1179- . /opt/local/etc/profile.d/autojump.zsh
1180- elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew
1181- . `brew --prefix`/etc/autojump.sh
1182+(( $+commands[autojump] )) || {
1183+ echo '[oh-my-zsh] Please install autojump first (https://github.com/wting/autojump)'
1184+ return
1185+}
1186+
1187+declare -a autojump_paths
1188+autojump_paths=(
1189+ $HOME/.autojump/etc/profile.d/autojump.zsh # manual installation
1190+ $HOME/.autojump/share/autojump/autojump.zsh # manual installation
1191+ $HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation
1192+ /run/current-system/sw/share/autojump/autojump.zsh # NixOS installation
1193+ /usr/share/autojump/autojump.zsh # Debian and Ubuntu package
1194+ /etc/profile.d/autojump.zsh # manual installation
1195+ /etc/profile.d/autojump.sh # Gentoo installation
1196+ /usr/local/share/autojump/autojump.zsh # FreeBSD installation
1197+ /opt/local/etc/profile.d/autojump.sh # macOS with MacPorts
1198+ /usr/local/etc/profile.d/autojump.sh # macOS with Homebrew (default)
1199+)
1200+
1201+for file in $autojump_paths; do
1202+ if [[ -f "$file" ]]; then
1203+ source "$file"
1204+ found=1
1205+ break
1206+ fi
1207+done
1208+
1209+# if no path found, try Homebrew
1210+if (( ! found && $+commands[brew] )); then
1211+ file=$(brew --prefix)/etc/profile.d/autojump.sh
1212+ if [[ -f "$file" ]]; then
1213+ source "$file"
1214+ found=1
1215 fi
1216 fi
1217+
1218+(( ! found )) && echo '[oh-my-zsh] autojump script not found'
1219+
1220+unset autojump_paths file found
1221diff --git a/plugins/autopep8/README.md b/plugins/autopep8/README.md
1222new file mode 100644
1223index 0000000000000000000000000000000000000000..02bbb9af4860d67bc09f4c33f221970708e06913
1224--- /dev/null
1225+++ b/plugins/autopep8/README.md
1226@@ -0,0 +1,8 @@
1227+# autopep8 plugin
1228+
1229+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.
1230+
1231+To use it, add autopep8 to the plugins array of your zshrc file:
1232+```
1233+plugins=(... autopep8)
1234+```
1235diff --git a/plugins/autopep8/autopep8.plugin.zsh b/plugins/autopep8/autopep8.plugin.zsh
1236deleted file mode 100644
1237index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
1238--- a/plugins/autopep8/autopep8.plugin.zsh
1239+++ /dev/null
1240diff --git a/plugins/aws/README.md b/plugins/aws/README.md
1241new file mode 100644
1242index 0000000000000000000000000000000000000000..57c3b54acddf726fb7c7790f1855ac5403a21a85
1243--- /dev/null
1244+++ b/plugins/aws/README.md
1245@@ -0,0 +1,38 @@
1246+# aws
1247+
1248+This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html)
1249+and a few utilities to manage AWS profiles and display them in the prompt.
1250+
1251+To use it, add `aws` to the plugins array in your zshrc file.
1252+
1253+```zsh
1254+plugins=(... aws)
1255+```
1256+
1257+## Plugin commands
1258+
1259+* `asp [<profile>]`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
1260+ It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI.
1261+ Run `asp` without arguments to clear the profile.
1262+
1263+* `agp`: gets the current value of `$AWS_PROFILE`.
1264+
1265+* `aws_change_access_key`: changes the AWS access key of a profile.
1266+
1267+* `aws_profiles`: lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`).
1268+ Used to provide completion for the `asp` function.
1269+
1270+## Plugin options
1271+
1272+* Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT.
1273+ Some themes might overwrite the value of RPROMPT instead of appending to it, so they'll need to be fixed to
1274+ see the AWS profile prompt.
1275+
1276+## Theme
1277+
1278+The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays
1279+the current `$AWS_PROFILE`. It uses two variables to control how that is shown:
1280+
1281+- ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to `<aws:`.
1282+
1283+- ZSH_THEME_AWS_SUFFIX: sets the suffix of the AWS_PROFILE. Defaults to `>`.
1284diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
1285index 6a0e04add6e2454390dd89d4bb064de7f1e2ca72..4bec304908b08f07fcda1a58ea0eefdd6302be9a 100644
1286--- a/plugins/aws/aws.plugin.zsh
1287+++ b/plugins/aws/aws.plugin.zsh
1288@@ -1,52 +1,85 @@
1289-_homebrew-installed() {
1290- type brew &> /dev/null
1291- _xit=$?
1292- if [ $_xit -eq 0 ];then
1293- # ok , we have brew installed
1294- # speculatively we check default brew prefix
1295- if [ -h /usr/local/opt/awscli ];then
1296- _brew_prefix="/usr/local/opt/awscli"
1297- else
1298- # ok , it is not default prefix
1299- # this call to brew is expensive ( about 400 ms ), so at least let's make it only once
1300- _brew_prefix=$(brew --prefix awscli)
1301- fi
1302- return 0
1303- else
1304- return $_xit
1305- fi
1306-}
1307-
1308-_awscli-homebrew-installed() {
1309- [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null
1310-}
1311-
1312-export AWS_HOME=~/.aws
1313+# AWS profile selection
1314
1315 function agp {
1316- echo $AWS_DEFAULT_PROFILE
1317+ echo $AWS_PROFILE
1318 }
1319
1320 function asp {
1321- local rprompt=${RPROMPT/<aws:$(agp)>/}
1322-
1323 export AWS_DEFAULT_PROFILE=$1
1324 export AWS_PROFILE=$1
1325+ export AWS_EB_PROFILE=$1
1326
1327- export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
1328+ if [[ -z "$1" ]]; then
1329+ echo AWS profile cleared.
1330+ fi
1331+}
1332+
1333+function aws_change_access_key {
1334+ if [[ -z "$1" ]] then
1335+ echo "usage: $0 <profile>"
1336+ return 1
1337+ fi
1338+
1339+ echo Insert the credentials when asked.
1340+ asp "$1"
1341+ aws iam create-access-key
1342+ aws configure --profile "$1"
1343+
1344+ echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\`
1345+ echo Your current keys are:
1346+ aws iam list-access-keys
1347 }
1348
1349 function aws_profiles {
1350- reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
1351+ reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
1352+}
1353+compctl -K aws_profiles asp aws_change_access_key
1354+
1355+
1356+# AWS prompt
1357+
1358+function aws_prompt_info() {
1359+ [[ -z $AWS_PROFILE ]] && return
1360+ echo "${ZSH_THEME_AWS_PREFIX:=<aws:}${AWS_PROFILE}${ZSH_THEME_AWS_SUFFIX:=>}"
1361+}
1362+
1363+if [ "$SHOW_AWS_PROMPT" != false ]; then
1364+ RPROMPT='$(aws_prompt_info)'"$RPROMPT"
1365+fi
1366+
1367+
1368+# Load awscli completions
1369+
1370+_awscli-homebrew-installed() {
1371+ # check if Homebrew is installed
1372+ (( $+commands[brew] )) || return 1
1373+
1374+ # speculatively check default brew prefix
1375+ if [ -h /usr/local/opt/awscli ]; then
1376+ _brew_prefix=/usr/local/opt/awscli
1377+ else
1378+ # ok, it is not in the default prefix
1379+ # this call to brew is expensive (about 400 ms), so at least let's make it only once
1380+ _brew_prefix=$(brew --prefix awscli)
1381+ fi
1382 }
1383
1384-compctl -K aws_profiles asp
1385+# get aws_zsh_completer.sh location from $PATH
1386+_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]"
1387
1388diff --git a/plugins/battery/README.md b/plugins/battery/README.md
1389new file mode 100644
1390index 0000000000000000000000000000000000000000..b7a13a7ecc2ac6aa79c1492d2d6e2cda8237155a
1391--- /dev/null
1392+++ b/plugins/battery/README.md
1393@@ -0,0 +1,13 @@
1394+# Battery Plugin
1395+
1396+This plugin adds some functions you can use to display battery information in your custom theme.
1397+
1398+To use, add `battery` to the list of plugins in your `.zshrc` file:
1399+
1400+`plugins=(... battery)`
1401+
1402+Then, add the `battery_pct_prompt` function to your custom theme. For example:
1403+
1404+```
1405+RPROMPT='$(battery_pct_prompt)'
1406+```
1407diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md
1408index ec2b743d6a29bebc1bb5bec6d195ed90d0f74ccf..263c54c47bd0d4872ab282a5c2deac08c201eafc 100644
1409--- a/plugins/bbedit/README.md
1410+++ b/plugins/bbedit/README.md
1411@@ -1,11 +1,11 @@
1412 ## bbedit
1413
1414-Plugin for BBEdit, an HTML and text editor for Mac OS X
1415+Plugin for BBEdit, an HTML and text editor for Mac OS X
1416
1417 ### Requirements
1418
1419- * [BBEdit](http://www.barebones.com/products/bbedit/)
1420- * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html)
1421+ * [BBEdit](https://www.barebones.com/products/bbedit/)
1422+ * [BBEdit Command-Line Tools](https://www.barebones.com/support/bbedit/cmd-line-tools.html)
1423
1424 ### Usage
1425
1426diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md
1427index fad29915917affb6cdea69dcf5ae6be18c59e9d3..1d8fac54d03e77b8d33fba6f15635186e97ab391 100644
1428--- a/plugins/bgnotify/README.md
1429+++ b/plugins/bgnotify/README.md
1430@@ -13,7 +13,7 @@ Just add bgnotify to your plugins list in your `.zshrc`
1431 - On OS X you'll need [terminal-notifier](https://github.com/alloy/terminal-notifier)
1432 * `brew install terminal-notifier` (or `gem install terminal-notifier`)
1433 - On ubuntu you're already all set!
1434-- On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
1435+- On windows you can use [notifu](https://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
1436
1437
1438 ## Screenshots
1439diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
1440old mode 100755
1441new mode 100644
1442index 459f5214e62c07d62d65dbd98901ea2c4dc82bcc..b3a6890b8f3aa7fd4ffa9bac49d0e36b5b1f2c1a
1443--- a/plugins/bgnotify/bgnotify.plugin.zsh
1444+++ b/plugins/bgnotify/bgnotify.plugin.zsh
1445@@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle)
1446 elif hash notify-send 2>/dev/null; then #ubuntu gnome!
1447 notify-send "$1" "$2"
1448 elif hash kdialog 2>/dev/null; then #ubuntu kde!
1449- kdialog -title "$1" --passivepopup "$2" 5
1450+ kdialog --title "$1" --passivepopup "$2" 5
1451 elif hash notifu 2>/dev/null; then #cygwyn support!
1452 notifu /m "$2" /p "$1"
1453 fi
1454diff --git a/plugins/bower/README.md b/plugins/bower/README.md
1455new file mode 100644
1456index 0000000000000000000000000000000000000000..743b6a0ea9e451f082d4d79c40f41054896d7f66
1457--- /dev/null
1458+++ b/plugins/bower/README.md
1459@@ -0,0 +1,18 @@
1460+# Bower plugin
1461+
1462+This plugin adds completion for [Bower](https://bower.io/) and a few useful aliases for common Bower commands.
1463+
1464+To use it, add `bower` to the plugins array in your zshrc file:
1465+
1466+```
1467+plugins=(... bower)
1468+```
1469+
1470+## Aliases
1471+
1472+| Alias | Command | Description |
1473+|-------|-----------------|--------------------------------------------------------|
1474+| bi | `bower install` | Installs the project dependencies listed in bower.json |
1475+| bl | `bower list` | List local packages and possible updates |
1476+| bs | `bower search` | Finds all packages or a specific package. |
1477+
1478diff --git a/plugins/brew/README.md b/plugins/brew/README.md
1479new file mode 100644
1480index 0000000000000000000000000000000000000000..c129a7652fe45be10c1377c0a0c0728be123d5f1
1481--- /dev/null
1482+++ b/plugins/brew/README.md
1483@@ -0,0 +1,21 @@
1484+# brew plugin
1485+
1486+The plugin adds several aliases for common [brew](https://brew.sh) commands.
1487+
1488+To use it, add `brew` to the plugins array of your zshrc file:
1489+```
1490+plugins=(... brew)
1491+```
1492+
1493+## Aliases
1494+
1495+| Alias | Command | Description |
1496+|--------|----------------------|---------------|
1497+| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade <formulae> command. |
1498+| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. |
1499+| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. |
1500+| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. |
1501+| 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. |
1502+| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. |
1503+| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. |
1504+| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. |
1505diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
1506index 6fb7f345313a073eb6efa6aa4fc0143f654f4fae..cfbaa3480eec781f762b8d61ae90b9335be2e50e 100644
1507--- a/plugins/brew/brew.plugin.zsh
1508+++ b/plugins/brew/brew.plugin.zsh
1509@@ -1,7 +1,11 @@
1510+alias brewp='brew pin'
1511 alias brews='brew list -1'
1512+alias brewsp='brew list --pinned'
1513 alias bubo='brew update && brew outdated'
1514 alias bubc='brew upgrade && brew cleanup'
1515 alias bubu='bubo && bubc'
1516+alias bcubo='brew update && brew cask outdated'
1517+alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup'
1518
1519 if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
1520 print -P '%F{yellow}'Oh My Zsh brew plugin:
1521diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
1522index 04d55144757fd6296cf424c930be663cdeae5b57..dc2f170087ec2c69128e81e8816664e317645a47 100644
1523--- a/plugins/bundler/README.md
1524+++ b/plugins/bundler/README.md
1525@@ -2,7 +2,8 @@
1526
1527 - adds completion for basic bundler commands
1528 - adds short aliases for common bundler commands
1529- - `be` aliased to `bundle exec`
1530+ - `be` aliased to `bundle exec`.
1531+ It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`).
1532 - `bl` aliased to `bundle list`
1533 - `bp` aliased to `bundle package`
1534 - `bo` aliased to `bundle open`
1535@@ -13,7 +14,8 @@
1536 - looks for a binstub under `./bin/` and executes it (if present)
1537 - calls `bundle exec <gem executable>` otherwise
1538
1539-For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file.
1540+Common gems wrapped by default (by name of the executable):
1541diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
1542index 6b10b78d1b40208dc460102de6bec771a3fbabe7..668e15d2f98a48f94ea2f098a136f3c7c5379df8 100644
1543--- a/plugins/bundler/bundler.plugin.zsh
1544+++ b/plugins/bundler/bundler.plugin.zsh
1545@@ -54,10 +54,14 @@ done
1546 ## Functions
1547
1548 bundle_install() {
1549- if _bundler-installed && _within-bundled-project; then
1550+ if ! _bundler-installed; then
1551+ echo "Bundler is not installed"
1552+ elif ! _within-bundled-project; then
1553+ echo "Can't 'bundle install' outside a bundled project"
1554+ else
1555 local bundler_version=`bundle version | cut -d' ' -f3`
1556 if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
1557- if [[ "$OSTYPE" = darwin* ]]
1558+ if [[ "$OSTYPE" = (darwin|freebsd)* ]]
1559 then
1560 local cores_num="$(sysctl -n hw.ncpu)"
1561 else
1562@@ -67,8 +71,6 @@ bundle_install() {
1563 else
1564 bundle install $@
1565 fi
1566- else
1567- echo "Can't 'bundle install' outside a bundled project"
1568 fi
1569 }
1570
1571diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md
1572new file mode 100644
1573index 0000000000000000000000000000000000000000..dd4fe9f9c78b9600d5a6472f99bc72aa206ce296
1574--- /dev/null
1575+++ b/plugins/bwana/README.md
1576@@ -0,0 +1,12 @@
1577+# Bwana
1578+
1579+This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/).
1580+
1581+To use it add bwana to the plugins array in your zshrc file.
1582+
1583+```bash
1584+plugins=(... bwana)
1585+```
1586+
1587+The `bwana` function opens the man page of the passed argument in the Bwana app.
1588+For example: `bwana ln` opens the man page for `ln` in Bwana.
1589diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh
1590index 455da862151d56f299dbd3923e09b28dc73895f0..71c9eb18d7111fe40808f18ae7297931c6aaf26f 100644
1591--- a/plugins/bwana/bwana.plugin.zsh
1592+++ b/plugins/bwana/bwana.plugin.zsh
1593@@ -1,13 +1,13 @@
1594 #
1595-# Requires http://www.bruji.com/bwana/
1596+# Requires https://www.bruji.com/bwana/
1597 #
1598 if [[ -e /Applications/Bwana.app ]] ||
1599 ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
1600 then
1601- function man() {
1602+ function bwana() {
1603 open "man:$1"
1604 }
1605 else
1606- echo "Bwana lets you read man files in Safari through a man: URI scheme"
1607- echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
1608+ echo "Bwana lets you read man files in Safari through a man: URI scheme"
1609+ echo "To use it within Zsh, install it from https://www.bruji.com/bwana/"
1610 fi
1611diff --git a/plugins/cabal/README.md b/plugins/cabal/README.md
1612new file mode 100644
1613index 0000000000000000000000000000000000000000..b1106c40feff48af770dc591e3633a9511fe562c
1614--- /dev/null
1615+++ b/plugins/cabal/README.md
1616@@ -0,0 +1,9 @@
1617+# Cabal
1618+
1619+This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It
1620+also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox.
1621+
1622+To use it, add cabal to the plugins array of your zshrc file:
1623+```
1624+plugins=(... cabal)
1625+```
1626diff --git a/plugins/cake/README.md b/plugins/cake/README.md
1627new file mode 100644
1628index 0000000000000000000000000000000000000000..aad92a3eccf42ca624d0f07840ca26008396bcec
1629--- /dev/null
1630+++ b/plugins/cake/README.md
1631@@ -0,0 +1,15 @@
1632+# Cake
1633+
1634+This plugin provides completion for [CakePHP](https://cakephp.org/).
1635+
1636+To use it add cake to the plugins array in your zshrc file.
1637+
1638+```bash
1639+plugins=(... cake)
1640+```
1641+
1642+## Note
1643+
1644+This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory.
1645+It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your
1646+`.gitignore` files.
1647diff --git a/plugins/capistrano/README.md b/plugins/capistrano/README.md
1648new file mode 100644
1649index 0000000000000000000000000000000000000000..335b794faf5e34c29dcc314bc49b82d9a71e3ce8
1650--- /dev/null
1651+++ b/plugins/capistrano/README.md
1652@@ -0,0 +1,14 @@
1653+# Capistrano
1654+
1655+This plugin provides completion for [Capistrano](https://capistranorb.com/).
1656+
1657+To use it add capistrano to the plugins array in your zshrc file.
1658+
1659+```bash
1660+plugins=(... capistrano)
1661+```
1662+
1663+For a working completion use the `capit` command instead of `cap`, because cap is a
1664+[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module).
1665+
1666+`capit` automatically runs cap with bundler if a Gemfile is found.
1667diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh
1668index 0b555979122c213d1fb038049fc00ec192dcb2c6..81957282554e2be325431caa4fa9abda8c802ad4 100644
1669--- a/plugins/capistrano/capistrano.plugin.zsh
1670+++ b/plugins/capistrano/capistrano.plugin.zsh
1671@@ -1,7 +1,7 @@
1672-# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
1673+# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work.
1674 # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
1675
1676-func capit() {
1677+function capit() {
1678 if [ -f Gemfile ]
1679 then
1680 bundle exec cap $*
1681diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md
1682index 5fa688d21d150f9b0d35d3fd797e45efbb75f487..31bae4efe084778fab262b135fe67325e5815df1 100644
1683--- a/plugins/cargo/README.md
1684+++ b/plugins/cargo/README.md
1685@@ -1,6 +1,6 @@
1686 # cargo
1687
1688-This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo).
1689+This plugin adds completion for the Rust build tool [`Cargo`](https://github.com/rust-lang/cargo).
1690
1691 To use it, add `cargo` to the plugins array in your zshrc file:
1692
1693@@ -8,4 +8,4 @@ To use it, add `cargo` to the plugins array in your zshrc file:
1694 plugins=(... cargo)
1695 ```
1696
1697-Updated on October 4th, 2016.
1698+Updated on March 3rd, 2019, from [Cargo 0.34.0](https://github.com/rust-lang/cargo/releases/tag/0.34.0).
1699diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo
1700index 54e709ca099928e7adc5467adf368020f3ef658e..395c517cd37e5a3e2e82d8b6db627b3a48ba9c85 100644
1701--- a/plugins/cargo/_cargo
1702+++ b/plugins/cargo/_cargo
1703@@ -1,23 +1,37 @@
1704 #compdef cargo
1705
1706-typeset -A opt_args
1707 autoload -U regexp-replace
1708
1709+zstyle -T ':completion:*:*:cargo:*' tag-order && \
1710+ zstyle ':completion:*:*:cargo:*' tag-order 'common-commands'
1711+
1712 _cargo() {
1713+local context state state_descr line
1714+typeset -A opt_args
1715
1716+# leading items in parentheses are an exclusion list for the arguments following that arg
1717+# See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions
1718+# - => exclude all other options
1719+# 1 => exclude positional arg 1
1720+# * => exclude all other args
1721+# +blah => exclude +blah
1722 _arguments \
1723 '(- 1 *)'{-h,--help}'[show help message]' \
1724+ '(- 1 *)--list[list installed commands]' \
1725 '(- 1 *)'{-V,--version}'[show version information]' \
1726- '(- 1 *)'--list'[list installed commands]' \
1727- '(- 1 *)'--explain'[Run `rustc --explain CODE`]' \
1728- '(- 1 *)'{-v,--verbose}'[use verbose output]' \
1729- '(- 1 *)'--color'[colorization option]' \
1730- '(- 1 *)'--frozen'[Require Cargo.lock and cache are up to date]' \
1731- '(- 1 *)'--locked'[Require Cargo.lock is up to date]' \
1732- '1: :_cargo_cmds' \
1733+ {-v,--verbose}'[use verbose output]' \
1734+ --color'[colorization option]' \
1735+ '(+beta +nightly)+stable[use the stable toolchain]' \
1736+ '(+stable +nightly)+beta[use the beta toolchain]' \
1737+ '(+stable +beta)+nightly[use the nightly toolchain]' \
1738+ '1: :->command' \
1739 '*:: :->args'
1740
1741 case $state in
1742+ command)
1743+ _alternative 'common-commands:common:_cargo_cmds' 'all-commands:all:_cargo_all_cmds'
1744+ ;;
1745+
1746 args)
1747 case $words[1] in
1748 bench)
1749@@ -54,6 +68,23 @@ case $state in
1750 '--color=:colorization option:(auto always never)' \
1751 ;;
1752
1753+ check)
1754+ _arguments \
1755+ '--features=[space separated feature list]' \
1756+ '--all-features[enable all available features]' \
1757+ '(-h, --help)'{-h,--help}'[show help message]' \
1758+ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
1759+ "${command_scope_spec[@]}" \
1760+ '--manifest-path=[path to manifest]: :_files -/' \
1761+ '--no-default-features[do not check the default features]' \
1762+ '(-p,--package)'{-p=,--package=}'[package to check]:packages:_get_package_names' \
1763+ '--release=[check in release mode]' \
1764+ '--target=[target triple]' \
1765+ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
1766+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
1767+ '--color=:colorization option:(auto always never)' \
1768+ ;;
1769+
1770 clean)
1771 _arguments \
1772 '(-h, --help)'{-h,--help}'[show help message]' \
1773@@ -105,7 +136,7 @@ case $state in
1774 git-checkout)
1775 _arguments \
1776 '(-h, --help)'{-h,--help}'[show help message]' \
1777- 'q(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
1778+ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
1779 '--reference=[REF]' \
1780 '--url=[URL]' \
1781 '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
1782@@ -142,10 +173,10 @@ case $state in
1783 '(-h, --help)'{-h,--help}'[show help message]' \
1784 '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \
1785 '--no-default-features[do not build the default features]' \
1786- '--path=[local filesystem path to crate to install]' \
1787+ '--path=[local filesystem path to crate to install]: :_files -/' \
1788 '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \
1789 '--rev=[specific commit to use when installing from git]' \
1790- '--root=[directory to install packages into]' \
1791+ '--root=[directory to install packages into]: :_files -/' \
1792 '--tag=[tag to use when installing from git]' \
1793 '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
1794 '--vers=[version to install from crates.io]' \
1795@@ -270,7 +301,7 @@ case $state in
1796 '--all-features[enable all available features]' \
1797 '(-h, --help)'{-h,--help}'[show help message]' \
1798 '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \
1799- '--manifest-path=[path to the manifest to fetch dependencies for]' \
1800+ '--manifest-path=[path to the manifest to fetch dependencies for]: :_files -/' \
1801 '--no-default-features[do not compile default features for the package]' \
1802 '(-p, --package)'{-p,--package}'=[profile to compile for]' \