From e419285b1f90b0dc77cb3d20bd11ba3c01f5c3bc Mon Sep 17 00:00:00 2001 From: Nanderty Date: Sat, 23 Sep 2023 12:45:34 +0200 Subject: Snippets and code improvements --- lua/Snippets/tex/tables.lua | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 lua/Snippets/tex/tables.lua (limited to 'lua/Snippets/tex/tables.lua') 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 } + ), + +} -- cgit v1.2.3