dotfiles/.config/nvim/snippets/markdown.lua

56 lines
1.9 KiB
Lua

local s = require("luasnip.nodes.snippet").S
local t = require("luasnip.nodes.textNode").T
local fmt = require("luasnip.extras.fmt").fmt
local i = require("luasnip.nodes.insertNode").I
return {
-- some common Gentoo review comments
s({ trig = 'pkgdev',
name = 'use pkgdev',
}, {
t({ [[Consider comitting and pushing with ]] ..
[[[`pkgdev`](https://wiki.gentoo.org/wiki/Pkgdev) or checking ]] ..
[[with [`pkgcheck`](https://wiki.gentoo.org/wiki/Pkgcheck) ]] ..
[[before pushing, it catches these things.]]
}),
}),
s({ trig = 'quotevar',
name = 'quote variable',
},
fmt([[Please quote `${{{variable}}}`, it could contain spaces.]],
{ variable = i(1) })),
s({ trig = ':=',
name = 'subscribe to subslot'
}, {
t([[Very likely [needs `:=`](https://devmanual.gentoo.org/]] ..
[[general-concepts/slotting/index.html#abi-breakage).]]),
}),
s({ trig = 'eclass',
name = 'eclass link'
},
fmt([[[{linktext}](https://devmanual.gentoo.org/eclass-reference/]] ..
[[{eclass}.eclass/)]],
{
linktext = i(1),
eclass = i(2)
})),
s({ trig = 'die',
name = 'add || die'
}, {
t([[Use [`|| die`](https://devmanual.gentoo.org/ebuild-writing/]] ..
[[error-handling/#the-die-function) on external commands.]]),
}),
s({ trig = 'EAPI',
name = 'use EAPI 8'
}, {
t([[Please use [EAPI 8](https://devmanual.gentoo.org/]] ..
[[ebuild-writing/eapi/index.html#eapi-8) where possible.]]),
}),
s({ trig = 'PYTHON_USEDEP',
name = 'use PYTHON_USEDEP'
}, {
t([[Please use [`${PYTHON_USEDEP}`](https://projects.gentoo.org]] ..
[[/python/guide/multi.html#dependencies) for python dependencies.]])
}),
}