From eda6de26bba1adc8f5e871e4f7ded837951ed7f4 Mon Sep 17 00:00:00 2001 From: Jonas Hahn Date: Sun, 2 Nov 2025 00:49:37 +0100 Subject: [PATCH] Removed all the default inserts --- lua/typstar/snippets/markup.lua | 11 ++++++----- lua/typstar/snippets/math.lua | 15 +++++++++++++-- lua/typstar/snippets/visual.lua | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lua/typstar/snippets/markup.lua b/lua/typstar/snippets/markup.lua index ba67132..340c116 100644 --- a/lua/typstar/snippets/markup.lua +++ b/lua/typstar/snippets/markup.lua @@ -24,11 +24,11 @@ local ctheorems = { } local wrappings = { - { 'll', '$', '$', '1+1' }, - { 'BLD', '*', '*', 'abc' }, - { 'ITL', '_', '_', 'abc' }, - { 'HIG', '#highlight[', ']', 'abc' }, - { 'UND', '#underline[', ']', 'abc' }, + { 'll', '$', '$', '' }, + { 'BLD', '*', '*', '' }, + { 'ITL', '_', '_', '' }, + { 'HIG', '#highlight[', ']', '' }, + { 'UND', '#underline[', ']', '' }, } local document_snippets = {} @@ -51,6 +51,7 @@ return { helper.list_snip('dm', '\n$\n\t<>\n$ <>', { helper.visual(1), i(2) }, markup, 1100, { prepend = '\t' }), start('fla', '#flashcard(0)[<>][\n<>\n<>]', { i(1, 'flashcard'), indent_visual(2), cap(1) }, markup), start('flA', '#flashcard(0, "<>")[\n<>\n<>]', { i(1, 'flashcard'), indent_visual(2), cap(1) }, markup), + start('TAB', '#table(columns: <>,\n[<>], [<>], <>\n)', { i(1), i(2), i(3), i(4) }, markup), snip('IMP', '$==>>$ ', {}, markup), snip('IFF', '$<<==>>$ ', {}, markup), unpack(document_snippets), diff --git a/lua/typstar/snippets/math.lua b/lua/typstar/snippets/math.lua index 381f897..a6a6f20 100644 --- a/lua/typstar/snippets/math.lua +++ b/lua/typstar/snippets/math.lua @@ -33,6 +33,16 @@ return { snip('ne', '!= ', {}, math), snip('ge', '>>= ', {}, math), + -- custom + snip('mm', '- ', {}, math), + snip('pl', '+ ', {}, math), + snip('nl', '\\ \n<>', {i(1)}, math), + snip('pm', '+- ', {}, math), + snip('nx', ', space ', {}, math), + snip('nbx', ', quad ', {}, math), + snip('ta', 'star ', {}, math), + snip('del', 'Delta ', {}, math), + -- operators snip('ak([^k ])', '+ <>', { cap(1) }, math, 100, { wordTrig = false }), snip('sk([^k ])', '- <>', { cap(1) }, math, 100, { wordTrig = false }), @@ -42,7 +52,7 @@ return { snip('xx', 'times ', {}, math), snip('oxx', 'times.circle ', {}, math), snip('bxx', 'times.square ', {}, math), - snip('ff', '(<>) / (<>) <>', { i(1, 'a'), i(2, 'b'), i(3) }, math), + snip('ff', '(<>) / (<>) <>', { i(1), i(2), i(3) }, math), snip('nab', 'arrow(nabla) ', {}, math), -- exponents @@ -74,7 +84,7 @@ return { snip('mt', '|->> ', {}, math), snip('Oo', 'compose ', {}, math), snip('iso', 'tilde.equiv ', {}, math), - snip('cc', 'cases(\n\t<>\n)\\', { i(1, '1') }, math), + snip('cc', 'cases(\n\t<>\n)\\', { i(1) }, math), snip('([A-Za-z])o([A-Za-z0-9]) ', '<>(<>) ', { cap(1), cap(2) }, math, 100, { maxTrigLength = 4, blacklist = { 'bot ', 'cos ', 'cot ', 'dot ', 'log ', 'mod ', 'top ', 'won ', 'xor ' }, @@ -88,6 +98,7 @@ return { snip('part', 'partial ', {}, math, 1600), snip('it', 'integral ', {}, math), snip('iot', 'integral.vol ', {}, math), + snip('ift', 'integral.surf ', {}, math), snip('int', 'integral_(<>)^(<>) ', { i(1, 'a'), i(2, 'b') }, math), snip('oit', 'integral.cont_(<>) ', { i(1, 'C') }, math), snip('dit', 'integral_(<>) ', { i(1, 'Omega') }, math), diff --git a/lua/typstar/snippets/visual.lua b/lua/typstar/snippets/visual.lua index 01e2b8b..ea60a4c 100644 --- a/lua/typstar/snippets/visual.lua +++ b/lua/typstar/snippets/visual.lua @@ -98,7 +98,7 @@ local smart_wrap = function(args, parent, old_state, expand) -- normal snippet if not visual_disable_normal[trigger] then - return s(nil, { t(expand1), i(1, '1+1'), t(expand2) }) + return s(nil, { t(expand1), i(1), t(expand2) }) else return s(nil, t(trigger)) end