mattmc3 / antidote

https://getantidote.github.io - the cure to slow zsh plugin management
MIT License
846 stars 21 forks source link

Support `antidote use` syntax like antigen does #15

Open mattmc3 opened 2 years ago

mattmc3 commented 2 years ago

Antigen allows you to use antigen use for frameworks like Oh-My-Zsh. Antibody abandoned this in favor of not treating frameworks in any special way, but I think this can easily be implemented in Antidote without framework specific code. Simply, antidote use ohmyzsh/ohmyzsh and have it then let you bundle plugin_name with an implementation of:

mattmc3 commented 9 months ago

The problem implementing this remains the static file. If you use ohmyzsh/ohmyzsh and also use myprojects/zsh_custom, overriding what plugin is used gets tricky since a user could add/remove a plugin in zsh_custom at any time and the static file wouldn't know it. Adding logic to the static file would slow down the load. The complexity outweighs the convenience, but I may still revisit this if I ever come up with a clever way around this problem.

mattmc3 commented 6 months ago

This one's been tumbling around in my brain for awhile because I don't want to implement this wrong and then regret it later and have features I'm stuck with. I think the simple solution to use ohmyzsh/ohmyzsh followed by use $ZSH_CUSTOM is simply that only one is in effect at a time, so you can only override, not have fallbacks. That also gets messy if load order matters because you might have to flip-flop between use statements.

Another option is to support :command statements, which then becomes a shortcut for something other than antidote-script.

Examples might be:

So instead of...

### .zsh_plugins.txt
:use ohmyzsh/ohmyzsh
extract
git
history

...you could also do...

### .zsh_plugins.txt
:ohmyzsh extract
:ohmyzsh git
:ohmyzsh history

Or, we just leave things as-is, which is a working setup. None of these options feels clean, and it all adds (perhaps unnecessary) complexity. Not ready yet to implement this.

Regardless, the important callout is the static file would need to operate without any reliance on antidote functions being loaded - these :commands would just change how bundling works.