nvim-config-kickstart/luasnippets/tex.lua

69 lines
1.3 KiB
Lua
Raw Normal View History

2024-05-14 10:09:20 +00:00
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local d = ls.dynamic_node
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local rep = require("luasnip.extras").rep
return {
s({ trig = "frame", dscr = "Insert a beamer frame" },
2024-05-14 10:09:20 +00:00
fmta(
[[
\begin{frame}{<>}
<>
\end{frame}
]],
{
i(1, "title"),
i(2, "content")
}
)
),
2024-05-14 10:13:11 +00:00
s({ trig = "block", dscr = "Insert a beamer block" },
2024-05-14 10:13:11 +00:00
fmta(
[[
\begin{block}{<>}
<>
\end{block}
]],
{
i(1, "title"),
i(2, "content")
}
)
),
2024-05-14 13:58:09 +00:00
s({ trig = "pp", dscr = "Insert a beamer pause" },
fmt("\\pause", {})
),
s({ trig = "ii", dscr = "Insert an item" },
fmt("\\item ", {})
),
2024-05-14 14:00:46 +00:00
s({ trig = "ss", dscr = "Insert a small skip" },
fmt("\\smallskip", {})
),
s({ trig = "ms", dscr = "Insert a medium skip" },
fmt("\\medskip", {})
),
s({ trig = "bs", dscr = "Insert a big skip" },
fmt("\\bigskip", {})
),
s({ trig = "tw", dscr = "Insert \\textwidth" },
fmt("\\textwidth", {})
),
s({ trig = "th", dscr = "Insert \\textheight" },
fmt("\\textheight", {})
),
2024-05-14 10:09:20 +00:00
}