From 59cb5af26b9f7b9c626bef058ab4e7e8666ff9ec Mon Sep 17 00:00:00 2001 From: Nanderty Date: Fri, 14 Apr 2023 23:59:47 +0200 Subject: Snippets --- lua/Snippets/tex/math.lua | 80 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 4 deletions(-) (limited to 'lua/Snippets/tex/math.lua') diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua index 08a3bfe..411ac7a 100644 --- a/lua/Snippets/tex/math.lua +++ b/lua/Snippets/tex/math.lua @@ -2,6 +2,14 @@ local tex = require('Snippets.luasniphelperslatex') local helper = require('Snippets.luasniphelpers') return { + s({ trig = '$', snippetType = 'autosnippet' }, + fmta( + '$<>$', + { + i(1), + } + ) + ), s({ trig = '/', snippetType = 'autosnippet' }, fmta( '\\frac{<>}{<>}', @@ -31,16 +39,80 @@ return { ), { condition = tex.in_mathzone } ), + s({ trig = "vec", snippetType = "autosnippet" }, + fmta( + '\\vec{<>}', + { + i(1), + } + ), + { condition = tex.in_mathzone } + ), + s({ trig = "hat", snippetType = "autosnippet" }, + fmta( + '\\hat{<>}', + { + i(1), + } + ), + { condition = tex.in_mathzone } + ), + s({ trig = 'ΓΆΓΆ', snippetType = 'autosnippet' }, + fmta( + '^{<>}', + { + i(1), + } + ), + { condition = tex.in_mathzone } + ), + s({ trig = 'll', snippetType = 'autosnippet' }, + fmta( + '_{<>}', + { + i(1), + } + ), + { condition = tex.in_mathzone } + ), + s({ trig = "bb", snippetType = "autosnippet" }, + fmta( + '\\left(<>\\right)', + { + i(1), + } + ), + { condition = tex.in_mathzone } + ), s({ trig = 'df', snippetType = 'autosnippet' }, { t('\\diff ') }, { condition = tex.in_mathzone } ), - s({ trig = 'ble', snippetType = 'autosnippet' }, - { t('\\left(') }, + s({ trig = "sin", snippetType = "autosnippet" }, + fmta( + '\\sin{<>}', + { + i(1), + } + ), + { condition = tex.in_mathzone } + ), + s({ trig = "cos", snippetType = "autosnippet" }, + fmta( + '\\cos{<>}', + { + i(1), + } + ), { condition = tex.in_mathzone } ), - s({ trig = 'bri', snippetType = 'autosnippet' }, - { t('\\right)') }, + s({ trig = "tan", snippetType = "autosnippet" }, + fmta( + '\\tan{<>}', + { + i(1), + } + ), { condition = tex.in_mathzone } ), } -- cgit v1.2.3