From e80ed322a79a8b9857c6ab0ad76545654917ddcb Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 14 Jul 2024 18:19:28 +0200 Subject: [PATCH] perf(luasnip): luasnip wasn't lazyloaded (#4032) ## Description this makes the extra luasnip lazy load at the same time as nvim cmp. just putting `lazy = true` works because `nvim-cmp` when being loaded with `InsertEnter` also load `cmp-luasnip`, which itself load `LUASNIP`. you can see the problem in the following discussion https://github.com/LazyVim/LazyVim/discussions/3966 where luasnip was not lazy loaded when starting lazyvim. This was also loading nvim-cmp and all its dep when starting lazyvim, which negatively impacted performance. ## Related Issue(s) https://github.com/LazyVim/LazyVim/discussions/3966 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/luasnip.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/luasnip.lua b/lua/lazyvim/plugins/extras/coding/luasnip.lua index f0aadc4f..47bd80c4 100644 --- a/lua/lazyvim/plugins/extras/coding/luasnip.lua +++ b/lua/lazyvim/plugins/extras/coding/luasnip.lua @@ -1,6 +1,7 @@ return { { "L3MON4D3/LuaSnip", + lazy = true, build = (not LazyVim.is_win()) and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" or nil,