1
Fork 0

Move a bunch of things around

This commit is contained in:
Matei Adriel 2023-12-02 00:46:56 +01:00
commit bfc89aff7f
No known key found for this signature in database
39 changed files with 435 additions and 244 deletions

View file

@ -2,34 +2,29 @@ local A = require("my.abbreviations")
local scrap = require("scrap")
local M = {}
M.symols = {
-- Unicode:
{ "iin", "" }, -- [I]ncluded [i][n]
{ "mfrl", "" }, -- [M]ath [f]o[r]al[l]
{ "eps", "ε" }, -- [E]psilon
-- Ascii stuff:
{ "tto", "->" }, -- [t]o
-- {{{ Ascii
M.ascii = {
{ "tto", "->" }, -- [t]o
{ "ffrom", "<-" }, -- [f]rom
{ "iip", "=>" }, -- [i]t [i]m[p]lies
{ "iib", "<=" }, -- [i]t's [i]mplied [b]ly
{ "iip", "=>" }, -- [i]t [i]m[p]lies
{ "iib", "<=" }, -- [i]t's [i]mplied [b]ly
{ "leq", "<=" }, -- [l]ess than or [e][q]ual
{ "geq", ">=" }, -- [g]reater than or [e][q]ual
{ "seq", "=" }, -- [s]ingle [e][q]ual
{ "deq", "==" }, -- [d]ouble [e][q]ual
{ "land", "/\\" }, -- [l]ogial [a][n][d]
{ "lor", "\\/" }, -- [l]ogial [o][r]
{ "leq", "<=" }, -- [l]ess than or [e][q]ual
{ "geq", ">=" }, -- [g]reater than or [e][q]ual
{ "seq", "=" }, -- [s]ingle [e][q]ual
{ "deq", "==" }, -- [d]ouble [e][q]ual
{ "land", "/\\" }, -- [l]ogial [a][n][d]
{ "lor", "\\/" }, -- [l]ogial [o][r]
}
-- }}}
M.words = {
{ "thrf", "therefore" },
{ "frl", "forall" },
}
function M.setup()
A.manyGlobalAbbr(scrap.expand_many(M.words))
A.manyGlobalAbbr(scrap.expand_many(M.symols, { capitalized = false }))
A.manyGlobalAbbr(scrap.expand_many(M.ascii, { capitalized = false }))
end
return M

View file

@ -0,0 +1,100 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
local M = {}
M.words = {
-- {{{ General phrases
{ "thrf", "therefore" },
{ "bcla", "by contradiction let's assume" },
{ "wlg", "without loss of generality" },
{ "tits", "that is to say," },
{ "wpbd", "we will prove the statement in both directions." },
{ "stam{,s}", "statement{}" },
{ "{ww,tt}{m,i}", "{which,this} {means,implies}" },
{ "cex{,s}", "counterexample{}" },
{ "er{t,s,r}", "{transitivity,symmetry,reflexivity}" },
-- }}}
-- {{{ Special chars
-- System for writing special characters which need to also be easly
-- accessible as {sub/super}scripts.
--
-- The reason epsilon and lambda are separated out from everything else in
-- the pattern is because they are the only ones where `foo` doesn't expand
-- to `\\foo` directly (so I saved some keystrokes by letting scrap.nvim
-- repeat everything for me).
{
"{,e,s}{{eps,lam},{star,delta,Delta,pi,tau,psi,phi,rho,sigma,alpha,beta,theta,gamma,omega,Omega}}",
"{,^,_}\\\\{{epsilon,lambda},{}}",
options = A.no_capitalization,
},
-- }}}
-- {{{ 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,
},
-- }}}
-- {{{ Calculus & analysis
{ "ib{p,s}", "integration by {parts,substitution}" },
{ "nb{,h}{,s}", "neighbour{,hood}{}" },
-- }}}
-- {{{ Linear algebra
{ "rref", "reduced row echalon form" },
{ "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" },
{ "mx{,s}", "matri{x,ces}" },
{ "dete{,s}", "determinant{}" },
{ "ort{n,g}", "orto{normal,gonal}" },
{ "l{in,de}", "linearly {independent,dependent}" },
{ "lcon{,s}", "linear combination{}" },
{ "vst{,s}", "vector space{}" }, -- text vector space
{
"rizz", -- ok please ignore this one 💀
"Riesz vector",
options = A.no_capitalization,
},
-- }}}
-- {{{ Differential equations
-- Note: we must add the space inside the {} in order for capitalization to work!
{
"{{s,o,l},}deq{s,}",
"{{scalar,ordinary,linear} ,}differential equation{}",
},
-- }}}
-- {{{ Graph theory
{ "vx{,s}", "vert{ex,ices}" },
{ "edg{,s}", "edge{}" },
-- }}}
}
M.notation = {
-- {{{ Exponents and subscripts:
-- {operation}{argument}
-- - operation = e (exponent) | s (subscript)
-- - argument = t{special} | {basic}
-- - basic = 0-9|n|i|t|k
-- - special =
-- - "p" => +
-- - "m" => -
-- - "i" => -1
{
"{e,s}{{0,1,2,3,4,5,6,7,8,9,n,i,t,k},t{i,m,p}}",
"{^,_}{{},{\\{-1\\},-,+}}",
},
-- }}}
}
function M.setup()
A.manyGlobalAbbr(scrap.expand_many(M.words))
A.manyGlobalAbbr(scrap.expand_many(M.notation, { capitalized = false }))
end
return M

