88 lines
1.8 KiB
Lua
88 lines
1.8 KiB
Lua
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 = 'env',
|
|
name = 'Environment',
|
|
dscr = 'Creates generic \\begin{} \\end{} environment',
|
|
},
|
|
fmta(
|
|
[[
|
|
\begin{<>}
|
|
<>
|
|
\end{<>}
|
|
]],
|
|
{
|
|
i(1),
|
|
i(2),
|
|
rep(1),
|
|
}
|
|
)
|
|
),
|
|
s(
|
|
{
|
|
trig = 'frame',
|
|
name = 'Beamer Frame',
|
|
dscr = 'Frame environment for beamer slides',
|
|
},
|
|
fmta(
|
|
[[
|
|
\begin{frame}
|
|
\frametitle{<>}
|
|
<>
|
|
\end{frame}
|
|
]],
|
|
{
|
|
i(1),
|
|
i(2),
|
|
}
|
|
)
|
|
),
|
|
s(
|
|
{
|
|
trig = 'frame-fragile',
|
|
name = 'Frame Fragile',
|
|
dscr = 'Required for verbatim content like code listings.',
|
|
},
|
|
fmta(
|
|
[[
|
|
\begin{frame}[fragile]
|
|
\frametitle{<>}
|
|
<>
|
|
\end{frame}
|
|
]],
|
|
{
|
|
i(1),
|
|
i(2),
|
|
}
|
|
)
|
|
),
|
|
s(
|
|
{
|
|
trig = 'noindent',
|
|
name = 'No Indent',
|
|
dscr = 'Add no indent instructin for latexindent. Useful for code-blocks.'
|
|
},
|
|
fmta(
|
|
[[
|
|
% \begin{noindent}
|
|
<>
|
|
% \end{noindent}
|
|
]]
|
|
,
|
|
{
|
|
i(1),
|
|
}
|
|
)
|
|
),
|
|
}
|