diff options
| author | Nanderty <psopka@sopka.ch> | 2024-10-08 21:43:46 +0200 |
|---|---|---|
| committer | Nanderty <psopka@sopka.ch> | 2024-10-08 21:43:46 +0200 |
| commit | 80af2a08c9c3bfad90cdcfd916c76ec32119e187 (patch) | |
| tree | 7eac7761e48f3f1402b6064dd9268ff6bfdca76a | |
| parent | f19424177c106b50b55939641826da43f554b830 (diff) | |
| download | neovim-config-80af2a08c9c3bfad90cdcfd916c76ec32119e187.tar.gz neovim-config-80af2a08c9c3bfad90cdcfd916c76ec32119e187.tar.bz2 neovim-config-80af2a08c9c3bfad90cdcfd916c76ec32119e187.zip | |
improve snippets
| -rw-r--r-- | lua/Snippets/luasniphelperslatex.lua | 4 | ||||
| -rw-r--r-- | lua/Snippets/tex/lists.lua (renamed from lua/Snippets/tex/enumerate.lua) | 18 | ||||
| -rw-r--r-- | lua/Snippets/tex/postfix.lua | 2 | ||||
| -rw-r--r-- | lua/Snippets/tex/schemes.lua | 9 |
4 files changed, 26 insertions, 7 deletions
diff --git a/lua/Snippets/luasniphelperslatex.lua b/lua/Snippets/luasniphelperslatex.lua index f49f547..e5e3458 100644 --- a/lua/Snippets/luasniphelperslatex.lua +++ b/lua/Snippets/luasniphelperslatex.lua @@ -17,6 +17,10 @@ tex.in_enumerate = function() return tex.in_env('enumerate') end +tex.in_itemize = function() + return tex.in_env('itemize') +end + tex.in_figure = function() return tex.in_env('figure') end diff --git a/lua/Snippets/tex/enumerate.lua b/lua/Snippets/tex/lists.lua index 65c78a4..4b998da 100644 --- a/lua/Snippets/tex/enumerate.lua +++ b/lua/Snippets/tex/lists.lua @@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers') return { - s({ trig = 'enu', snippetType = 'autosnippet' }, + s({ trig = 'nmt', snippetType = 'autosnippet' }, fmta( [[ \begin{enumerate} @@ -17,8 +17,22 @@ return { { 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 } + { condition = tex.in_enumerate * helper.line_begin + tex.in_itemize * helper.line_begin } ), } diff --git a/lua/Snippets/tex/postfix.lua b/lua/Snippets/tex/postfix.lua index 6cc071e..54b09a5 100644 --- a/lua/Snippets/tex/postfix.lua +++ b/lua/Snippets/tex/postfix.lua @@ -11,6 +11,7 @@ return { caption = { <> }, + label = <>, ]{<>} ]], { @@ -18,6 +19,7 @@ return { i(2), i(3), i(4), + i(5), } ), { condition = helper.line_begin } diff --git a/lua/Snippets/tex/schemes.lua b/lua/Snippets/tex/schemes.lua index a8219ce..5a726be 100644 --- a/lua/Snippets/tex/schemes.lua +++ b/lua/Snippets/tex/schemes.lua @@ -30,7 +30,7 @@ return { \begin{scheme}[!h] \centering \schemestart - \chemname{ + \chemname { \chemfig { <> } @@ -122,7 +122,7 @@ return { s({ trig = 'nmi', snippetType = 'autosnippet' }, fmta( [[ -\chemnameinit{ +\chemnameinit { <> } ]], @@ -201,7 +201,7 @@ return { s({ trig = 'nme', snippetType = 'autosnippet' }, fmta( [[ -\chemname{ +\chemname { <> }{<>} ]], @@ -230,10 +230,9 @@ return { s({ trig = 'rfr', snippetType = 'autosnippet' }, fmta( - [[ \cref{<>:<>}]], + [[ \cref{<>}]], { i(1), - i(2), } ) ), |
