summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/tex
diff options
context:
space:
mode:
authorNanderty <psopka@sopka.ch>2024-10-08 21:43:46 +0200
committerNanderty <psopka@sopka.ch>2024-10-08 21:43:46 +0200
commit80af2a08c9c3bfad90cdcfd916c76ec32119e187 (patch)
tree7eac7761e48f3f1402b6064dd9268ff6bfdca76a /lua/Snippets/tex
parentf19424177c106b50b55939641826da43f554b830 (diff)
downloadneovim-config-80af2a08c9c3bfad90cdcfd916c76ec32119e187.tar.gz
neovim-config-80af2a08c9c3bfad90cdcfd916c76ec32119e187.tar.bz2
neovim-config-80af2a08c9c3bfad90cdcfd916c76ec32119e187.zip
improve snippets
Diffstat (limited to 'lua/Snippets/tex')
-rw-r--r--lua/Snippets/tex/lists.lua (renamed from lua/Snippets/tex/enumerate.lua)18
-rw-r--r--lua/Snippets/tex/postfix.lua2
-rw-r--r--lua/Snippets/tex/schemes.lua9
3 files changed, 22 insertions, 7 deletions
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),
}
)
),