mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
nvim/luasnip: from-the-future snippet
This commit is contained in:
parent
9a63c53260
commit
4eee316429
1 changed files with 11 additions and 2 deletions
|
|
@ -5,11 +5,20 @@ local cr = function() return t { "", "" } end
|
||||||
local i = luasnip.insert_node
|
local i = luasnip.insert_node
|
||||||
local f = luasnip.function_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", {
|
luasnip.add_snippets("typst", {
|
||||||
s("entry", {
|
s("entry", {
|
||||||
t("#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 { ")[", "" },
|
||||||
t(" "),
|
t(" "),
|
||||||
i(0),
|
i(0),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue