minor(snip): add fraction and ball snippet

This commit is contained in:
arne314
2025-01-23 13:36:58 +01:00
parent 37f27b0d09
commit 1407178ba7
2 changed files with 13 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
local ls = require('luasnip')
local d = ls.dynamic_node
local i = ls.insert_node
local s = ls.snippet_node
local t = ls.text_node
local helper = require('typstar.autosnippets')
@@ -130,4 +131,7 @@ return {
-- series of numbered letters
snip('(' .. trigger_index_pre .. ') ot ', '<>_1, <>_2, ... ', { cap(1), cap(1) }, math), -- a_1, a_2, ...
snip('(' .. trigger_index_pre .. ') ot(\\w+) ', '<> ', { d(1, get_series) }, math), -- a_1, a_2, ... a_j or a_1, a_2, a_2, a_3, a_4, a_5
-- misc
snip('(' .. trigger_index_pre .. ')bl', 'B_<> (<>)', { cap(1), i(1, 'x_0') }, math),
}

View File

@@ -42,6 +42,15 @@ return {
snip('xx', 'times ', {}, math, 900),
snip('oxx', 'times.circle ', {}, math),
snip('bxx', 'times.square ', {}, math),
snip('ff', '(<>) / (<>) <>', { i(1, 'a'), i(2, 'b'), i(3) }, math),
-- exponents
snip('iv', '^(-1) ', {}, math, 500, false),
snip('sr', '^2 ', {}, math, 500, false),
snip('cb', '^3 ', {}, math, 500, false),
snip('jj', '_(<>) ', { i(1, 'n') }, math, 500, false),
snip('kk', '^(<>) ', { i(1, 'n') }, math, 500, false),
snip('ep', 'exp(<>) ', { i(1, '1') }, math),
-- sets
-- 'st' to '{<>} in ./visual.lua
@@ -63,14 +72,8 @@ return {
snip('mt', '|->> ', {}, math),
snip('Oo', 'compose ', {}, math),
snip('iso', 'tilde.equiv ', {}, math),
snip('ep', 'exp(<>) ', { i(1, '1') }, math),
snip('cc', 'cases(\n\t<>\n)\\', { i(1, '1') }, math),
snip('(K|M|N|Q|R|S|Z)([\\dn]) ', '<><>^<> ', { cap(1), cap(1), cap(2) }, math),
snip('iv', '^(-1) ', {}, math, 500, false),
snip('sr', '^2 ', {}, math, 500, false),
snip('cb', '^3 ', {}, math, 500, false),
snip('jj', '_(<>) ', { i(1, 'n') }, math, 500, false),
snip('kk', '^(<>) ', { i(1, 'n') }, math, 500, false),
snip('ddx', '(d <>)(d <>) ', { i(1, 'f'), i(2, 'x') }, math),
snip('it', 'integral ', {}, math, 900),