diff options
Diffstat (limited to 'Snippets/tex/math.lua')
| -rw-r--r-- | Snippets/tex/math.lua | 30 |
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 } + ), +} |
