Add snippets for latex (frame)
This commit is contained in:
parent
029d95e75d
commit
fd84aebebb
@ -2,6 +2,7 @@
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_lua').lazy_load()
|
||||
luasnip.config.setup {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
|
26
luasnippets/tex.lua
Normal file
26
luasnippets/tex.lua
Normal file
@ -0,0 +1,26 @@
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local rep = require("luasnip.extras").rep
|
||||
|
||||
return {
|
||||
s({ trig = "frame", dscr = "A beamer frame" },
|
||||
fmta(
|
||||
[[
|
||||
\begin{frame}{<>}
|
||||
<>
|
||||
\end{frame}
|
||||
]],
|
||||
{
|
||||
i(1, "title"),
|
||||
i(2, "content")
|
||||
}
|
||||
)
|
||||
),
|
||||
}
|
Loading…
Reference in New Issue
Block a user