diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 62e83a0e..2e0dcf6d 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -51,4 +51,5 @@ - Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes issue with setting the workspace directory. +- Add `vim.snippets.luasnip.setupOpts`, which was previously missing. - Add `"prettierd"` as a formatter option in `vim.languages.markdown.format.type`. diff --git a/modules/plugins/snippets/luasnip/config.nix b/modules/plugins/snippets/luasnip/config.nix index 927b21fd..b05f9f27 100644 --- a/modules/plugins/snippets/luasnip/config.nix +++ b/modules/plugins/snippets/luasnip/config.nix @@ -9,12 +9,15 @@ in { config = mkIf cfg.enable { vim = { - lazy.plugins = { - luasnip = { - package = "luasnip"; - lazy = true; - after = cfg.loaders; - }; + lazy.plugins.luasnip = { + package = "luasnip"; + + lazy = true; + + setupModule = "luasnip"; + inherit (cfg) setupOpts; + + after = cfg.loaders; }; startPlugins = cfg.providers; autocomplete.nvim-cmp = { diff --git a/modules/plugins/snippets/luasnip/luasnip.nix b/modules/plugins/snippets/luasnip/luasnip.nix index d9563a5b..6b189b61 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,9 @@ in { ``` ''; }; + + setupOpts = mkPluginSetupOption "LuaSnip" { + enable_autosnippets = mkEnableOption "autosnippets"; + }; }; }