summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/tex
diff options
context:
space:
mode:
Diffstat (limited to 'lua/Snippets/tex')
-rw-r--r--lua/Snippets/tex/environments.lua49
-rw-r--r--lua/Snippets/tex/general.lua23
-rw-r--r--lua/Snippets/tex/greek.lua17
-rw-r--r--lua/Snippets/tex/math.lua29
4 files changed, 118 insertions, 0 deletions
diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua
new file mode 100644
index 0000000..fd19387
--- /dev/null
+++ b/lua/Snippets/tex/environments.lua
@@ -0,0 +1,49 @@
+local helper = require('Snippets.luasniphelpers')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+ -- variable environment
+ s({ trig = 'beg', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{<>}
+ <>
+\end{<>}
+]],
+ {
+ i(1),
+ i(2),
+ rep(1),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+ -- enumerate environment
+ s({ trig = 'enu', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{enumerate*}
+ \item <>
+\end{enumerate*}
+]],
+ {
+ i(1),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+ -- align environment
+ s({ trig = 'ali', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{align*}
+ <>
+\end{align*}
+]],
+ {
+ i(1),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+}
diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua
new file mode 100644
index 0000000..ebe76fe
--- /dev/null
+++ b/lua/Snippets/tex/general.lua
@@ -0,0 +1,23 @@
+local tex = require('Snippets.luasniphelperslatex')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+ s({ trig = "sec", snippetType = "autosnippet" },
+ fmta(
+ '\\section*{<>}',
+ {
+ i(1),
+ }
+ ),
+ { condition = line_begin }
+ ),
+ s({ trig = "hh", snippetType = "autosnippet" },
+ fmta(
+ '\\SI{<>}{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ )
+ ),
+}
diff --git a/lua/Snippets/tex/greek.lua b/lua/Snippets/tex/greek.lua
new file mode 100644
index 0000000..f47cdac
--- /dev/null
+++ b/lua/Snippets/tex/greek.lua
@@ -0,0 +1,17 @@
+local tex = require('Snippets.luasniphelperslatex')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+ s({ trig = "pi", snippetType = "autosnippet" },
+ {
+ t("\\pi"),
+ },
+ { condition = tex.in_mathzone }
+ ),
+ s({ trig = "0eps", snippetType = "autosnippet" },
+ {
+ t("\\epsilon_0"),
+ },
+ { condition = tex.in_mathzone }
+ ),
+}
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
new file mode 100644
index 0000000..670ed80
--- /dev/null
+++ b/lua/Snippets/tex/math.lua
@@ -0,0 +1,29 @@
+local tex = require('Snippets.luasniphelperslatex')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+ s({ trig = '/', snippetType = 'autosnippet' },
+ fmta(
+ '\\frac{<>}{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+ s({ trig = "in", snippetType = "autosnippet" },
+ fmta(
+ '\\int_{<>}^{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+ s({ trig = 'df', snippetType = 'autosnippet' },
+ { t('\\diff ') },
+ { condition = tex.in_mathzone }
+ ),
+}