Skip to content

Use vim commands (not user defined) to lazy-load using cmd #476

Answered by wbthomason
ichigo-gyunyu asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@ichigo-gyunyu
Comment options

@AckslD
Comment options

@ichigo-gyunyu
Comment options

@wbthomason
Comment options

@AckslD
Comment options

Answer selected by ichigo-gyunyu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants