-
I was looking over the ways to load a plugin, and I noticed that we can use a function as the event handler. The docs say the signature is: Here is an example of how I've tried it before (with a different plugin; {
'tadmccorkle/markdown.nvim',
event = function(_plugin, event)
-- special logic here.
end,
opts = {
-- configuration here or empty for defaults
},
} Are there any examples of how to use the function as the event handler? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That second event parameter are event specs that were defined earlier in another spec for the same plugin. This is mostly relevant for distros like LazyVim, where users may want to override options etc for plugins. For your use case it would indeed always be empty |
Beta Was this translation helpful? Give feedback.
For now, this is the solution that I came up with: