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

lib/options: lib/neovim-plugin: Add lazyLoad option to plugins #1866

Closed
wants to merge 8 commits into from

Conversation

psfloyd
Copy link
Contributor

@psfloyd psfloyd commented Jul 15, 2024

This PR works on a solution for the issue #421.

Already implemented

  • Adding mkLazyLoadOption to generate lazyLoad options for plugins.
  • Adding and implementing a lazy-loading mechanism using lz.n
  • Conditionally enabling lazy or regular loading depending on user settings in mkNeovimPlugin

Planned

  • For plugins that do not callSetup, extract extraConfigLua from extraConfig.
  • Integrate with mkVimPlugin

This function will be used to generate lazyLoad options for plugins.
It is defined in options for later use in mkNeovimPlugin.
Uses options defined by mkLazyLoadOption.
Using mkLazyLoadOption generate lazyLoad option for all plugins
generated using mkNeovimPlugin.
Plugin maintainers can opt out by setting `allowLazyLoad = false`.
Plugin maintainers can provide default vaules by setting option in
lazyLoad.
Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, I'm sure many people will be pleased to see progress here!

I haven't taken a proper look yet, but I left some comments below.

  • Would it be possible to extract parts of this into smaller PRs?
    • E.g. initializing plugins.lz-n could be its own PR.
  • Would it be possible for mkLazyLoadOption to work with either plugins.lz-n or plugins.lazy based on user preference?

lib/neovim-plugin.nix Show resolved Hide resolved
lib/neovim-plugin.nix Show resolved Hide resolved
lib/neovim-plugin.nix Show resolved Hide resolved
lib/neovim-plugin.nix Show resolved Hide resolved
lib/neovim-plugin.nix Show resolved Hide resolved
@psfloyd
Copy link
Contributor Author

psfloyd commented Jul 16, 2024

Thank you for your review!

  • Would it be possible to extract parts of this into smaller PRs?

    • E.g. initializing plugins.lz-n could be its own PR.

Yes, I am going to make a PR for lz-n, and use that PR as base for the lazyLoad options

  • Would it be possible for mkLazyLoadOption to work with either plugins.lz-n or plugins.lazy based on user preference?

Yes, I think it should be possible. I could add a backend option to select which one to use. But I don't think it should be set on a per plugin basis.
Should we add a global config.lazyLoader option with global parameters for lazy-loading?
On that namespace we could add an enable option and apply it to the corresponding backend.

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

Successfully merging this pull request may close these issues.

3 participants