Neovim: Add sample LaTeX snippet
This commit is contained in:
33
home/modules/neovim/snippets_latex.lua
Normal file
33
home/modules/neovim/snippets_latex.lua
Normal file
@ -0,0 +1,33 @@
|
||||
return {
|
||||
-- The first list contains manually expanded snippts
|
||||
--
|
||||
-- The fmta function accepts a string ([[]] denote multiline strings) and node table.
|
||||
-- The node table entry order corresponds to the delimiters,
|
||||
-- the indices denote the jumping order, 0 is jumped to last.
|
||||
--
|
||||
-- Example:
|
||||
-- s("beg", fmta([[
|
||||
-- \begin{<>}
|
||||
-- <>
|
||||
-- \end{<>}]],
|
||||
-- { i(1), i(0), rep(1) }
|
||||
-- )),
|
||||
--
|
||||
-- The first jumping position (1) fills the \begin{<>} (and \end{<>} because of the repeat).
|
||||
-- The last jumping position (0) fills the body.
|
||||
|
||||
-- \begin{environment}
|
||||
s(
|
||||
"beg",
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{ i(1), i(0), rep(1) }
|
||||
)
|
||||
),
|
||||
}, {
|
||||
-- The second list contains autosnippets
|
||||
}
|
Reference in New Issue
Block a user