See :h lua-plugin-lazy
- Keep
plugin/<name>.lua small, avoid eagerly calling require() on modules
until a command or mapping is actually used.
So I think what would be ideal for startuptime would be this:
Question: I've always wondered what the effect of requiring the same lua module on every use of the command is, but based on everything I've read, that's how it should be done?
See
:h lua-plugin-lazySo I think what would be ideal for startuptime would be this:
require(...)is the usercommandRegisterEditorplugin/registereditor.luais to create the usercommandrequire(...)Question: I've always wondered what the effect of
requiring the same lua module on every use of the command is, but based on everything I've read, that's how it should be done?