Replies: 1 comment 3 replies
-
You can check if |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a plugin that is not declared as
module=false
. But in certain part of the spec, I may want to "attempt to require" the plugin,but if not exist, don't let
lazy.nvim
to auto-load that module. I wonder if it is doable with somelazy.core
functions.To be specific about my use case: I have both
cmp
andluasnip
lazy-loaded atInsertEnter
.I think
luasnip
may be useful elsewhere beforeInsertEnter
so I don't want to declaremodule=false
(Or correct me if I'm wrong!)Now I am writing my statusline (
heirline
), and I want to put an indicator if I am inside a snippet (usingluasnip
's.jumpable()
).But inside this specific statusline config. I want to "attempt to require luasnip, and only show this indicator if luasnip is loaded AND it's jumpable". If luasnip is not loaded, it means I haven't entered insert mode yet, and the indicator is simply turned off. luasnip is not auto-loaded by this specific
pcall(require, ..)
.P.S. The
lazy.core
seems undocumented, but many helper functions are quite useful, and is also used by LazyVim. I borrowed some codes there in my config, but I would love to have a documentation of the core functions. Is there a plan to document them, or is there an existing doc that I missed?Beta Was this translation helpful? Give feedback.
All reactions