From 80af2a08c9c3bfad90cdcfd916c76ec32119e187 Mon Sep 17 00:00:00 2001 From: Nanderty Date: Tue, 8 Oct 2024 21:43:46 +0200 Subject: improve snippets --- lua/Snippets/tex/lists.lua | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lua/Snippets/tex/lists.lua (limited to 'lua/Snippets/tex/lists.lua') diff --git a/lua/Snippets/tex/lists.lua b/lua/Snippets/tex/lists.lua new file mode 100644 index 0000000..4b998da --- /dev/null +++ b/lua/Snippets/tex/lists.lua @@ -0,0 +1,38 @@ +local tex = require('Snippets.luasniphelperslatex') +local helper = require('Snippets.luasniphelpers') + +return { + + s({ trig = 'nmt', snippetType = 'autosnippet' }, + fmta( + [[ +\begin{enumerate} + \item <> +\end{enumerate} +]], + { + i(1), + } + ), + { condition = helper.line_begin } + ), + + s({ trig = 'tmz', snippetType = 'autosnippet' }, + fmta( + [[ +\begin{itemize} + \item <> +\end{itemize} +]], + { + i(1), + } + ), + { condition = helper.line_begin } + ), + + s({ trig = 'itm', snippetType = 'autosnippet' }, + { t('\\item') }, + { condition = tex.in_enumerate * helper.line_begin + tex.in_itemize * helper.line_begin } + ), +} -- cgit v1.2.3