From 4eee316429109ce9cfb0e5af04e57c7e03d38023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 31 Aug 2025 09:07:26 +0800 Subject: [PATCH] nvim/luasnip: from-the-future snippet --- .config/nvim/plugin/luasnip.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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),