snippets/luasnip: add setupOpts

Also fixed a bug where the plugin previously would not get loaded, as
lazy was set to true without a trigger event.
This commit is contained in:
LilleAila 2025-01-11 14:02:21 +01:00
parent 4df1cc3a7f
commit 98a7959047
No known key found for this signature in database
GPG key ID: D1ACCDCF2B9B9799
2 changed files with 9 additions and 7 deletions

View file

@ -9,12 +9,12 @@
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins = {
luasnip = {
lazy.plugins.luasnip = {
package = "luasnip";
lazy = true;
event = "BufEnter";
after = cfg.loaders;
};
setupModule = "luasnip";
inherit (cfg) setupOpts;
};
startPlugins = cfg.providers;
autocomplete.nvim-cmp = {

View file

@ -1,7 +1,7 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption literalExpression literalMD;
inherit (lib.types) listOf lines;
inherit (lib.nvim.types) pluginType;
inherit (lib.nvim.types) pluginType mkPluginSetupOption;
in {
options.vim.snippets.luasnip = {
enable = mkEnableOption "luasnip";
@ -32,5 +32,7 @@ in {
```
'';
};
setupOpts = mkPluginSetupOption "LuaSnip" {};
};
}