2023-01-10 02:38:06 +01:00
|
|
|
local A = require("my.abbreviations")
|
|
|
|
local scrap = require("scrap")
|
|
|
|
|
2023-12-02 00:46:56 +01:00
|
|
|
require("my.abbreviations.math").setup()
|
2023-01-10 02:38:06 +01:00
|
|
|
|
|
|
|
vim.opt.conceallevel = 0
|
|
|
|
|
|
|
|
local abbreviations = {
|
2023-09-18 02:15:13 +02:00
|
|
|
-- Other fancy symvols
|
2024-03-14 07:48:19 +01:00
|
|
|
{ "tmat", "^T" }, -- Transpose of a matrix
|
2023-11-11 06:55:14 +01:00
|
|
|
{ "cmat", "^*" }, -- Conjugate of a matrix
|
|
|
|
{ "sneg", "^C" }, -- Set complement
|
|
|
|
{ "ortco", "^\\bot" }, -- Orthogonal complement
|
2023-09-28 02:13:35 +02:00
|
|
|
{ "sinter", "^\\circ" }, -- Interior of a set
|
2023-11-11 06:55:14 +01:00
|
|
|
{ "nuls", "\\varnothing" },
|
2023-01-10 02:38:06 +01:00
|
|
|
|
|
|
|
-- Basic commands
|
|
|
|
{ "mangle", "\\measuredangle" },
|
|
|
|
{ "aangle", "\\angle" },
|
2023-11-11 06:55:14 +01:00
|
|
|
{ "sdiff", "\\setminus" },
|
|
|
|
{ "sst", "\\subset" },
|
|
|
|
{ "spt", "\\supset" },
|
|
|
|
{ "sseq", "\\subseteq" },
|
|
|
|
{ "speq", "\\supseteq" },
|
|
|
|
{ "ccan", "\\cancel" },
|
|
|
|
{ "com", "\\circ" },
|
|
|
|
{ "mul", "\\cdot" },
|
|
|
|
{ "smul", "\\times" },
|
|
|
|
{ "card", "\\#" },
|
|
|
|
{ "div", "\\|" },
|
|
|
|
{ "ndiv", "\\not\\|\\:" },
|
|
|
|
{ "perp", "\\perp" },
|
|
|
|
{ "cdots", "\\cdots" }, -- center dots
|
|
|
|
{ "ldots", "\\ldots" }, -- low dots
|
2023-11-04 18:58:09 +01:00
|
|
|
{ "cldots", ",\\ldots," }, -- comma, low dots
|
2023-11-21 16:14:55 +01:00
|
|
|
{ "frac", "\\frac" }, -- fraction
|
|
|
|
{ "lim", "\\lim" }, -- Limit
|
|
|
|
{ "sup", "\\sup" }, -- supremum
|
|
|
|
{ "limsup", "\\lim\\sup" }, -- Limit of the supremum
|
|
|
|
{ "cal", "\\mathcal" }, -- Limit of the supremum
|
2023-01-10 02:38:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
local abolishAbbreviations = {
|
2023-10-04 17:26:06 +02:00
|
|
|
-- {{{ Set symbols
|
|
|
|
-- - nats => naturals
|
|
|
|
-- - ints => integers
|
|
|
|
-- - rats => rationals
|
|
|
|
-- - irats => irationals
|
|
|
|
-- - rrea => reals
|
|
|
|
-- - comp => complex
|
|
|
|
-- - ppri => primes
|
|
|
|
-- - ffie => fields
|
|
|
|
{
|
|
|
|
"{nats,ints,rats,irats,rrea,comp,ppri,ffie}",
|
|
|
|
"\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}",
|
|
|
|
options = A.no_capitalization,
|
|
|
|
},
|
|
|
|
-- }}}
|
2023-09-19 14:07:18 +02:00
|
|
|
-- {{{ Graph theory
|
2023-01-22 01:22:38 +01:00
|
|
|
-- Graph theory function syntax:
|
|
|
|
-- gt[function]{graph}{modifier}
|
|
|
|
-- - function:
|
|
|
|
-- - basic functions: e/E/v/G/L
|
|
|
|
-- - k => connectivity
|
|
|
|
-- - a => size of the biggest stable set
|
|
|
|
-- - w => size of the biggest clique
|
|
|
|
-- - d => biggest degree
|
|
|
|
-- - c{target}{kind} => {target} {kind} chromatic number
|
|
|
|
-- - target:
|
|
|
|
-- - vertices by default
|
|
|
|
-- - e => edges
|
|
|
|
-- - kind:
|
|
|
|
-- - normal by default
|
|
|
|
-- - l => list
|
|
|
|
-- - graph:
|
|
|
|
-- - G by default
|
|
|
|
-- - s/x/y/h => S/X/Y/H
|
|
|
|
-- - modifier:
|
|
|
|
-- - a => '
|
|
|
|
-- - 1/2 => _k
|
|
|
|
{
|
|
|
|
"gt{{e,E,v,V,L},k,a,w,d,md{,e},c{,e}{,l}}{,s,h,x,y}{,a,1,2}",
|
|
|
|
"{{},\\kappa,\\alpha,\\omega,\\Delta,\\delta{,'},\\chi{,'}{,_l}}({G,S,H,X,Y}{,',_1,_2})",
|
2023-03-14 20:57:07 +01:00
|
|
|
options = A.no_capitalization,
|
2023-01-22 01:22:38 +01:00
|
|
|
},
|
2023-09-19 14:07:18 +02:00
|
|
|
-- }}}
|
2023-01-10 02:38:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
local expanded = scrap.expand_many(abolishAbbreviations)
|
|
|
|
|
2023-11-21 16:14:55 +01:00
|
|
|
-- Last I checked this contained 1229 abbreviations
|
2023-07-06 21:34:24 +02:00
|
|
|
-- print(#abbreviations + #expanded)
|
|
|
|
|
2023-01-10 02:38:06 +01:00
|
|
|
A.manyLocalAbbr(abbreviations)
|
|
|
|
A.manyLocalAbbr(expanded)
|
|
|
|
|
2023-04-19 22:31:43 +02:00
|
|
|
vim.opt_local.list = false -- The lsp usese tabs for formatting
|