summaryrefslogtreecommitdiffstats
path: root/Snippets/tex/math.lua
blob: 7299e044d821290b4a28734406fb54d26ef809d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 }
	),
}