From e829a0964ac8a30d3b31c25a7d0ce2bed3761f59 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 21 Oct 2024 18:42:02 +0200 Subject: [PATCH] luasnip: lazy load --- modules/plugins/snippets/luasnip/config.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/plugins/snippets/luasnip/config.nix b/modules/plugins/snippets/luasnip/config.nix index 541fd0f..57a3c54 100644 --- a/modules/plugins/snippets/luasnip/config.nix +++ b/modules/plugins/snippets/luasnip/config.nix @@ -9,9 +9,19 @@ in { config = mkIf cfg.enable { vim = { - startPlugins = ["luasnip" "cmp-luasnip"] ++ cfg.providers; + 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]";}; - pluginRC.luasnip = cfg.loaders; }; }; }