nvf/modules/plugins/snippets/luasnip/config.nix
2024-10-22 12:59:56 +02:00

28 lines
546 B
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.snippets.luasnip;
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins = {
luasnip = {
package = "luasnip";
lazy = true;
after = cfg.loaders;
};
cmp-luasnip = mkIf config.vim.autocomplete.nvim-cmp.enable {
package = "cmp-luasnip";
lazy = true;
};
};
startPlugins = cfg.providers;
autocomplete.nvim-cmp.sources = {luasnip = "[LuaSnip]";};
};
};
}