Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support antidote use syntax like antigen does #15

Open
mattmc3 opened this issue Mar 28, 2022 · 2 comments
Open

Support antidote use syntax like antigen does #15

mattmc3 opened this issue Mar 28, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@mattmc3
Copy link
Owner

mattmc3 commented Mar 28, 2022

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:

  • Clone repo as normal if it's a repo
  • No need to do anything yet if it's a dir
  • Source anything in the repo's lib dir
  • Add the repo's plugins dir to a list of use paths
  • Future bundle statements will look for single word bundles in the list of use paths
@mattmc3 mattmc3 added the enhancement New feature or request label Mar 28, 2022
@mattmc3
Copy link
Owner Author

mattmc3 commented Nov 29, 2023

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
Copy link
Owner Author

mattmc3 commented Mar 7, 2024

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:

  • :custom - load plugin from $ZSH_CUSTOM
  • :prezto - load plugin from sorin-ionescu/prezto
  • :ohmyzsh - load plugin from ohmyzsh/ohmyzsh
  • :zephyr - load plugin from mattmc3/zephyr
  • And allow user-defined ones.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant