diff --git a/.config/nvim/plugin/luasnip.lua b/.config/nvim/plugin/luasnip.lua index 7c1a47fb..b3e9fd94 100644 --- a/.config/nvim/plugin/luasnip.lua +++ b/.config/nvim/plugin/luasnip.lua @@ -5,11 +5,20 @@ local cr = function() return t { "", "" } end local i = luasnip.insert_node local f = luasnip.function_node -local function show_date_typst_entry() return os.date('"%Y-%m-%d %H:%M:%S"') end +local function datetime() return os.date('"%Y-%m-%d %H:%M:%S"') end +local function date() return os.date('"%Y-%m-%d"') end luasnip.add_snippets("typst", { s("entry", { t("#entry("), - f(show_date_typst_entry), + f(datetime), + t { ")[", "" }, + t(" "), + i(0), + t { "", "]" }, + }), + s("from-the-future", { + t("#entries.from-the-future("), + f(date), t { ")[", "" }, t(" "), i(0),