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

feature: add non-plugin-dependencies in plugin spec #1264

Closed
1 task done
chrisgrieser opened this issue Jan 12, 2024 · 5 comments
Closed
1 task done

feature: add non-plugin-dependencies in plugin spec #1264

chrisgrieser opened this issue Jan 12, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@chrisgrieser
Copy link

Did you check the docs?

  • I have read all the lazy.nvim docs

Is your feature request related to a problem? Please describe.

lazy.nvim encourages you to put everything related to a plugin into the plugin spec, which makes the config much cleaner.

However, one thing not being "bundled" in the plugin spec are the non-plugin dependencies of a plugin. Those are, for example:

  • debugpy for nvim-dap-python
  • gh for octo.nvim
  • jq for rest.nvim

Describe the solution you'd like

Simply stipulating that some key, e.g. extra_dependencies or non_plugin_dependencies should be used for this would already be enough. It wouldn't need to be lazy's job to install them (mason.nvim can do that), it would just need a "standardized" key.

Simply adding a row to the docs, defining that a certain key is to be used/reserved to list non-plugin-dependencies could already fulfill this FR; the rest would be up to other plugin devs. (similar to build.lua)

Describe alternatives you've considered

It is of course possible to manually add some key, e.g. masonDependencies to the plugin spec, and then get all those dependencies via require("lazy").plugins().

However, simply stipulating a plugin spec key would help in standardizing this and thus enable, so plugin devs would be more incentivized simply all use that one key prescribed by lazy.nvim.

Additional context

Having a way to express those dependencies in the plugin spec would be consistent with lazy.nvim's philosophy of bundling everything in the spec, make a plugin config more transparent, and also allow other plugins like for example mason with mason-tools-installer to add features to auto-install this those packages. (all the examples I listed are already available via mason).

This would, ultimately, make nvim configs a bit easier to set up for new users, and also make it a nvim config fully bootstrappable on a new machine.

@chrisgrieser chrisgrieser added the enhancement New feature or request label Jan 12, 2024
@Shougo
Copy link

Shougo commented Jan 12, 2024

@chrisgrieser
Copy link
Author

chrisgrieser commented Jan 12, 2024

My FR is about being able to define non-plugin-dependencies. I fail to see how this is related to cond, which is about setting a condition when the plugin should be loaded.

@Shougo
Copy link

Shougo commented Jan 12, 2024

cond can check the dependency.

@chrisgrieser
Copy link
Author

chrisgrieser commented Jan 12, 2024

This FR is not about conditions for enabling plugins...

@folke
Copy link
Owner

folke commented Jan 20, 2024

Out of scope of lazy.nvim, but related to pkg.json.
Closing in favor of #910

@folke folke closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2024
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

3 participants