local ls = require("luasnip") local s = ls.snippet local t = ls.text_node local i = ls.insert_node local f = ls.function_node local extras = require("luasnip.extras") local rep = extras.rep local timestamp = function() return tostring(os.time()) end local get_date = function() return os.date("%H:%M:%S %d.%m.%Y") end local get_name = function() return "Nikolai Papin" end return { -- Creates a frontmatter with markdown note metadata s("frontmatter", { t("---"), t({ "", "Markdown note", "" }), t({ "", "title: \"" }), i(1), t("\""), t({ "", "date: \"" }), f(get_date, {}), t("\""), t({ "", "author: \"" }), f(get_name, {}), t("\""), t({ "", "keywords: ["}), i(2), t("]"), t({ "", "tags: [["}), i(3), t("]]"), t({ "", "id: " }), f(timestamp, {}), t({ "", "---", "", "# " }), rep(1), -- Reuses the first insert node t({ "", ""}), t({ "", ""}), i(4) -- Final cursor position }), -- Creates a mood report template s("wellbeingreport", { t("---"), t({ "", "Well-being report", "" }), t({ "", "date: " }), f(get_date, {}), t({ "", "sleep: " }), i(1), t("/5"), t({ "", "emotions: [" }), i(2), t("]"), t({ "", "comfort: " }), i(3), t("/5"), t({ "", "complaints: ["}), i(4), t("]"), t({ "", "mood: " }), i(5), t("/10"), t({ "", "---" }), }), }