-
Notifications
You must be signed in to change notification settings - Fork 414
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: Support sub plugins. (Not about sub directory) #1836
Comments
Basicly, a |
it's not possible to just load a subdirectory so I'm quite sure lazy won't implement this |
yeah, not interested in this. Closing... |
It's not about loading subdirectory, it's about allowing plugin spec with only |
Old version or lazy.nvim actually did provide this behavior, but it has broken by the latest version of forcing to check dir / url / dev. Which is unnecessary, lazy.nvim doesn't need to know where the plugin located. Since user promise it already in |
Every plugin eventually needs a |
The fact that that used to work was simply a bug. However, I just added support for virtual plugins. I did a quick skim for all the places that use You can use it like the example below. You can of course use any of the other plugin spec fields like {
"foobar",
event = "VeryLazy",
virtual = true,
config = function()
vim.notify("foo")
end,
} |
Oh I didn't refresh my browser and sorry for changing issue name, I didn't know it would be solved that fast. Thanks. |
🤖 I have created a release *beep* *boop* --- ## [11.16.0](v11.15.0...v11.16.0) (2024-12-07) ### Features * **plugin:** added support for virtual plugins. Closes [#1836](#1836) ([ee64abc](ee64abc)) ### Bug Fixes * **plugin:** don't check if dir exists for virtual plugins ([656cf43](656cf43)) * **render:** show correct key for home. Fixes [#1796](#1796) ([b08dba8](b08dba8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Did you check the docs?
Is your feature request related to a problem? Please describe.
In this plugin structure, hc-nvim, hc-func, hc-substitute has to separates to 3 plugins to set it's lazy load stratagy.
mini.nvim has similar plugin structure, which means each mini.nvim's sub plugin can't utilize lazy.nvim's lazy load mechanism. and splitery is required too.
Describe the solution you'd like
Allow lazy.nvim load plugins that only has
main
field, and in this situation, lazy.nvim tries to require(plugin.main) to get module, and only throw error whenmain
coresponds module not exsist.e.g. using mini.nvim
This feature is usful for user writing local plugins on stdpath("config"), without worry about lazy failed on finding them.
And allow user to utilize lazy.nvim's lazy load feture to manage user configurations.
~/.config/nvim/lua/user/init.lua
~/.config/nvim/init.lua
For neovim distro that parasitic on lazy.nvim. it is also usful to manage how different part to be load, e.g. LazyVim has different module, each could has its trigger event, but currently LazyVim just load it all on init.
Describe alternatives you've considered
pass
Additional context
In my configuration hc-nvim, I wish my sub plugin hc-func and hc-substitute could lazy load too. And I don't want to create a bunch of repo for each sub plugin like mini.nvim.
The text was updated successfully, but these errors were encountered: