summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/tex
diff options
context:
space:
mode:
authorNanderty <psopka@sopka.ch>2023-06-12 08:29:20 +0200
committerNanderty <psopka@sopka.ch>2023-06-12 08:29:20 +0200
commit52cd974b95bb59f6500426fe020a2983dc0d37eb (patch)
treec07b678734fb9827064990820a69c220f1fcdf82 /lua/Snippets/tex
parentcac321dd2ef6ca545fdca5545e26048ecff3dfa9 (diff)
downloadneovim-config-52cd974b95bb59f6500426fe020a2983dc0d37eb.tar.gz
neovim-config-52cd974b95bb59f6500426fe020a2983dc0d37eb.tar.bz2
neovim-config-52cd974b95bb59f6500426fe020a2983dc0d37eb.zip
Snippets und Verbesserungen
Diffstat (limited to 'lua/Snippets/tex')
-rw-r--r--lua/Snippets/tex/chemistry.lua10
-rw-r--r--lua/Snippets/tex/environments.lua4
-rw-r--r--lua/Snippets/tex/figures.lua152
-rw-r--r--lua/Snippets/tex/general.lua11
-rw-r--r--lua/Snippets/tex/math.lua2
-rw-r--r--lua/Snippets/tex/sections.lua12
6 files changed, 165 insertions, 26 deletions
diff --git a/lua/Snippets/tex/chemistry.lua b/lua/Snippets/tex/chemistry.lua
index a75536f..3ae0e9d 100644
--- a/lua/Snippets/tex/chemistry.lua
+++ b/lua/Snippets/tex/chemistry.lua
@@ -22,14 +22,4 @@ return {
}
)
),
-
- s({ trig = 'chrg', snippetType = 'autosnippet' },
- fmta(
- '\\charge{<>}{<>}',
- {
- i(1),
- i(2),
- }
- )
- ),
}
diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua
index 3e8b543..46e5ee5 100644
--- a/lua/Snippets/tex/environments.lua
+++ b/lua/Snippets/tex/environments.lua
@@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers')
return {
- s({ trig = 'beg', snippetType = 'autosnippet' },
+ s({ trig = 'bgn', snippetType = 'autosnippet' },
fmta(
[[
\begin{<>}
@@ -19,7 +19,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ali', snippetType = 'autosnippet' },
+ s({ trig = 'lgn', snippetType = 'autosnippet' },
fmta(
[[
\begin{align*}
diff --git a/lua/Snippets/tex/figures.lua b/lua/Snippets/tex/figures.lua
index 4adc1b4..3cbed87 100644
--- a/lua/Snippets/tex/figures.lua
+++ b/lua/Snippets/tex/figures.lua
@@ -6,12 +6,39 @@ return {
s({ trig = 'chfig', snippetType = 'autosnippet' },
fmta(
[[
-\begin{figure}[h]
+\begin{figure}[!h]
\centering
\chemfig {
<>
}
- \caption{<>}
+ \caption{
+ <>
+ }
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'chsch', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[!h]
+ \centering
+ \schemestart
+ \chemfig {
+ <>
+ }
+ \schemestop
+ \caption{
+ <>
+ }
\label{fig:<>}
\end{figure}
]],
@@ -27,12 +54,14 @@ return {
s({ trig = 'imfig', snippetType = 'autosnippet' },
fmta(
[[
-\begin{figure}[h]
+\begin{figure}[!h]
\centering
\includegraphics
[<>]
{<>}
- \caption{<>}
+ \caption{
+ <>
+ }
\label{fig:<>}
\end{figure}
]],
@@ -49,13 +78,15 @@ return {
s({ trig = 'pdfig', snippetType = 'autosnippet' },
fmta(
[[
-\begin{figure}[h]
+\begin{figure}[!h]
\centering
\resizebox
{<>}
{!}
{\input{<>}}
- \caption{<>}
+ \caption{
+ <>
+ }
\label{fig:<>}
\end{figure}
]],
@@ -68,4 +99,113 @@ return {
),
{ condition = helper.line_begin }
),
+
+ s({ trig = 'sch', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\schemestart
+<>
+\schemestop
+]],
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'sus', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\subscheme {
+ <>
+}
+]],
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'chf', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\chemfig {
+ <>
+}
+ ]],
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'arr', snippetType = 'autosnippet' },
+ fmta(
+ '\\arrow(<>){<>}[<>]',
+ {
+ i(1),
+ i(2),
+ i(3),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'move', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\chemmove[shorten <<=<>,shorten >>=<>]{
+ \draw(<>).. controls +(<>) and +(<>).. (<>);
+}
+ ]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ i(5),
+ i(6),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'chr', snippetType = 'autosnippet' },
+ fmta(
+ '\\charge{<>}{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'nme', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\chemname{
+ <>
+}{<>}
+]],
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'omi', snippetType = 'autosnippet' },
+ { t('\\ominus') },
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'opl', snippetType = 'autosnippet' },
+ { t('\\oplus') },
+ { condition = tex.in_figure }
+ ),
}
diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua
index b53f80c..23d2e60 100644
--- a/lua/Snippets/tex/general.lua
+++ b/lua/Snippets/tex/general.lua
@@ -38,7 +38,7 @@ return {
)
),
- s({ trig = 'bf', snippetType = 'autosnippet' },
+ s({ trig = 'bft', snippetType = 'autosnippet' },
fmta(
'\\textbf{<>}',
{
@@ -47,6 +47,15 @@ return {
)
),
+ s({ trig = 'tlc', snippetType = 'autosnippet' },
+ fmta(
+ '\\textit{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+
s({ trig = 'cte', snippetType = 'autosnippet' },
fmta(
'\\supercite{<>}',
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
index 47c21a8..53a2807 100644
--- a/lua/Snippets/tex/math.lua
+++ b/lua/Snippets/tex/math.lua
@@ -65,7 +65,7 @@ return {
{ condition = tex.in_mathzone }
),
- s({ trig = 'nn', snippetType = 'autosnippet' },
+ s({ trig = 'hhn', snippetType = 'autosnippet' },
fmta(
'\\num{<>}',
{
diff --git a/lua/Snippets/tex/sections.lua b/lua/Snippets/tex/sections.lua
index 432a424..582201e 100644
--- a/lua/Snippets/tex/sections.lua
+++ b/lua/Snippets/tex/sections.lua
@@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers')
return {
- s({ trig = 'sec', snippetType = 'autosnippet' },
+ s({ trig = 'sct', snippetType = 'autosnippet' },
fmta(
'\\section{<>}',
{
@@ -13,7 +13,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'nsec', snippetType = 'autosnippet' },
+ s({ trig = 'nsc', snippetType = 'autosnippet' },
fmta(
'\\newpage\\section{<>}',
{
@@ -23,7 +23,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ssec', snippetType = 'autosnippet' },
+ s({ trig = 'ssc', snippetType = 'autosnippet' },
fmta(
'\\subsection{<>}',
{
@@ -33,7 +33,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'nssec', snippetType = 'autosnippet' },
+ s({ trig = 'nssc', snippetType = 'autosnippet' },
fmta(
'\\newpage\\subsection{<>}',
{
@@ -43,7 +43,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ssec', snippetType = 'autosnippet' },
+ s({ trig = 'sss', snippetType = 'autosnippet' },
fmta(
'\\newpage\\subsubsection{<>}',
{
@@ -53,7 +53,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'nsssec', snippetType = 'autosnippet' },
+ s({ trig = 'nsss', snippetType = 'autosnippet' },
fmta(
'\\newpage\\subsubsection{<>}',
{