From 2eb8f79be9b2ad6fd56c7ce35fb607bf86f27e8b Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Sat, 8 Jul 2023 07:00:16 +0200 Subject: [PATCH] snippets: add a snippet for commit message - Adds a snippet for commit message to save working hours. - Remove redundant markdown snippet for the date. - Improve the markdown snippet for incremental note entry. Co-Authored-by: iGor milhit --- my_snippets/gitcommit.lua | 16 ++++++++++++++++ my_snippets/markdown.lua | 34 ++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 my_snippets/gitcommit.lua diff --git a/my_snippets/gitcommit.lua b/my_snippets/gitcommit.lua new file mode 100644 index 0000000..83a2755 --- /dev/null +++ b/my_snippets/gitcommit.lua @@ -0,0 +1,16 @@ +local ls = require("luasnip") +local s = ls.snippet +local t = ls.text_node + +return { + s( + { + trig = "hr", + name = "Heures", + dscr = "Insert a commit message content for saving the worked hours." + }, + { + t("organisation: enregistre les heures") + } + ) +} diff --git a/my_snippets/markdown.lua b/my_snippets/markdown.lua index 6e919ae..7883817 100644 --- a/my_snippets/markdown.lua +++ b/my_snippets/markdown.lua @@ -40,7 +40,7 @@ end return { s( { - trig = "datetime", + trig = "dt", name = "Datetime", dscr = "Insert the current datetime with locale daylight saving." }, @@ -48,16 +48,6 @@ return { f(get_datetime, {}) } ), - s( - { - trig = "date", - name = "Date", - dscr = "Insert the current date." - }, - { - f(get_date, {}) - } - ), s( { trig = "id", @@ -78,6 +68,23 @@ return { f(get_day, {}) } ), + s( + { + trig = "ie", + Name = "Inc entry", + dscr = "Insert an Inc entry for today (heading level 2)." + }, + fmt( + [[ + ## {} + + + ]], + { + f(get_day, {}) + } + ) + ), s( { trig = "fm", @@ -137,13 +144,12 @@ return { [[ [{1}][{2}] - [{2}]: {3} "{4}" + [{2}]: {3} ]], { i(1, "Link text"), i(2, "Reference"), - i(3, "Link target"), - i(4, "Title") + i(3, "Link target") }, { repeat_duplicates = true } )