Skip to content

Commit

Permalink
Merge pull request #549 from LilleAila/luasnip-setupOpts
Browse files Browse the repository at this point in the history
snippets/luasnip: add setupOpts
  • Loading branch information
NotAShelf authored Jan 12, 2025
2 parents a5a5aba + fedbee3 commit 520a065
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
15 changes: 9 additions & 6 deletions modules/plugins/snippets/luasnip/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 5 additions & 1 deletion modules/plugins/snippets/luasnip/luasnip.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -32,5 +32,9 @@ in {
```
'';
};

setupOpts = mkPluginSetupOption "LuaSnip" {
enable_autosnippets = mkEnableOption "autosnippets";
};
};
}

0 comments on commit 520a065

Please sign in to comment.