From 21c920be35b204705a25096b5c0ec1d908eb180d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 28 Jul 2025 00:24:57 +0200 Subject: [PATCH] nvim/haskell: lazy load snippet only once --- .config/nvim/ftplugin/haskell.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.config/nvim/ftplugin/haskell.lua b/.config/nvim/ftplugin/haskell.lua index 29240dcf..744ccd73 100644 --- a/.config/nvim/ftplugin/haskell.lua +++ b/.config/nvim/ftplugin/haskell.lua @@ -4,6 +4,9 @@ opts.matchit_let_in() vim.bo.shiftwidth = 2 vim.bo.expandtab = true -local luasnip = require("luasnip") -local haskell_snippets = require("haskell-snippets").all -luasnip.add_snippets("haskell", haskell_snippets, { key = "haskell" }) +local once = require("once") +once.test_and_load("ft_haskell", function() + local luasnip = require("luasnip") + local haskell_snippets = require("haskell-snippets").all + luasnip.add_snippets("haskell", haskell_snippets, { key = "haskell" }) +end)