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

Consider allowing custom annotations #12

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

Consider allowing custom annotations #12

mattmc3 opened this issue Mar 14, 2022 · 2 comments
Labels
idea A possible future feature

Comments

@mattmc3
Copy link
Owner

mattmc3 commented Mar 14, 2022

Currently, we support a handful of annotations for common usages. However, we could allow users to add 'hooks' or custom annotations for custom Zsh output. Something like custom:myfunc so that a user could define myfunc to emit whatever custom Zsh init code they want. That would let you get fancy with plugin management without adding bloat for every annotation scenario to antidote.

@mattmc3 mattmc3 added the idea A possible future feature label Mar 14, 2022
@zhengpd
Copy link

zhengpd commented May 12, 2022

Hook/callback function support would be really useful for deferred plugins setup, for example, configuring specific options which are only available after the deferred plugin is sourced.

@mattmc3 mattmc3 changed the title Consider allowing for custom annotations Consider allowing custom annotations Sep 1, 2022
@mattmc3
Copy link
Owner Author

mattmc3 commented Aug 21, 2023

Just to clarify where we're at with this feature.

pre:before_func and post:after_func annotations exist, and should be sufficient for 90% of what someone would need a hook for. As an example, if you bundle with the pre/post annotations, functions you define get called:

$ antidote bundle zsh-users/zsh-autosuggestions pre:do_before_autosuggest post:do_after_autosuggest
do_before_autosuggest
fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions )
source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
do_after_autosuggest

What remains of this feature is determining if there's any value in any of the other potential hooks:

  • pre/post install (clone)
  • pre/post update
  • pre/post remove

It would help to have a user with a specific use-case where these are strictly necessary. Since antibody didn't implement anything like this, understanding a use-case from antigen/zinit might be helpful, as well as pointing to a specific plugin that requires this additional feature.

See also: #67

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea A possible future feature
Projects
None yet
Development

No branches or pull requests

2 participants