62 lines
1.9 KiB
Lua
62 lines
1.9 KiB
Lua
-- stop lsp error messages
|
|
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#loaders
|
|
local ls = require("luasnip")
|
|
local s = ls.snippet
|
|
local sn = ls.snippet_node
|
|
local isn = ls.indent_snippet_node
|
|
local t = ls.text_node
|
|
local i = ls.insert_node
|
|
local f = ls.function_node
|
|
local c = ls.choice_node
|
|
local d = ls.dynamic_node
|
|
local r = ls.restore_node
|
|
local events = require("luasnip.util.events")
|
|
local ai = require("luasnip.nodes.absolute_indexer")
|
|
local extras = require("luasnip.extras")
|
|
local l = extras.lambda
|
|
local rep = extras.rep
|
|
local p = extras.partial
|
|
local m = extras.match
|
|
local n = extras.nonempty
|
|
local dl = extras.dynamic_lambda
|
|
local fmt = require("luasnip.extras.fmt").fmt
|
|
local fmta = require("luasnip.extras.fmt").fmta
|
|
local conds = require("luasnip.extras.expand_conditions")
|
|
local postfix = require("luasnip.extras.postfix").postfix
|
|
local types = require("luasnip.util.types")
|
|
local parse = require("luasnip.util.parser").parse_snippet
|
|
local ms = ls.multi_snippet
|
|
local k = require("luasnip.nodes.key_indexer").new_key
|
|
|
|
-- tutorials:
|
|
-- https://ejmastnak.com/tutorials/vim-latex/luasnip/#anatomy
|
|
-- https://evesdropper.dev/files/luasnip/
|
|
return
|
|
|
|
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#lua
|
|
-- the files may return two lists of snippets, the snippets in the first are
|
|
-- all added as regular snippets, while the snippets in the second will be
|
|
-- added as autosnippets (both are the defaults, if a snippet defines a
|
|
-- different snippetType, that will have preference)
|
|
|
|
-- First list of snippets (snippetType = "snippet") start
|
|
{
|
|
s(
|
|
{trig = "attrs", dscr = "nix new attrs"},
|
|
fmta(
|
|
[[
|
|
<> = {
|
|
<> = <>
|
|
};
|
|
]]
|
|
, { i(1),i(2),i(3) })
|
|
),
|
|
},
|
|
-- First list of snippets (snippetType = "snippet") end
|
|
|
|
-- Second list of snippets (snippetType = "autosnippet") start
|
|
{
|
|
}
|
|
-- Second list of snippets (snippetType = "autosnippet") end
|
|
|
|
|