What triggers lazy loading? #1713
Replies: 1 comment 1 reply
-
This is not true. In
No. Specifying one of the lazy loading triggers,
Yes and no. If you simply have: { "stevearc/oil.nvim", lazy = true }, And try to use But if you: { "stevearc/oil.nvim", cmd = "Oil" }, Now I'm not entirely sure what you mean by the last question. But Neovim plugin ecosystem can be quite confusing for beginners. I recommend finish reading these docs: |
Beta Was this translation helpful? Give feedback.
-
I can't completely wrap my head around what "lazy loading" is in the contexts of neovim. From what I understand it triggers the plugin modules to be loaded into RAM. This would happen on the specified
event
triggers returned in dictionaries from our plugins.lua. On the other hand sometimes werequire()
a plugin.From the Readme I got this:
Q1: Does this mean that without the
lazy
option the plugins will never be lazy loaded on nvim startup even though an event is set (is it ignored)?Now I have some keymappings defined, one for example triggers the command
:Oil
from oil.nvim. Am I right to assume that this call would shortcircuit or error if oil was not loaded at that point? Or Q2: does a keymapp invocation also trigger the lazy loading somehow?Let's then say in one plugin file I
require
plugin Y as a dependency, while in another file I require Y directly, but I load lazily. Q3: When will Y now be loaded and what will be it's configuration? If I userequire.setup({a=1})
andrequire("Y").setup({b=1})
respectively, will the two configs be merged? Is there an intermediary state where only a=1 is present and b=1 is not set yet?I'm thankful for every hint I can get!
Beta Was this translation helpful? Give feedback.
All reactions