summaryrefslogtreecommitdiffstats
path: root/Snippets/tex/math.lua
diff options
context:
space:
mode:
authorNanderty <psopka@sopka.ch>2023-03-25 18:16:24 +0100
committerNanderty <psopka@sopka.ch>2023-03-25 18:16:24 +0100
commit063c2d97218cdabe0634054a8038cd6b5c9a9a12 (patch)
tree768cb00820e92f577fe59253ba07e58f606ced4e /Snippets/tex/math.lua
parentaf7c85ef9daaf702a179a9b3d66d03eff71db7a6 (diff)
downloadneovim-config-063c2d97218cdabe0634054a8038cd6b5c9a9a12.tar.gz
neovim-config-063c2d97218cdabe0634054a8038cd6b5c9a9a12.tar.bz2
neovim-config-063c2d97218cdabe0634054a8038cd6b5c9a9a12.zip
cleanup, snippets
Diffstat (limited to 'Snippets/tex/math.lua')
-rw-r--r--Snippets/tex/math.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/Snippets/tex/math.lua b/Snippets/tex/math.lua
new file mode 100644
index 0000000..7299e04
--- /dev/null
+++ b/Snippets/tex/math.lua
@@ -0,0 +1,30 @@
+local in_mathzone = function()
+ return vim.fn['vimtex#syntax#in_mathzone']() == 1
+end
+
+return {
+ s({ trig = '/', snippetType = 'autosnippet' },
+ fmta(
+ '\\frac{<>}{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = in_mathzone }
+ ),
+ s({ trig = "in", snippetType = "autosnippet" },
+ fmta(
+ '\\int_{<>}^{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = in_mathzone }
+ ),
+ s({ trig = 'df', snippetType = 'autosnippet' },
+ { t('\\diff ') },
+ { condition = in_mathzone }
+ ),
+}