Use vim commands (not user defined) to lazy-load using cmd #476
-
Hello, is it possible to lazy load using vim commands? When I try to add
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
In general, no; in this case, kind of. In general, we need to be able to make a "fake" command or rely on the However, in the specific case of |
Beta Was this translation helpful? Give feedback.
In general, no; in this case, kind of.
In general, we need to be able to make a "fake" command or rely on the
CmdUndefined
event happening in order to lazy-load on a command. For built-in commands, as you've discovered, this is not possible (as far as I'm aware).However, in the specific case of
:write
(and a few other built-in commands), you can instead lazy-load on the event (e.g.BufWrite
) that will happen when the command is run, thereby indirectly lazy-loading on the command.