View file

@ -0,0 +1,149 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
local M = {}
-- {{{ Unicode
M.unicode = {
-- {{{ Logic
{ "frl", "" }, -- [f]o[r]al[l]
{ "exs", "" }, -- [e][x]ist[s]
{ "land", "" }, -- [l]ogical [and]
{ "Land", "" }, -- arbitrary [l]ogical [and]
{ "lor", "" }, -- [l]ogical [or]
{ "Lor", "" }, -- [l]ogical [or]
{ "bot", "" }, -- false
{ "top", "" }, -- true
{ "iip", "" }, -- [i]t [i]m[p]lies
{ "iib", "" }, -- [i]t's [i]mplied [b]y
{ "iff", "" }, -- [if] and only i[f]
{ "lneg", "¬" }, -- [l]ogical [neg]ation
-- }}}
-- {{{ Set theory
{ "nolla", "" },
{ "sect", "" }, -- set intersection
{ "Sect", "" }, -- arbitrary set intersection
{ "dsect", "" }, -- disjoint set intersection (whatever that means lol)
{ "union", "" }, -- set union
{ "Union", "" }, -- arbitrary set union
{ "dnion", "" }, -- disjoint set union
-- {{{ Inclusions
{ "sst", "" }, -- [s]ub[s]et
{ "nsst", "" }, -- [n]ot [s]ub[s]et
{ "sseq", "" }, -- [s]ub[s]et or [eq]ual
{ "nsseq", "" }, -- [n]ot [s]ub[s]et or [eq]ual
{ "psseq", "" }, -- [p]roper [s]ub[s]et or [eq]ual
{ "spt", "" }, -- [s]u[p]erset
{ "nspt", "" }, -- [s]u[p]erset
{ "speq", "" }, -- [s]u[p]erset or [eq]ual
{ "nspeq", "" }, -- [n]ot [s]u[p]erset or [eq]ual
{ "pspeq", "" }, -- [p]roper [s]u[p]erset or [eq]ual
-- }}}
-- }}}
-- {{{ Double stroked chars
{ "AA", "𝔸" },
{ "BB", "𝔹" },
{ "CC", "" },
{ "DD", "" },
{ "EE", "𝔼" },
{ "FF", "𝔽" },
{ "GG", "𝔾" },
{ "HH", "" },
{ "II", "𝕀" },
{ "JJ", "𝕁" },
{ "KK", "𝕂" },
{ "LL", "𝕃" },
{ "MM", "𝕄" },
{ "NN", "" },
{ "OO", "𝕆" },
{ "PP", "" },
{ "QQ", "" },
{ "RR", "" },
{ "SS", "𝕊" },
{ "TT", "𝕋" },
{ "UU", "𝕌" },
{ "VV", "𝕍" },
{ "WW", "𝕎" },
{ "XX", "𝕏" },
{ "YY", "𝕐" },
{ "ZZ", "" },
-- }}}
-- {{{ Common operators
{ "comp", "" }, -- composition
{ "mul", "" }, -- multiplication
{ "sqrt", "" }, -- square root
{ "cbrt", "" }, -- cube root
-- }}}
-- {{{ Integrals
{ "int", "" }, -- integral
{ "iint", "" }, -- integral
{ "iiint", "" }, -- integral
{ "pint", "" }, -- integral
{ "piint", "" }, -- integral
{ "piiint", "" }, -- integral
-- }}}
-- {{{ Common relations
{ "sim", "" }, -- similarity
{ "simeq", "" },
{ "cong", "" }, -- congruence
{ "defas", "" }, -- defined as
{ "eq", "=" }, -- [eq]ual
{ "neq", "" }, -- [n]ot [eq]ual
{ "leq", "" }, -- [l]ess than or [e][q]ual
{ "geq", "" }, -- [g]reater than or [e][q]ual
{ "iin", "" }, -- [I]ncluded [i][n]
{ "nin", "" }, -- [n]ot included [i][n]
{ "iic", "" }, -- [I]n[c]ludes
{ "nic", "" }, -- does'[n]t [i]n[c]lude
-- }}}
-- {{{ Greek characters
{ "alpha", "α" },
{ "beta", "β" },
{ "gamma", "γ" },
{ "Gamma", "Γ" },
{ "delta", "δ" },
{ "Delta", "Δ" },
{ "eps", "ε" },
{ "zeta", "ζ" },
{ "eta", "η" },
{ "theta", "θ" },
{ "Theta", "Θ" },
{ "iota", "ι" },
{ "kappa", "κ" },
{ "lambda", "λ" },
{ "Lambda", "Λ" },
{ "mu", "μ" },
{ "nu", "ν" },
{ "xi", "ξ" },
{ "pi", "π" },
{ "Pi", "" },
{ "rho", "ρ" },
{ "sigma", "ς" },
{ "Sigma", "Σ" },
{ "tau", "τ" },
{ "upsilon", "υ" },
{ "phi", "ϕ" },
{ "Phi", "Φ" },
{ "chi", "χ" },
{ "psi", "ψ" },
{ "Psi", "Ψ" },
{ "omega", "ω" },
{ "Omega", "Ω" },
-- }}}
-- {{{ Common symbols
{ "iinf", "" },
{ "star", "" },
{ "diamond", "" },
-- }}}
-- {{{ Brackets
{ "langle", "" },
{ "rangle", "" },
-- }}}
}
-- }}}
function M.setup()
A.manyGlobalAbbr(scrap.expand_many(M.unicode, { capitalized = false }))
end
return M

View file

@ -42,7 +42,8 @@ function M.setup()
vim.g.mapleader = " "
-- Folding
vim.opt.foldmethod = "marker"
vim.opt.foldmethod = "marker" -- use {{{ }}} for folding
vim.opt.foldcolumn = "1" -- show column with folds on the left
end
return M

View file

@ -32,6 +32,10 @@ function M.config()
img_dir = { "%:p:h", "img" },
affix = "\\includegraphics[width=\\textwidth]{%s}",
},
typst = {
img_dir = { "%:p:h", "img" },
affix = '#image("%s", width: 100)',
},
})
end

View file

@ -12,6 +12,14 @@ function M.config()
vim.g.haskell_tools = {
hls = {
on_attach = lspconfig.on_attach,
settings = {
haskell = {
formattingProvider = "fourmolu",
-- This seems to work better with custom preludes
-- See this issue https://github.com/fourmolu/fourmolu/issues/357
plugin = { fourmolu = { config = { external = true } } },
},
},
},
tools = {
hover = {

View file

@ -5,8 +5,8 @@ return {
-- import existing settings from other plugins
import = {
vscode = true, -- local .vscode/settings.json
coc = false, -- global/local coc-settings.json
nlsp = false, -- global/local nlsp-settings.nvim json settings
coc = false, -- global/local coc-settings.json
nlsp = false, -- global/local nlsp-settings.nvim json settings
},
},
}