2022-08-20 03:34:21 +02:00
|
|
|
local s = require("luasnip.nodes.snippet").S
|
|
|
|
local i = require("luasnip.nodes.insertNode").I
|
|
|
|
local fmt = require("luasnip.extras.fmt").fmt
|
|
|
|
|
|
|
|
return {
|
|
|
|
s({ trig = 'source',
|
|
|
|
name = 'source code block',
|
2022-12-07 23:52:26 +01:00
|
|
|
dscr = 'insert a source code block'
|
2022-08-20 22:16:24 +02:00
|
|
|
},
|
2022-08-20 03:34:21 +02:00
|
|
|
fmt([[
|
|
|
|
[source,{language}]
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
{cursor}
|
|
|
|
--------------------------------------------------------------------------------
|
2022-08-20 22:16:24 +02:00
|
|
|
]] , {
|
|
|
|
language = i(1, 'shell'),
|
|
|
|
cursor = i(0)
|
2022-12-07 23:52:26 +01:00
|
|
|
})),
|
2022-12-08 18:25:06 +01:00
|
|
|
|
2022-12-07 23:52:26 +01:00
|
|
|
s({ trig = 'quote',
|
|
|
|
name = 'quote block',
|
|
|
|
descr = 'insert a quote block'
|
|
|
|
},
|
|
|
|
fmt([[
|
|
|
|
[quote,{author},{place}]
|
|
|
|
________________________________________________________________________________
|
|
|
|
{cursor}
|
|
|
|
________________________________________________________________________________
|
|
|
|
]] , {
|
2022-12-09 16:51:09 +01:00
|
|
|
author = i(1, 'who'),
|
|
|
|
place = i(2, 'where'),
|
2022-12-07 23:52:26 +01:00
|
|
|
cursor = i(0)
|
2022-12-08 18:25:06 +01:00
|
|
|
})),
|
|
|
|
|
|
|
|
s({ trig = 'collapsible',
|
|
|
|
name = 'collapsible block',
|
|
|
|
descr = 'insert a collapsible block'
|
|
|
|
},
|
|
|
|
fmt([[
|
|
|
|
.{title}
|
|
|
|
[%collapsible]
|
|
|
|
================================================================================
|
|
|
|
{cursor}
|
|
|
|
================================================================================
|
|
|
|
]] , {
|
|
|
|
title = i(1, 'title'),
|
|
|
|
cursor = i(0)
|
|
|
|
})),
|
2022-12-23 10:13:39 +01:00
|
|
|
|
|
|
|
s({ trig = 'table',
|
|
|
|
name = 'table',
|
|
|
|
descr = 'insert a table'
|
|
|
|
},
|
|
|
|
fmt([[
|
|
|
|
.{title}
|
|
|
|
|===============================================================================
|
|
|
|
| {header1} | {header2}
|
|
|
|
|
|
|
|
| {cursor}
|
|
|
|
|===============================================================================
|
|
|
|
]] , {
|
|
|
|
title = i(1, 'title'),
|
|
|
|
header1 = i(2, 'header 1'),
|
|
|
|
header2 = i(3, 'header 2'),
|
|
|
|
cursor = i(0)
|
|
|
|
})),
|
2022-08-20 03:34:21 +02:00
|
|
|
}
|