mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
nvim/golang: lazy load snippets only once
This commit is contained in:
parent
d0fdbc5f34
commit
088c91531d
1 changed files with 8 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
vim.bo.expandtab = false
|
||||
|
||||
do
|
||||
local once = require("once")
|
||||
once.test_and_load("ft_go", function()
|
||||
local luasnip = require("luasnip")
|
||||
local s = luasnip.snippet
|
||||
local t = luasnip.text_node
|
||||
|
|
@ -9,9 +10,12 @@ do
|
|||
|
||||
luasnip.add_snippets("go", {
|
||||
s("ie", {
|
||||
t("if err != nil {"), cr(),
|
||||
t("\t"), i(0), cr(),
|
||||
t("if err != nil {"),
|
||||
cr(),
|
||||
t("\t"),
|
||||
i(0),
|
||||
cr(),
|
||||
t("}"),
|
||||
}),
|
||||
})
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue