summaryrefslogtreecommitdiff
path: root/.config/nvim/snips
diff options
context:
space:
mode:
authorjoott <josh@ottmail.me>2025-07-30 15:53:29 -0400
committerjoott <josh@ottmail.me>2025-07-30 15:53:29 -0400
commit26694e09e8f5bf2262737312e7ad217118db20de (patch)
treeca55eee2f8c5106c61e747979780d6f393fd24c9 /.config/nvim/snips
parent89a596a50ec61b8ebd6040b06a7cab994afd1b3a (diff)
downloaddotfiles-26694e09e8f5bf2262737312e7ad217118db20de.tar.gz
dotfiles-26694e09e8f5bf2262737312e7ad217118db20de.zip
switching to yadm
Diffstat (limited to '.config/nvim/snips')
-rw-r--r--.config/nvim/snips/tex/chunks.lua220
-rw-r--r--.config/nvim/snips/tex/electromagnetism.lua9
-rw-r--r--.config/nvim/snips/tex/expressions.lua242
-rw-r--r--.config/nvim/snips/tex/symbols.lua458
4 files changed, 929 insertions, 0 deletions
diff --git a/.config/nvim/snips/tex/chunks.lua b/.config/nvim/snips/tex/chunks.lua
new file mode 100644
index 0000000..617f648
--- /dev/null
+++ b/.config/nvim/snips/tex/chunks.lua
@@ -0,0 +1,220 @@
+local n = require("luasnip-nodes")
+local h = require("luasnip-helpers")
+
+-- pump snippet input into wolframscript and get the output
+-- if an error occurs, find out and redo snippet
+local mathematica = function (_, snip)
+ local cmd = "'Check[ToString[" .. snip.captures[1] .. ", TeXForm], Exit[1]]'"
+ local output = string.sub(vim.fn.system("wolframscript -code " .. cmd), 1, -2)
+ if string.sub(output, -7, -1) ~= "$Failed" and vim.v.shell_error == 0 then
+ return n.sn(nil, n.t(output))
+ else
+ print("there was an error")
+ return n.sn(nil, n.fmta("math " .. snip.captures[1] .. "<> math", { n.i(1) }))
+ end
+end
+
+-- creates a matrix row as a snippet node
+local rowGenerator = function (j, rows, columns)
+ local column = {}
+ local isSquare = rows == columns
+ for k=1,columns do
+ local digit = "0"
+ if isSquare and j==k then
+ digit = "1"
+ end
+ column[2*k-1] = n.i(k, digit)
+ column[2*k] = n.t(" & ")
+ end
+ column[2*columns] = n.t({ " \\\\", "\t" })
+ if j==rows then
+ column[2*columns] = nil
+ end
+ return n.sn(j, column)
+end
+
+-- creates a table row as a snippet node
+local tableRowGenerator = function (j, rows, columns)
+ local column = {}
+ for k=1,columns do
+ column[2*k-1] = n.i(k)
+ column[2*k] = n.t(" & ")
+ end
+ column[2*columns] = n.t({ " \\\\ \\hline", "\t" })
+ if j==rows then
+ column[2*columns] = n.t({ " \\\\ \\hline" })
+ end
+ return n.sn(j, column)
+end
+
+-- generates a matrix with dimensions as snippet capture groups
+local matrix = function (_, snip)
+ local rows = tonumber(snip.captures[1])
+ local columns = tonumber(snip.captures[2])
+ local nodes = {}
+ for j=1,rows do
+ nodes[j] = rowGenerator(j, rows, columns)
+ end
+ return n.sn(1, nodes)
+end
+
+-- generates a table with dimensions as snippet capture groups
+local table = function (_, snip)
+ local rows = tonumber(snip.captures[1])
+ local columns = tonumber(snip.captures[2])
+ local nodes = {}
+ for j=1,rows do
+ nodes[j] = tableRowGenerator(j, rows, columns)
+ end
+ return n.sn(1, nodes)
+end
+
+-- generates little partition definition thing for table environment
+local tableCols = function (_, snip)
+ local columns = tonumber(snip.captures[2])
+ local output = string.rep("|l", columns)
+ return output .. "|"
+end
+
+-- turns identifier into enum prefix
+local enumType = function (_, snip)
+ local type = snip.captures[1]
+ if type == "n" then
+ return "\\arabic*."
+ elseif type == "a" then
+ return "(\\alph*)"
+ elseif type == "i" then
+ return "(\\roman*)"
+ end
+end
+
+return {
+ -- environment
+ n.s({trig="beg", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{<>}
+ <>
+ \end{<>}
+ ]],
+ { n.i(1), n.i(0), n.rep(1) }),
+ { condition = h.line_begin }),
+ -- named environment
+ n.s({trig="beng", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{<>}[<>]
+ <>
+ \end{<>}
+ ]],
+ { n.i(1), n.i(2), n.i(0), n.rep(1) }),
+ { condition = h.line_begin }),
+ -- equation
+ n.s({trig="beq", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{equation}
+ <>
+ \end{equation}
+ ]],
+ { n.i(0) }),
+ { condition = h.line_begin }),
+ -- WIP plot snippet
+ n.s({trig="plot(", snippetType="autosnippet"},
+ n.fmta(
+ "plot(<>) <> plot",
+ { n.i(1), n.i(2) })
+ ),
+ -- mathematica snippet
+ n.s({trig="math", snippetType="autosnippet"},
+ n.fmta("math <> math",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="math (.*) math", regTrig=true, wordTrig=false},
+ { n.d(1, mathematica) },
+ { condition = h.in_mathzone }
+ ),
+ -- bmatrix
+ n.s({trig="bm", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{bmatrix}{<>,<>} \end{bmatrix}
+ ]],
+ { n.i(1), n.i(2) }),
+ { condition = h.line_begin * h.in_mathzone }),
+ -- matrix with arbitrary brackets
+ n.s({trig="zmat", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{<>matrix}{<>,<>} \end{<>matrix}
+ ]],
+ { n.i(1), n.i(2), n.i(3), n.rep(1) }),
+ { condition = h.line_begin * h.in_mathzone }),
+ n.s({trig="\\begin{.matrix}{(%d+),(%d+)} \\end{(.)matrix}", regTrig=true, wordTrig=false},
+ n.fmta(
+ [[
+ \begin{<>matrix}
+ <>
+ \end{<>matrix}
+ ]],
+ { n.f(function(_, parent) return parent.captures[3] end), n.d(1, matrix), n.f(function(_, parent) return parent.captures[3] end) }),
+ { condition = h.in_mathzone }),
+ -- table
+ n.s({trig="tab", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{table}{<>,<>} \end{table}
+ ]],
+ { n.i(1), n.i(2) }),
+ { condition = h.line_begin }),
+ n.s({trig="\\begin{table}{(%d+),(%d+)} \\end{table}", regTrig=true, wordTrig=false},
+ n.fmta(
+ [[
+ \begin{tabular}{<>}
+ \hline
+ <>
+ \end{tabular}
+ ]],
+ { n.f(tableCols), n.d(1, table) })),
+ -- enum with n=numbers, a=alphas, or i=roman numerals
+ n.s({trig="enum([nai])", regTrig=true, snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{enumerate}[label=<>]
+ \item <>
+ \end{enumerate}
+ ]],
+ { n.f(enumType), n.i(0) }),
+ { condition = h.in_text * h.line_begin }),
+ -- itemize
+ n.s({trig="item", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{itemize}
+ \item <>
+ \end{itemize}
+ ]],
+ { n.i(0) }),
+ { condition = h.in_text * h.line_begin }),
+ -- split equation environment
+ n.s({trig="slt", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \begin{equation}\begin{split}
+ <>
+ \end{split}\end{equation}
+ ]],
+ { n.i(0) }),
+ { condition = h.in_text * h.line_begin }),
+ -- split display equation
+ n.s({trig="sld", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \[ \begin{split}
+ <>
+ \end{split} \]
+ ]],
+ { n.i(0) }),
+ { condition = h.in_text * h.line_begin }),
+}
diff --git a/.config/nvim/snips/tex/electromagnetism.lua b/.config/nvim/snips/tex/electromagnetism.lua
new file mode 100644
index 0000000..c0a7869
--- /dev/null
+++ b/.config/nvim/snips/tex/electromagnetism.lua
@@ -0,0 +1,9 @@
+local n = require("luasnip-nodes")
+local h = require("luasnip-helpers")
+
+return {
+ n.s({trig="'rr", snippetType="autosnippet"},
+ { n.t("\\scriptr") },
+ { condition = h.in_mathzone }
+ ),
+}
diff --git a/.config/nvim/snips/tex/expressions.lua b/.config/nvim/snips/tex/expressions.lua
new file mode 100644
index 0000000..875fbf4
--- /dev/null
+++ b/.config/nvim/snips/tex/expressions.lua
@@ -0,0 +1,242 @@
+local n = require("luasnip-nodes")
+local h = require("luasnip-helpers")
+
+local closer = function (open)
+ if open == "(" then
+ return ")"
+ elseif open == "\\{" then
+ return "\\}"
+ elseif open == "{" then
+ return "}"
+ elseif open == "[" then
+ return "]"
+ elseif open == "|" then
+ return "|"
+ elseif open == "\\langle" then
+ return "\\rangle"
+ else
+ return nil
+ end
+end
+
+local parens = function(_, parent)
+ local open = parent.captures[1]
+
+ if open == "{" then open = "\\{" end
+ if open == "'a" then open = "\\langle" end
+
+ local node = n.sn(1,
+ n.fmta("\\left<> <> \\right<><>",
+ { n.t(open), n.i(1), n.t(closer(open)), n.i(0) })
+ )
+ return node
+end
+
+return {
+ n.s({trig="'{", snippetType="autosnippet"},
+ n.fmta("\\{ <> \\}", { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[\\left([\(\[\{|]|'a)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"},
+ { n.d(1, parens) },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'lf", snippetType="autosnippet"},
+ { n.t("\\left") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ang", snippetType="autosnippet"},
+ n.fmta("\\langle <> \\rangle", { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="dsum", snippetType="autosnippet", priority=200},
+ n.fmta("\\sum_{<>=<>}^{<>}",
+ { n.i(1), n.i(2), n.i(3) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="sum", snippetType="autosnippet", priority=100},
+ { n.t("\\sum") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'bu", snippetType="autosnippet", priority=100},
+ { n.t("\\bigcup") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ba", snippetType="autosnippet", priority=100},
+ { n.t("\\bigcap") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="od", snippetType="autosnippet", priority=100},
+ n.fmta("\\od{<>}{<>}",
+ { n.i(1), n.i(2) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'od", snippetType="autosnippet", priority=200},
+ n.fmta("\\od[<>]{<>}{<>}",
+ { n.i(1), n.i(2), n.i(3) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="pd", snippetType="autosnippet", priority=100},
+ n.fmta("\\pd{<>}{<>}",
+ { n.i(1), n.i(2) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'pd", snippetType="autosnippet", priority=200},
+ n.fmta("\\pd[<>]{<>}{<>}",
+ { n.i(1), n.i(2), n.i(3) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="dint", snippetType="autosnippet", priority=200},
+ n.fmta("\\int_{<>}^{<>}",
+ { n.i(1, "-\\infty"), n.i(2, "\\infty") }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="int", snippetType="autosnippet", priority=100},
+ { n.t("\\int") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="oint", snippetType="autosnippet", priority=100},
+ { n.t("\\oint") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="doint", snippetType="autosnippet", priority=200},
+ n.fmta("\\oint_{<>}^{<>}",
+ { n.i(1), n.i(2) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="df", wordTrig=false, snippetType="autosnippet"},
+ { n.t("\\diff ") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="pf", wordTrig=false, snippetType="autosnippet"},
+ { n.t("\\pdiff ") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "tii", snippetType="autosnippet"},
+ n.fmta("\\textit{<>}",
+ { n.d(1, h.get_visual) }),
+ { condition = h.in_text }
+ ),
+ n.s({trig = "tbb", snippetType="autosnippet"},
+ n.fmta("\\textbf{<>}",
+ { n.d(1, h.get_visual) }),
+ { condition = h.in_text }
+ ),
+ n.s({trig = "tuu", snippetType="autosnippet"},
+ n.fmta("\\underline{<>}",
+ { n.d(1, h.get_visual) }),
+ { condition = h.in_text }
+ ),
+ n.s({trig = "txt", snippetType="autosnippet"},
+ n.fmta("\\texttt{<>}",
+ { n.d(1, h.get_visual) }),
+ { condition = h.in_text }
+ ),
+ n.s({trig = "=", snippetType="autosnippet"},
+ { n.t("\\item ") },
+ { condition = h.in_itemize * h.line_begin }
+ ),
+ n.s({trig = "=", snippetType="autosnippet"},
+ { n.t("\\item ") },
+ { condition = h.in_enumerate * h.line_begin }
+ ),
+ n.s({trig = "ceil", snippetType="autosnippet"},
+ n.fmta("\\left\\lceil <> \\right\\rceil<>",
+ { n.i(1), n.i(0) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "floor", snippetType="autosnippet"},
+ n.fmta("\\left\\lfloor <> \\right\\rfloor",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="sr", snippetType="autosnippet", wordTrig=false},
+ { n.t("^2") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="cb", snippetType="autosnippet", wordTrig=false},
+ { n.t("^3") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="tf", snippetType="autosnippet", wordTrig=false},
+ n.fmta("^{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "rf", wordTrig=false, snippetType="autosnippet"},
+ n.fmta("_{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="vm", snippetType="autosnippet"},
+ n.fmta("$<>$",
+ { n.i(1) }),
+ { condition = h.in_text }
+ ),
+ n.s({trig="dm", snippetType="autosnippet"},
+ n.fmta(
+ [[
+ \[
+ <>
+ \]
+ <>
+ ]],
+ { n.i(1), n.i(0) }),
+ { condition = h.in_text }
+ ),
+ n.s({trig=[[([A-Za-z])(\d)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=100},
+ n.fmta("<>_<>",
+ { n.f(function(_, parent) return parent.captures[1] end),
+ n.f(function(_, parent) return parent.captures[2] end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[([A-Za-z])_(\d{2})]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"},
+ n.fmta("<>_{<>}",
+ { n.f(function(_, parent) return parent.captures[1] end),
+ n.f(function(_, parent) return parent.captures[2] end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "tx", snippetType="autosnippet"},
+ n.fmta("\\text{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "sq", snippetType="autosnippet"},
+ n.fmta("\\sqrt{<>}",
+ { n.d(1, h.get_visual) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "map", snippetType="autosnippet"},
+ n.fmta("<> : <> \\to <>",
+ { n.i(1), n.i(2), n.i(0) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig = "eval", snippetType="autosnippet"},
+ n.fmta("\\eval{<>}",
+ { n.d(1, h.get_visual) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[\<(.*?)\|`]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"},
+ n.fmta([[\bra{<>}]],
+ { n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[\|(.*?)\>\^]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=100},
+ n.fmta([[\ket{<>}]],
+ { n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[\<(.*?)\|(.*?)\>\^]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200},
+ n.fmta([[\braket{<>}{<>}]],
+ { n.f(function(_, parent) return parent.captures[1] end),
+ n.f(function(_, parent) return parent.captures[2] end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[\<(.*?)\|(.*?)\|(.*?)\>\^]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=300},
+ n.fmta([[\bra{<>}<>\ket{<>}]],
+ { n.f(function(_, parent) return parent.captures[1] end),
+ n.f(function(_, parent) return parent.captures[2] end),
+ n.f(function(_, parent) return parent.captures[3] end) }),
+ { condition = h.in_mathzone }
+ ),
+}
diff --git a/.config/nvim/snips/tex/symbols.lua b/.config/nvim/snips/tex/symbols.lua
new file mode 100644
index 0000000..118c807
--- /dev/null
+++ b/.config/nvim/snips/tex/symbols.lua
@@ -0,0 +1,458 @@
+local n = require("luasnip-nodes")
+local h = require("luasnip-helpers")
+
+return {
+ n.s({trig="//", snippetType="autosnippet"},
+ n.fmta("\\frac{<>}{<>}",
+ { n.i(1), n.i(2), }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="oo", snippetType="autosnippet"},
+ { n.t("\\infty") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="sin", snippetType="autosnippet"},
+ { n.t("\\sin") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="cos", snippetType="autosnippet"},
+ { n.t("\\cos") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="tan", snippetType="autosnippet"},
+ { n.t("\\tan") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="csc", snippetType="autosnippet"},
+ { n.t("\\csc") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="sec", snippetType="autosnippet"},
+ { n.t("\\sec") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="cot", snippetType="autosnippet"},
+ { n.t("\\cot") },
+ { condition = h.in_mathzone }
+ ),
+ n.s ({trig="ln", snippetType="autosnippet"},
+ { n.t("\\ln") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="inn", snippetType="autosnippet"},
+ { n.t("\\in") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="=>", snippetType="autosnippet"},
+ { n.t("\\implies") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="=<", snippetType="autosnippet"},
+ { n.t("\\impliedby ") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="iff", snippetType="autosnippet"},
+ { n.t("\\iff") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="NN", snippetType="autosnippet"},
+ { n.t("\\N") }
+ ),
+ n.s({trig="RR", snippetType="autosnippet"},
+ { n.t("\\R") }
+ ),
+ n.s({trig="ZZ", snippetType="autosnippet"},
+ { n.t("\\Z") }
+ ),
+ n.s({trig="OO", snippetType="autosnippet"},
+ { n.t("\\emptyset") }
+ ),
+ n.s({trig="QQ", snippetType="autosnippet"},
+ { n.t("\\Q") }
+ ),
+ n.s({trig="CC", snippetType="autosnippet"},
+ { n.t("\\C") }
+ ),
+ n.s({trig="EE", snippetType="autosnippet"},
+ { n.t("\\exists") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="AA", snippetType="autosnippet"},
+ { n.t("\\forall") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="<=", snippetType="autosnippet"},
+ { n.t("\\le") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=">=", snippetType="autosnippet"},
+ { n.t("\\ge") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="<<", snippetType="autosnippet"},
+ { n.t("\\ll") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=">>", snippetType="autosnippet"},
+ { n.t("\\gg") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="!=", snippetType="autosnippet"},
+ { n.t("\\neq") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="->", snippetType="autosnippet", priority=100},
+ { n.t("\\to") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="<->", snippetType="autosnippet", priority=200},
+ { n.t("\\leftrightarrow") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="^^", snippetType="autosnippet"},
+ { n.t("\\uparrow") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="vv", snippetType="autosnippet"},
+ { n.t("\\downarrow") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="!>", snippetType="autosnippet"},
+ { n.t("\\mapsto") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="stm", snippetType="autosnippet"},
+ { n.t("\\setminus") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="||", snippetType="autosnippet"},
+ { n.t("\\mid") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="**", snippetType="autosnippet"},
+ { n.t("\\cdot") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="xx", snippetType="autosnippet"},
+ { n.t("\\times") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="cc", snippetType="autosnippet"},
+ { n.t("\\subseteq") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="cq", snippetType="autosnippet"},
+ { n.t("\\subset") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="qq", snippetType="autosnippet"},
+ { n.t("\\supseteq") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="qc", snippetType="autosnippet"},
+ { n.t("\\supset") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="Nn", snippetType="autosnippet"},
+ { n.t("\\cap") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="UU", snippetType="autosnippet"},
+ { n.t("\\cup") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="uU", snippetType="autosnippet"},
+ { n.t("\\sqcup") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="bar", snippetType="autosnippet", priority=100},
+ n.fmta("\\bar{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[((\\[a-zA-Z]+)|[A-Za-z0-9])bar]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200},
+ n.fmta("\\bar{<>}",
+ { n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig="hat", snippetType="autosnippet", priority=100},
+ n.fmta("\\hat{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})hat]],
+ wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ n.fmta("\\hat{<>}",
+ { n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig=[[!\?|\?!]], trigEngine="ecma", snippetType="autosnippet", priority=100},
+ n.fmta("\\vec{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})(!\?|\?!)]],
+ wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ n.fmta("\\vec{<>}",
+ { n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig="t(o+)t", regTrig=true, snippetType="autosnippet", priority=100},
+ n.fmta("\\<>ot{<>}",
+ { n.f(function(_, parent) return string.rep("d", string.len(parent.captures[1])) end),
+ n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})t(o+)t]],
+ wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ n.fmta("\\<>ot{<>}",
+ { n.f(function(_, parent) return string.rep("d", string.len(parent.captures[2])) end),
+ n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig="'ti", regTrig=true, snippetType="autosnippet", priority=100},
+ n.fmta("\\tilde{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})'ti]],
+ wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ n.fmta("\\tilde{<>}",
+ { n.f(function(_, parent) return parent.captures[1] end) }),
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig=[[([a-zA-Z])(:#|#:)]], wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ n.fmta("\\mathcal{<>}",
+ { n.f(function(_, parent) return string.upper(parent.captures[1]) end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="(:#|#:)", wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=100},
+ n.fmta("\\mathcal{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig=[[([a-zA-Z])(@#|#@)]], wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ n.fmta("\\mathbb{<>}",
+ { n.f(function(_, parent) return string.upper(parent.captures[1]) end) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="1(@#|#@)", wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200},
+ { n.t("\\1") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="(@#|#@)", wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=100},
+ n.fmta("\\mathbb{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="mfr", wordTrig=false, trigEngine="ecma", snippetType="autosnippet"},
+ n.fmta("\\mathfrak{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="mrm", wordTrig=false, trigEngine="ecma", snippetType="autosnippet"},
+ n.fmta("\\mathrm{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="msf", wordTrig=false, trigEngine="ecma", snippetType="autosnippet"},
+ n.fmta("\\mathsf{<>}",
+ { n.i(1) }),
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'kk", snippetType="autosnippet"},
+ { n.t("\\mathbb{k}") },
+ { condition = h.in_mathzone }
+ ),
+
+ n.s({trig="'hb", snippetType="autosnippet"},
+ { n.t("\\hbar") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'pi", snippetType="autosnippet"},
+ { n.t("\\pi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ph", snippetType="autosnippet"},
+ { n.t("\\phi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'Ph", snippetType="autosnippet"},
+ { n.t("\\Phi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'vp", snippetType="autosnippet"},
+ { n.t("\\varphi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'th", snippetType="autosnippet"},
+ { n.t("\\theta") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'Th", snippetType="autosnippet"},
+ { n.t("\\Theta") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'Om", snippetType="autosnippet"},
+ { n.t("\\Omega") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'om", snippetType="autosnippet"},
+ { n.t("\\omega") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ep", snippetType="autosnippet"},
+ { n.t("\\epsilon") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ta", snippetType="autosnippet"},
+ { n.t("\\tau") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'rh", snippetType="autosnippet"},
+ { n.t("\\rho") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ch", snippetType="autosnippet"},
+ { n.t("\\chi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'na", snippetType="autosnippet"},
+ { n.t("\\nabla") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="del", snippetType="autosnippet"},
+ { n.t("\\Del") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="==", snippetType="autosnippet"},
+ { n.t("\\equiv") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="~~", snippetType="autosnippet"},
+ { n.t("\\approx") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="=~", snippetType="autosnippet"},
+ { n.t("\\cong") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'de", snippetType="autosnippet"},
+ { n.t("\\delta") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'De", snippetType="autosnippet"},
+ { n.t("\\Delta") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'nu", snippetType="autosnippet"},
+ { n.t("\\nu") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'mu", snippetType="autosnippet"},
+ { n.t("\\mu") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ps", snippetType="autosnippet"},
+ { n.t("\\psi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'Ps", snippetType="autosnippet"},
+ { n.t("\\Psi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ve", snippetType="autosnippet"},
+ { n.t("\\varepsilon") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'al", snippetType="autosnippet"},
+ { n.t("\\alpha") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'be", snippetType="autosnippet"},
+ { n.t("\\beta") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ga", snippetType="autosnippet"},
+ { n.t("\\gamma") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'Ga", snippetType="autosnippet"},
+ { n.t("\\Gamma") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'la", snippetType="autosnippet"},
+ { n.t("\\lambda") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'La", snippetType="autosnippet"},
+ { n.t("\\Lambda") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'el", snippetType="autosnippet"},
+ { n.t("\\ell") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'si", snippetType="autosnippet"},
+ { n.t("\\sigma") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'Si", snippetType="autosnippet"},
+ { n.t("\\Sigma") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'xi", snippetType="autosnippet"},
+ { n.t("\\xi") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ka", snippetType="autosnippet"},
+ { n.t("\\kappa") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'ci", snippetType="autosnippet"},
+ { n.t("\\circ") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'dg", snippetType="autosnippet", wordTrig=false},
+ { n.t("^{\\circ}") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="'da", snippetType="autosnippet", wordTrig=false},
+ { n.t("^{\\dag}") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="oxx", snippetType="autosnippet"},
+ { n.t("\\otimes") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="opp", snippetType="autosnippet"},
+ { n.t("\\oplus") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="upp", snippetType="autosnippet"},
+ { n.t("\\uplus") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="pm", snippetType="autosnippet"},
+ { n.t("\\pm") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="<|", snippetType="autosnippet"},
+ { n.t("\\lhd") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig="|>", snippetType="autosnippet"},
+ { n.t("\\rhd") },
+ { condition = h.in_mathzone }
+ ),
+ n.s({trig=",,", snippetType="autosnippet", wordTrig = false},
+ { n.t("\\,") },
+ { condition = h.in_mathzone }
+ ),
+}