How does cond work, exactly? #522
Replies: 2 comments
-
You can pass a list to Cond is evaluated at the time a plugin is loaded. Loaded because lazy is false, or because one of the lazy handlers kicked in. When the condition returns false at that point, the plugin is not loaded. |
Beta Was this translation helpful? Give feedback.
-
i've tried with
Thank you, i find this clearer than what is on the readme. |
Beta Was this translation helpful? Give feedback.
-
I've been going through discussions and a number of issues where the reply is always "that's not how cond works" or something along those lines.
In the interest of not having my coding plugins load during my non coding moments with nvim (i write a ton of prose and emails and other such) i've been trying to set certain plugins to load on filetype.
I've tried using
ft
, but as per the docs, i can't seem to pass a list to it so that was out of the question.Then i tried writing a function that returns true if the value of
vim.api.nvim_buf_get_option(0, 'filetype')
matched one of the values on my list and passing that tocond
.I'll be the first to admit my code is all kinds of janky, but even that seems like it should have worked, but it didn't.
And that brings me to the title of my question. Am i missing something here? Am i going about this the right way or is there a better one?
Beta Was this translation helpful? Give feedback.
All reactions