diff --git a/modules/plugins/snippets/luasnip/config.nix b/modules/plugins/snippets/luasnip/config.nix index 927b21fd..60a5ca6d 100644 --- a/modules/plugins/snippets/luasnip/config.nix +++ b/modules/plugins/snippets/luasnip/config.nix @@ -9,12 +9,12 @@ in { config = mkIf cfg.enable { vim = { - lazy.plugins = { - luasnip = { - package = "luasnip"; - lazy = true; - after = cfg.loaders; - }; + lazy.plugins.luasnip = { + package = "luasnip"; + event = "BufEnter"; + after = cfg.loaders; + setupModule = "luasnip"; + inherit (cfg) setupOpts; }; startPlugins = cfg.providers; autocomplete.nvim-cmp = { diff --git a/modules/plugins/snippets/luasnip/luasnip.nix b/modules/plugins/snippets/luasnip/luasnip.nix index d9563a5b..edfd72b9 100644 --- a/modules/plugins/snippets/luasnip/luasnip.nix +++ b/modules/plugins/snippets/luasnip/luasnip.nix @@ -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" {}; }; }