mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
minor(snip): add fraction and ball snippet
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
local ls = require('luasnip')
|
local ls = require('luasnip')
|
||||||
local d = ls.dynamic_node
|
local d = ls.dynamic_node
|
||||||
|
local i = ls.insert_node
|
||||||
local s = ls.snippet_node
|
local s = ls.snippet_node
|
||||||
local t = ls.text_node
|
local t = ls.text_node
|
||||||
local helper = require('typstar.autosnippets')
|
local helper = require('typstar.autosnippets')
|
||||||
@@ -130,4 +131,7 @@ return {
|
|||||||
-- series of numbered letters
|
-- 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 ', '<>_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
|
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),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,15 @@ return {
|
|||||||
snip('xx', 'times ', {}, math, 900),
|
snip('xx', 'times ', {}, math, 900),
|
||||||
snip('oxx', 'times.circle ', {}, math),
|
snip('oxx', 'times.circle ', {}, math),
|
||||||
snip('bxx', 'times.square ', {}, 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
|
-- sets
|
||||||
-- 'st' to '{<>} in ./visual.lua
|
-- 'st' to '{<>} in ./visual.lua
|
||||||
@@ -63,14 +72,8 @@ return {
|
|||||||
snip('mt', '|->> ', {}, math),
|
snip('mt', '|->> ', {}, math),
|
||||||
snip('Oo', 'compose ', {}, math),
|
snip('Oo', 'compose ', {}, math),
|
||||||
snip('iso', 'tilde.equiv ', {}, math),
|
snip('iso', 'tilde.equiv ', {}, math),
|
||||||
snip('ep', 'exp(<>) ', { i(1, '1') }, math),
|
|
||||||
snip('cc', 'cases(\n\t<>\n)\\', { 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('(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('ddx', '(d <>)(d <>) ', { i(1, 'f'), i(2, 'x') }, math),
|
||||||
snip('it', 'integral ', {}, math, 900),
|
snip('it', 'integral ', {}, math, 900),
|
||||||
|
|||||||
Reference in New Issue
Block a user