diff options
| author | Nanderty <psopka@sopka.ch> | 2023-09-23 12:45:34 +0200 |
|---|---|---|
| committer | Nanderty <psopka@sopka.ch> | 2023-09-23 12:45:34 +0200 |
| commit | e419285b1f90b0dc77cb3d20bd11ba3c01f5c3bc (patch) | |
| tree | f559371bf9599f30a3aa262b2cbe6f44692910d5 /lua/Snippets | |
| parent | 52cd974b95bb59f6500426fe020a2983dc0d37eb (diff) | |
| download | neovim-config-e419285b1f90b0dc77cb3d20bd11ba3c01f5c3bc.tar.gz neovim-config-e419285b1f90b0dc77cb3d20bd11ba3c01f5c3bc.tar.bz2 neovim-config-e419285b1f90b0dc77cb3d20bd11ba3c01f5c3bc.zip | |
Snippets and code improvements
Diffstat (limited to 'lua/Snippets')
| -rw-r--r-- | lua/Snippets/tex/figures.lua | 55 | ||||
| -rw-r--r-- | lua/Snippets/tex/general.lua | 4 | ||||
| -rw-r--r-- | lua/Snippets/tex/sections.lua | 2 | ||||
| -rw-r--r-- | lua/Snippets/tex/tables.lua | 52 |
4 files changed, 101 insertions, 12 deletions
diff --git a/lua/Snippets/tex/figures.lua b/lua/Snippets/tex/figures.lua index 3cbed87..81a4368 100644 --- a/lua/Snippets/tex/figures.lua +++ b/lua/Snippets/tex/figures.lua @@ -11,8 +11,7 @@ return { \chemfig { <> } - \caption{ - <> + \caption{<> } \label{fig:<>} \end{figure} @@ -36,8 +35,7 @@ return { <> } \schemestop - \caption{ - <> + \caption{<> } \label{fig:<>} \end{figure} @@ -59,8 +57,7 @@ return { \includegraphics [<>] {<>} - \caption{ - <> + \caption{<> } \label{fig:<>} \end{figure} @@ -84,8 +81,7 @@ return { {<>} {!} {\input{<>}} - \caption{ - <> + \caption{<> } \label{fig:<>} \end{figure} @@ -100,7 +96,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'sch', snippetType = 'autosnippet' }, + s({ trig = 'scm', snippetType = 'autosnippet' }, fmta( [[ \schemestart @@ -184,6 +180,27 @@ return { { condition = tex.in_figure } ), + s({ trig = 'brc', snippetType = 'autosnippet' }, + fmta( + [[ +\polymerdelim[height = <>, depth = <>, + open xshift=<>, close xshift=<>, + indice = \!\!<>] + {op<>}{cl<>} +]], + { + i(1), + i(2), + i(3), + i(4), + i(5), + i(6), + i(7), + } + ), + { condition = tex.in_figure } + ), + s({ trig = 'nme', snippetType = 'autosnippet' }, fmta( [[ @@ -208,4 +225,24 @@ return { { t('\\oplus') }, { condition = tex.in_figure } ), + + s({ trig = 'crp', snippetType = 'autosnippet' }, + fmta( + [[(-[::<>,0.2,,,draw=none]\oplus)]], + { + i(1), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'crm', snippetType = 'autosnippet' }, + fmta( + [[(-[::<>,0.2,,,draw=none]\ominus)]], + { + i(1), + } + ), + { condition = tex.in_figure } + ), } diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua index 23d2e60..089edef 100644 --- a/lua/Snippets/tex/general.lua +++ b/lua/Snippets/tex/general.lua @@ -21,14 +21,14 @@ return { ) ), - s({ trig = 'new', snippetType = 'autosnippet' }, + s({ trig = 'nwp', snippetType = 'autosnippet' }, { t('\\newpage'), }, { condition = helper.line_begin } ), - s({ trig = 'hh', snippetType = 'autosnippet' }, + s({ trig = 'snt', snippetType = 'autosnippet' }, fmta( '\\SI{<>}{<>}', { diff --git a/lua/Snippets/tex/sections.lua b/lua/Snippets/tex/sections.lua index 582201e..28640fc 100644 --- a/lua/Snippets/tex/sections.lua +++ b/lua/Snippets/tex/sections.lua @@ -45,7 +45,7 @@ return { s({ trig = 'sss', snippetType = 'autosnippet' }, fmta( - '\\newpage\\subsubsection{<>}', + '\\subsubsection{<>}', { i(1), } diff --git a/lua/Snippets/tex/tables.lua b/lua/Snippets/tex/tables.lua new file mode 100644 index 0000000..80531e1 --- /dev/null +++ b/lua/Snippets/tex/tables.lua @@ -0,0 +1,52 @@ +local helper = require('Snippets.luasniphelpers') +local helper = require('Snippets.luasniphelpers') + +return { + + s({ trig = 'tbl', snippetType = 'autosnippet' }, + fmta( + [[ +\begin{table}[!h] + \centering + \begin{tabular}{ <> } + <> + \end{tabular} + \caption{<> + } + \label{fig:<>} +\end{table} +]], + { + i(1), + i(2), + i(3), + i(4), + } + ), + { condition = helper.line_begin } + ), + + s({ trig = 'tbx', snippetType = 'autosnippet' }, + fmta( + [[ +\begin{table}[!h] + \centering + \begin{tabularx}{\textwidth}{ <> } + <> + \end{tabularx} + \caption{<> + } + \label{fig:<>} +\end{table} +]], + { + i(1), + i(2), + i(3), + i(4), + } + ), + { condition = helper.line_begin } + ), + +} |
