diff --git a/lua/typstar/snippets/math.lua b/lua/typstar/snippets/math.lua index 2e2a7f7..2d609d8 100644 --- a/lua/typstar/snippets/math.lua +++ b/lua/typstar/snippets/math.lua @@ -20,6 +20,8 @@ return { -- boolean logic snip('no', 'not ', {}, math), + snip('ip', '==>> ', {}, math), + snip('ib', '<<== ', {}, math), snip('iff', '<<=>> ', {}, math), -- relations @@ -42,7 +44,8 @@ return { snip('bxx', 'times.square ', {}, math), -- sets - snip('set', '{<>}', { i(1) }, math), + -- 'st' to '{<>} in ./visual.lua + snip('set', '{<>|<>}', { i(1), i(2) }, math), snip('es', 'emptyset ', {}, math), snip('ses', '{emptyset} ', {}, math), snip('sp', 'supset ', {}, math), @@ -70,10 +73,15 @@ return { snip('(.*)kk', '<>^(<>)', { cap(1), i(1, 'n') }, math), snip('ddx', '(d <>)(d <>)', { i(1, 'f'), i(2, 'x') }, math), - snip('it', 'integral_(<>)^(<>)', { i(1, 'a'), i(2, 'b') }, math), - snip('oit', 'integral_(Omega}', {}, math), - snip('dit', 'integral_{<>}', { i(1, 'Omega') }, math), - snip('sm', 'sum_(<>)^(<>)', { i(1, 'i=0'), i(2, 'oo') }, math), + snip('it', 'integral', {}, math), + snip('int', 'integral_(<>)^(<>)', { i(1, 'a'), i(2, 'b') }, math), + snip('oit', 'integral_Omega', {}, math), + snip('dit', 'integral_(<>)', { i(1, 'Omega') }, math), + + snip('sm', 'sum ', {}, math), + snip('sum', 'sum_(<>)^(<>)', { i(1, 'i=0'), i(2, 'oo') }, math), + snip('osm', 'sum_Omega', {}, math), + snip('dsm', 'sum_(<>)', { i(1, 'I') }, math), snip('lm', 'lim <>', { i(1, 'a_n') }, math), snip('lim', 'lim_(<> ->> <>) <>', { i(1, 'n'), i(2, 'oo'), i(3, 'a_n') }, math), diff --git a/lua/typstar/snippets/visual.lua b/lua/typstar/snippets/visual.lua index b588189..9e36a08 100644 --- a/lua/typstar/snippets/visual.lua +++ b/lua/typstar/snippets/visual.lua @@ -11,10 +11,12 @@ local math = helper.in_math local snip = helper.snip local snippets = {} + local operations = { -- first boolean: existing brackets should be kept; second boolean: brackets should be added { 'vi', '1/', '', true, false }, { 'bb', '(', ')', true, false }, -- add round brackets { 'sq', '[', ']', true, false }, -- add square brackets + { 'st', '{', '}', true, false }, -- add curly brackets { 'bB', '(', ')', false, false }, -- replace with round brackets { 'sQ', '[', ']', false, false }, -- replace with square brackets { 'BB', '', '', false, false }, -- remove brackets