nvim: refactor luasnip as plugin

luasnip works better as a plugin and not a ftplugin
This commit is contained in:
Primrose 2025-08-09 09:00:25 +02:00
parent 6062f0313b
commit c8e4bcc675
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 44 additions and 64 deletions

View file

@ -1,21 +1 @@
vim.bo.expandtab = false
local once = require("once")
once.test_and_load("ft_go", function()
local luasnip = require("luasnip")
local s = luasnip.snippet
local t = luasnip.text_node
local cr = function() return t { "", "" } end
local i = luasnip.insert_node
luasnip.add_snippets("go", {
s("ie", {
t("if err != nil {"),
cr(),
t("\t"),
i(0),
cr(),
t("}"),
}),
})
end)