summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/Snippets/tex/environments.lua6
-rw-r--r--lua/Snippets/tex/figures.lua71
-rw-r--r--lua/Snippets/tex/greek.lua4
-rw-r--r--lua/Snippets/tex/math.lua36
-rw-r--r--lua/Snippets/tex/symbols.lua14
-rw-r--r--lua/plugins/treesitter.lua2
6 files changed, 124 insertions, 9 deletions
diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua
index c4bb38a..f2eb15a 100644
--- a/lua/Snippets/tex/environments.lua
+++ b/lua/Snippets/tex/environments.lua
@@ -2,7 +2,7 @@ local helper = require('Snippets.luasniphelpers')
local helper = require('Snippets.luasniphelpers')
return {
- -- variable environment
+
s({ trig = 'beg', snippetType = 'autosnippet' },
fmta(
[[
@@ -18,7 +18,7 @@ return {
),
{ condition = helper.line_begin }
),
- -- enumerate environment
+
s({ trig = 'enu', snippetType = 'autosnippet' },
fmta(
[[
@@ -32,7 +32,7 @@ return {
),
{ condition = helper.line_begin }
),
- -- align environment
+
s({ trig = 'ali', snippetType = 'autosnippet' },
fmta(
[[
diff --git a/lua/Snippets/tex/figures.lua b/lua/Snippets/tex/figures.lua
new file mode 100644
index 0000000..f95d874
--- /dev/null
+++ b/lua/Snippets/tex/figures.lua
@@ -0,0 +1,71 @@
+local tex = require('Snippets.luasniphelperslatex')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+
+ s({ trig = 'chfig', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[h]
+ \centering
+ \chemfig {
+ <>
+ }
+ \caption{<>}
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'imfig', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[h]
+ \centering
+ \includegraphics
+ [<>]
+ {<>}
+ \caption{<>}
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'pdfig', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[h]
+ \centering
+ \resizebox
+ {<>}
+ {!}
+ {\input{<>}}
+ \caption{<>}
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+}
diff --git a/lua/Snippets/tex/greek.lua b/lua/Snippets/tex/greek.lua
index 7431adc..b2d076e 100644
--- a/lua/Snippets/tex/greek.lua
+++ b/lua/Snippets/tex/greek.lua
@@ -131,14 +131,14 @@ return {
s({ trig = 'lam', snippetType = 'autosnippet' },
{
- t('\\lam '),
+ t('\\lambda '),
},
{ condition = tex.in_mathzone }
),
s({ trig = 'Lam', snippetType = 'autosnippet' },
{
- t('\\Lam '),
+ t('\\Lambda '),
},
{ condition = tex.in_mathzone }
),
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
index 882231a..47c21a8 100644
--- a/lua/Snippets/tex/math.lua
+++ b/lua/Snippets/tex/math.lua
@@ -44,6 +44,16 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = "lim", snippetType = "autosnippet" },
+ fmta(
+ '\\lim_{<>}',
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = "int", snippetType = "autosnippet" },
fmta(
'\\int_{<>}^{<>}',
@@ -150,7 +160,7 @@ return {
s({ trig = "sin", snippetType = "autosnippet" },
fmta(
- '\\sin{<>}',
+ '\\sin{(<>)}',
{
i(1),
}
@@ -160,7 +170,7 @@ return {
s({ trig = "cos", snippetType = "autosnippet" },
fmta(
- '\\cos{<>}',
+ '\\cos{(<>)}',
{
i(1),
}
@@ -170,7 +180,27 @@ return {
s({ trig = "tan", snippetType = "autosnippet" },
fmta(
- '\\tan{<>}',
+ '\\tan{(<>)}',
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = "det", snippetType = "autosnippet" },
+ fmta(
+ '\\det{(<>)}',
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = "ln", snippetType = "autosnippet" },
+ fmta(
+ '\\ln{(<>)}',
{
i(1),
}
diff --git a/lua/Snippets/tex/symbols.lua b/lua/Snippets/tex/symbols.lua
index 76fc3c2..ef57ca4 100644
--- a/lua/Snippets/tex/symbols.lua
+++ b/lua/Snippets/tex/symbols.lua
@@ -59,10 +59,24 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = 'perp', snippetType = 'autosnippet' },
+ {
+ t('\\perp '),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = 'Ria', snippetType = 'autosnippet' },
{
t('\\Rightarrow '),
},
{ condition = tex.in_mathzone }
),
+
+ s({ trig = 'to', snippetType = 'autosnippet' },
+ {
+ t('\\to '),
+ },
+ { condition = tex.in_mathzone }
+ ),
}
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua
index 4e488ad..ee16f1b 100644
--- a/lua/plugins/treesitter.lua
+++ b/lua/plugins/treesitter.lua
@@ -10,7 +10,7 @@ return {
auto_install = true,
ignore_install = { 'latex' },
highlight = { enable = true },
- indent = { enable = true, disable = { 'python' } },
+ indent = { enable = true, disable = { 'python' } },
ensure_installed = {
'javascript',
'python',