kitchen sink

This commit is contained in:
2025-01-24 13:56:11 -06:00
parent a0ebc39b59
commit 8eaa615596
25 changed files with 444 additions and 412 deletions

70
lua/snippets/tex.lua Normal file
View File

@ -0,0 +1,70 @@
require('core.snippets.shorthands')
require('core.snippets.functions')
return {
-- document snippet
s("doc",
fmta(
[[
\documentclass{article}
\title{<>}
\author{<>}
\begin{document}
\maketitle
<>
\end{document}
]],
{
c(1, {
sn(nil, { f(file_name, {}), i(1) }),
i(1, "my title")
}),
i(2, "my name"),
i(0)
}
)
),
s({ trig = ";begin", snippetType = "autosnippet" },
fmta(
[[
\begin{<>}
<>
\end{<>}
]],
{
i(1),
i(0),
rep(1)
}
)
),
s({ trig = ";href", snippetType = "autosnippet" },
fmta(
[[\href{<>}{<>}]],
{
i(1, "url"),
i(2, "display name"),
}
)
),
postfix(".b", {
f(function(_, parent)
return [[\textbf{]]..parent.snippet.env.POSTFIX_MATCH.."}"
end)
}),
postfix(".i", {
f(function(_, parent)
return [[\textit{]]..parent.snippet.env.POSTFIX_MATCH.."}"
end)
}),
postfix(".ul", {
f(function(_, parent)
return [[\underline{]]..parent.snippet.env.POSTFIX_MATCH.."}"
end)
})
}