nixvim-for-share/config/plugins/luasnip/snippets/tex/EndlessList.lua
2025-07-26 12:43:01 +00:00

20 lines
512 B
Lua

-- https://github.com/L3MON4D3/LuaSnip/wiki/Cool-Snippets#endless-list
local rec_ls
rec_ls = function()
return sn(nil, {
c(1, {
-- important!! Having the sn(...) as the first choice will cause infinite recursion.
t({""}),
-- The same dynamicNode as in the snippet (also note: self reference).
sn(nil, {t({"", "\t\\item "}), i(1), d(2, rec_ls, {})}),
}),
});
end
return {
s(";endlessitem", {
t({"\\begin{itemize}",
"\t\\item "}), i(1), d(2, rec_ls, {}),
t({"", "\\end{itemize}"}), i(0)
})
}