You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
604 B
Lua
35 lines
604 B
Lua
2 years ago
|
---@diagnostic disable: undefined-global
|
||
|
|
||
|
return {
|
||
|
|
||
|
s("testluasnip", {
|
||
|
t"Hello lua snippet"
|
||
|
}),
|
||
|
|
||
|
|
||
|
-- repeat nodes
|
||
|
-- TODO: split dot and pull last name
|
||
|
s("req", fmt("local {} = require('{}')", {
|
||
|
i(1, "default"),
|
||
|
rep(1)
|
||
|
}) ),
|
||
|
|
||
|
s("ifreq", fmt([[
|
||
|
local ok, {} = pcall(require, "{}")
|
||
|
if not ok then
|
||
|
vim.notify("missing module {}", vim.log.levels.WARN)
|
||
|
return
|
||
|
end
|
||
|
{}
|
||
|
]], {
|
||
|
i(1),
|
||
|
rep(1),
|
||
|
rep(1),
|
||
|
i(0)
|
||
|
})
|
||
|
|
||
|
),
|
||
|
|
||
|
|
||
|
}
|