SoloVim/snippets/typst.lua
Kristofers Solo f5c52bcc9d
Update 2025-10-31
update 2025-10-08

chore: update readme

Update 2025-10-09

Update 2025-10-15

Update 2025-10-22

Update 2025-10-31
2025-10-31 11:59:53 +02:00

34 lines
704 B
Lua

---@diagnostic disable: undefined-global
return {
s(
{ trig = "([^%s]+)t", name = "Superscript", regTrig = true },
fmta("(<>)^(<>)", {
f(function(_, snip)
return snip.captures[1]
end),
i(0),
})
),
s(
{ trig = "([^%s]+)b", name = "Subscript", regTrig = true },
fmta("(<>)_(<>)", {
f(function(_, snip)
return snip.captures[1]
end),
i(0),
})
),
s(
{ trig = "([^%s]+)r", name = "Root", regTrig = true },
fmta("sqrt(<>)", {
f(function(_, snip)
return snip.captures[1]
end),
})
),
}, { -- autosnippets
s({ trig = "mt", name = "Math Block" }, fmta("$<>$", { i(1) })),
s({ trig = "mmt", name = "Multiline Math Block" }, fmta("$ <> $", { i(1) })),
}