dotfiles/.config/nvim/snippets/asciidoc.lua

68 lines
1.8 KiB
Lua
Raw Normal View History

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 03:34:21 +02:00
fmt([[
[source,{language}]
--------------------------------------------------------------------------------
{cursor}
--------------------------------------------------------------------------------
]] , {
language = i(1, 'shell'),
cursor = i(0)
2022-12-07 23:52:26 +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)
})),
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
}