kickstart.nvim/lua/snippets/c-cpp.lua

25 lines
522 B
Lua
Raw Normal View History

2024-12-25 18:35:17 +08:00
print 'c-cpp init'
ls.add_snippets('c', {
s('fn', {
i(1, 'void'),
t ' ',
i(2, 'func_name'),
t '(',
i(3),
t ') ',
t '{ ',
i(4, '...'),
t ' }',
}),
s('test', {
t 'printf("',
i(1),
t '");',
}),
})
ls.filetype_extend('cpp', { 'c' })
-- 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