Diff
1diff --git a/plugins/cargo/cargo.plugin.zsh b/plugins/cargo/cargo.plugin.zsh
2index 51a80d4f191ebca2d1c2c86148d85e4cd2592138..20aeb6652979e734f00b0a046ea547904862b3a5 100644
3--- a/plugins/cargo/cargo.plugin.zsh
4+++ b/plugins/cargo/cargo.plugin.zsh
5@@ -1,8 +1,12 @@
6 print ${(%):-'%F{yellow}The `cargo` plugin is deprecated and has been moved to the `rust` plugin.'}
7 print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'}
8
9+# TODO: 2021-12-28: remove this block
10+# Handle $0 according to the standard:
11+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
12+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
13+0="${${(M)0:#/*}:-$PWD/$0}"
14 # Remove old generated completion file
15-# TODO: 2021-12-28: remove this line
16 command rm -f "${0:A:h}/_cargo"
17
18 (( ${fpath[(Ie)$ZSH/plugins/rust]} )) || {
19diff --git a/plugins/colemak/colemak.plugin.zsh b/plugins/colemak/colemak.plugin.zsh
20index 8d3393c44cda40fc5438cdfcbfc6071ab87fbbcc..de0b5b8663dd31f5636f9437888a0f402ca2992a 100644
21--- a/plugins/colemak/colemak.plugin.zsh
22+++ b/plugins/colemak/colemak.plugin.zsh
23@@ -19,6 +19,11 @@ bindkey -a 'N' vi-join
24 bindkey -a 'j' vi-forward-word-end
25 bindkey -a 'J' vi-forward-blank-word-end
26
27+# Handle $0 according to the standard:
28+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
29+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
30+0="${${(M)0:#/*}:-$PWD/$0}"
31+
32 # New less versions will read this file directly
33 export LESSKEYIN="${0:h:A}/colemak-less"
34
35diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
36index 37faed6723c80e9c1cd6c4b56f08aa8c5c58a06a..040e74fc9c74df6a62eda2c231353e39ef236a18 100644
37--- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh
38+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
39@@ -16,6 +16,11 @@ less_termcap[se]="${reset_color}"
40 less_termcap[us]="${fg_bold[green]}"
41 less_termcap[ue]="${reset_color}"
42
43+# Handle $0 according to the standard:
44+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
45+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
46+0="${${(M)0:#/*}:-$PWD/$0}"
47+
48 # Absolute path to this file's directory.
49 typeset __colored_man_pages_dir="${0:A:h}"
50
51diff --git a/plugins/deno/deno.plugin.zsh b/plugins/deno/deno.plugin.zsh
52index eb7191971e5903418659e4fd39fe064b684f3164..88df55af7381b6a80680154a4e0e9b29cc59791f 100644
53--- a/plugins/deno/deno.plugin.zsh
54+++ b/plugins/deno/deno.plugin.zsh
55@@ -13,6 +13,11 @@ alias dup='deno upgrade'
56
57 # COMPLETION FUNCTION
58 if (( $+commands[deno] )); then
59+ # Handle $0 according to the standard:
60+ # # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
61+ 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
62+ 0="${${(M)0:#/*}:-$PWD/$0}"
63+
64 # remove old generated completion file
65 command rm -f "${0:A:h}/_deno"
66
67diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
68index 027c7550f4c0b2c3d3b31f940f69080efe889925..258e57f2401568772369e46c764bcf4fe1c406d4 100644
69--- a/plugins/emacs/emacs.plugin.zsh
70+++ b/plugins/emacs/emacs.plugin.zsh
71@@ -13,6 +13,11 @@
72 autoload -Uz is-at-least
73 is-at-least 24 "${${(Az)"$(emacsclient --version 2>/dev/null)"}[2]}" || return 0
74
75+# Handle $0 according to the standard:
76+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
77+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
78+0="${${(M)0:#/*}:-$PWD/$0}"
79+
80 # Path to custom emacsclient launcher
81 export EMACS_PLUGIN_LAUNCHER="${0:A:h}/emacsclient.sh"
82
83diff --git a/plugins/emoji/emoji.plugin.zsh b/plugins/emoji/emoji.plugin.zsh
84index f70e093202fd363cd115a99c1f9c66c523b2a341..60d00d976ceaddeb93d22fc0bccf8df39300dbde 100644
85--- a/plugins/emoji/emoji.plugin.zsh
86+++ b/plugins/emoji/emoji.plugin.zsh
87@@ -4,6 +4,11 @@
88 #
89 # See the README for documentation.
90
91+# Handle $0 according to the standard:
92+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
93+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
94+0="${${(M)0:#/*}:-$PWD/$0}"
95+
96 _omz_emoji_plugin_dir="${0:h}"
97
98 () {
99diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh
100index 4511275d6f193c9f8ba90b4cb89779727bc6a301..959390a31d56fcd4084c6570bf6903b87eb6546a 100644
101--- a/plugins/emotty/emotty.plugin.zsh
102+++ b/plugins/emotty/emotty.plugin.zsh
103@@ -10,6 +10,11 @@
104 # % export emotty_set=nature
105 # ------------------------------------------------------------------------------
106
107+# Handle $0 according to the standard:
108+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
109+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
110+0="${${(M)0:#/*}:-$PWD/$0}"
111+
112 typeset -gAH _emotty_sets
113 local _emotty_plugin_dir="${0:h}"
114 source "$_emotty_plugin_dir/emotty_stellar_set.zsh"
115diff --git a/plugins/fnm/fnm.plugin.zsh b/plugins/fnm/fnm.plugin.zsh
116index c161b27cd5056af8a9b3cbaea9edc3d4f3093e31..a5b0d090020cb96ff94b34a3c5bf81abad9449ae 100644
117--- a/plugins/fnm/fnm.plugin.zsh
118+++ b/plugins/fnm/fnm.plugin.zsh
119@@ -1,4 +1,9 @@
120 if (( $+commands[fnm] )); then
121+ # Handle $0 according to the standard:
122+ # # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
123+ 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
124+ 0="${${(M)0:#/*}:-$PWD/$0}"
125+
126 # remove old generated completion file
127 command rm -f "${0:A:h}/_fnm"
128
129diff --git a/plugins/gh/gh.plugin.zsh b/plugins/gh/gh.plugin.zsh
130index 3e4cdee5ea961e8f5acf2fbd18a477f21c77db20..3092bfa4abedd00641f778b5b11bb83cad64f9ce 100644
131--- a/plugins/gh/gh.plugin.zsh
132+++ b/plugins/gh/gh.plugin.zsh
133@@ -1,5 +1,10 @@
134 # Autocompletion for the GitHub CLI (gh).
135 if (( $+commands[gh] )); then
136+ # Handle $0 according to the standard:
137+ # # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
138+ 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
139+ 0="${${(M)0:#/*}:-$PWD/$0}"
140+
141 # remove old generated completion file
142 command rm -f "${0:A:h}/_gh"
143
144diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh
145index a4c95247136b28d21be6854ce2858b1c80ddc71e..122542e65fe76fbe607b812e733196065d8bdc89 100644
146--- a/plugins/git-prompt/git-prompt.plugin.zsh
147+++ b/plugins/git-prompt/git-prompt.plugin.zsh
148@@ -1,3 +1,8 @@
149+# Handle $0 according to the standard:
150+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
151+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
152+0="${${(M)0:#/*}:-$PWD/$0}"
153+
154 __GIT_PROMPT_DIR="${0:A:h}"
155
156 ## Hook function definitions
157diff --git a/plugins/gitfast/gitfast.plugin.zsh b/plugins/gitfast/gitfast.plugin.zsh
158index 7b6b67e92448e917934350e06f8c95250ec826a4..f28e3808c2513e192237e0436889da487517708c 100644
159--- a/plugins/gitfast/gitfast.plugin.zsh
160+++ b/plugins/gitfast/gitfast.plugin.zsh
161@@ -1,3 +1,8 @@
162+# Handle $0 according to the standard:
163+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
164+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
165+0="${${(M)0:#/*}:-$PWD/$0}"
166+
167 source "${0:A:h}/git-prompt.sh"
168
169 function git_prompt_info() {
170diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh
171index d2c749bc3f900d92fa1c99f56a5b8c3f1d682987..bac2c3ab91aae39fb36e52f5e84576f9482e7102 100644
172--- a/plugins/history-substring-search/history-substring-search.plugin.zsh
173+++ b/plugins/history-substring-search/history-substring-search.plugin.zsh
174@@ -1,4 +1,8 @@
175-0=${(%):-%N}
176+# Handle $0 according to the standard:
177+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
178+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
179+0="${${(M)0:#/*}:-$PWD/$0}"
180+
181 source ${0:A:h}/history-substring-search.zsh
182
183
184diff --git a/plugins/hitchhiker/hitchhiker.plugin.zsh b/plugins/hitchhiker/hitchhiker.plugin.zsh
185index aeafaf01ef6e49a779737437f0609b05545f72f2..6d0e40052906a0ec304ebe1026b2bcd041db31cf 100644
186--- a/plugins/hitchhiker/hitchhiker.plugin.zsh
187+++ b/plugins/hitchhiker/hitchhiker.plugin.zsh
188@@ -1,3 +1,8 @@
189+# Handle $0 according to the standard:
190+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
191+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
192+0="${${(M)0:#/*}:-$PWD/$0}"
193+
194 HITCHHIKER_DIR="${0:h}/fortunes"
195
196 # Aliases
197diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh
198index 6a91be336491754238b685b151049c454ad4d28c..144c17ab2c40f64f5fd45e00a2795ca83afca280 100644
199--- a/plugins/macos/macos.plugin.zsh
200+++ b/plugins/macos/macos.plugin.zsh
201@@ -1,3 +1,8 @@
202+# Handle $0 according to the standard:
203+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
204+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
205+0="${${(M)0:#/*}:-$PWD/$0}"
206+
207 # Open the current directory in a Finder window
208 alias ofd='open_command $PWD'
209
210diff --git a/plugins/rustup/rustup.plugin.zsh b/plugins/rustup/rustup.plugin.zsh
211index 0ca745b7e76a137b43ba3aa51a9a4787248b1653..698c081e50f0f99dd48ea635897dc95808e84712 100644
212--- a/plugins/rustup/rustup.plugin.zsh
213+++ b/plugins/rustup/rustup.plugin.zsh
214@@ -1,8 +1,12 @@
215 print ${(%):-'%F{yellow}The `rustup` plugin is deprecated and has been moved to the `rust` plugin.'}
216 print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'}
217
218+# TODO: 2021-12-28: remove this block
219+# Handle $0 according to the standard:
220+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
221+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
222+0="${${(M)0:#/*}:-$PWD/$0}"
223 # Remove old generated completion file
224-# TODO: 2021-12-28: remove this line
225 command rm -f "${0:A:h}/_rustup"
226
227 (( ${fpath[(Ie)$ZSH/plugins/rust]} )) || {
228diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
229index 0ea3aa02a04e17b6fd1ffaf48b7b0370d7eaed11..648d12bbf56bb716c060c698fa5fa4ccc4be69b4 100644
230--- a/plugins/tmux/tmux.plugin.zsh
231+++ b/plugins/tmux/tmux.plugin.zsh
232@@ -46,6 +46,11 @@ else
233 export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
234 fi
235
236+# Handle $0 according to the standard:
237+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
238+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
239+0="${${(M)0:#/*}:-$PWD/$0}"
240+
241 # Set the correct local config file to use.
242 if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$ZSH_TMUX_CONFIG" ]]; then
243 export ZSH_TMUX_CONFIG
244diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh
245index 87d1d085874756a47425c058a5e77d8fdffd196e..222a1483a1a596defb466314c81b6a78fb483e97 100644
246--- a/plugins/wd/wd.plugin.zsh
247+++ b/plugins/wd/wd.plugin.zsh
248@@ -7,4 +7,9 @@
249 #
250 # @github.com/mfaerevaag/wd
251
252+# Handle $0 according to the standard:
253+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
254+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
255+0="${${(M)0:#/*}:-$PWD/$0}"
256+
257 eval "wd() { source '${0:A:h}/wd.sh' }"
258diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh
259index 96abee890f9ed2fa2666a709cb8f33b8322c369d..7ce13afa76e91d14af9e589a578bd73993c2e3f3 100644
260--- a/plugins/z/z.plugin.zsh
261+++ b/plugins/z/z.plugin.zsh
262@@ -1 +1,6 @@
263+# Handle $0 according to the standard:
264+# # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
265+0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
266+0="${${(M)0:#/*}:-$PWD/$0}"
267+
268 source "${0:h}/z.sh"
269diff --git a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
270index 85ce87ca461d0ed070fdffb50aaa49ce618ef0b3..54c819810de514e5a4ecce3e3e8a2016daf55b63 100644
271--- a/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
272+++ b/plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
273@@ -11,6 +11,7 @@
274 # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
275 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
276 0="${${(M)0:#/*}:-$PWD/$0}"
277+
278 export ZNT_REPO_DIR="${0:h}"
279 export ZNT_CONFIG_DIR="$HOME/.config/znt"
280