Open psprint opened 6 years ago
I've created a PR with partial implementation (the most important parts) of the standard: #124.
Hi @psprint,
I've forked zgen (see zgenom).
I'd like to support the zsh plugin standard
but I'm not really sure of the benefit of most "rules".
$ZERO
why not just use $0
?$LOADED_PLUGINS
👍 $ZPFX
zgenom doesn't support hooks, what is the benefit of setting ZPFX when the hooks aren't used anyways?*_unload
zgenom doesn't allow to unload plugins.
Hello! There's attempt of mine to write down and clarify Zsh plugin standard. It follows Oh-My-Zsh unwritten standard, but solves a few issues like:
*_argzero
options likeno_function_argzero
.For a plugin manager, a short list of needed changes is:
ZERO
parameter at plugin load time, equal to path to sourced script ($0
from within the script).LOADED_PLUGINS
array to hold strings "user/plugin" of loaded plugins and the plugin being currently loaded.ZPFX
to a prefix-like directory (/usr
,/usr/local
,/opt
are examples of such directories). Zplug and Zplugin can do build-hooks and run Makefiles, providingZPFX
allows consistent and short hook-code.*_unload
function if it's provided, if user requests plugin unload.Zgen architecture is about generating script with sequence of
source
commands. With above commands, the script could look like:I've sent a patch to Zsh and it was accepted, it uses
realloc()
for array appends and is faster than previous code anywhere in 10 to 1000 times, so I think there's no pain of lowering zgen's excellent performance. ZERO will release programmers' will to do tricks. So for example zgen could issue:$ZPFX
hints that despite performance-centered architecture of Zgen, it can still do build-time (installation, update) hooks and make use of$ZPFX
(to run e.g.make PREFIX=$ZPFX install
).Does this make sense to you? Maybe you have ideas for extensions or modifications for the standard? It is located here:
http://zdharma.org/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
PRs can be submitted here.