snippets: add snippet for incremental note commits
Co-Authored-by: iGor milhit <igor@milhit.ch>
parent
4e5765521a
commit
11d845f1ee
|
@ -1,16 +1,38 @@
|
||||||
local ls = require("luasnip")
|
local ls = require("luasnip")
|
||||||
local s = ls.snippet
|
local s = ls.snippet
|
||||||
local t = ls.text_node
|
local t = ls.text_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
|
||||||
|
-- Function to get the current date
|
||||||
|
local get_date = function()
|
||||||
|
return os.date("%Y-%m-%d")
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
s(
|
s(
|
||||||
{
|
{
|
||||||
trig = "hr",
|
trig = "hr",
|
||||||
name = "Heures",
|
name = "Heures",
|
||||||
dscr = "Insert a commit message content for saving the worked hours."
|
dscr = "Insert a commit message for saving the worked hours."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
t("organisation: enregistre les heures")
|
t("organisation: enregistre les heures")
|
||||||
}
|
}
|
||||||
|
),
|
||||||
|
s(
|
||||||
|
{
|
||||||
|
trig = "ic",
|
||||||
|
name = "Incremental note commit message",
|
||||||
|
dscr = "Insert a commit message for my incremental notes commits."
|
||||||
|
},
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
Incrémente la note du {1}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
f(get_date, {})
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue