kickstart.nvim/lua/snippets/lua.lua

21 lines
483 B
Lua
Raw Normal View History

2024-12-25 18:35:17 +08:00
require('luasnip.session.snippet_collection').clear_snippets()
ls.add_snippets('lua', {
s('func', {
t 'function() ',
i(1),
t ' end',
}),
s('if', {
t 'if ',
i(1, 'true'),
t ' then ',
i(2),
t ' end',
}),
})
-- Return false to invalidate cache entry for require()
-- This is so sourcing snippets/init.lua also "reloads" this file
-- https://stackoverflow.com/questions/72242451/sourcing-nvim-init-does-not-source-required-lua-files
return false