22 lines
647 B
Lua
22 lines
647 B
Lua
local ls = require("luasnip")
|
|
local s, i = ls.s, ls.insert_node
|
|
local fmt = require("luasnip.extras.fmt").fmt
|
|
|
|
-- NOTE: this is not working right now, i need to RTFM
|
|
ls.filetype_extend("javascript", { "javascriptreact", "javascript.jsx" })
|
|
ls.filetype_extend("typescript", { "typescriptreact", "typescript.jsx" })
|
|
|
|
local clg = s(
|
|
"clg",
|
|
fmt([[console.log({});]], {
|
|
i(0),
|
|
})
|
|
)
|
|
|
|
ls.add_snippets("javascript", { clg })
|
|
ls.add_snippets("typescript", { clg })
|
|
ls.add_snippets("svelte", { clg })
|
|
|
|
-- NOTE: i commented this line because its taking a very long time to require and i don't use it
|
|
-- require("luasnip.loaders.from_vscode").load()
|