2022-04-27 21:43:49 +00:00
|
|
|
local luasnip = require("luasnip")
|
|
|
|
local s = luasnip.snippet
|
|
|
|
local f = luasnip.function_node
|
|
|
|
|
|
|
|
luasnip.add_snippets("all", {
|
2022-04-28 13:53:54 +00:00
|
|
|
s("date", { f(function(_, _)
|
|
|
|
return os.date("%Y-%m-%d")
|
|
|
|
end) }),
|
|
|
|
s("datetime", { f(function(_, _)
|
|
|
|
return os.date("%Y-%m-%d %H:%M:%S")
|
|
|
|
end) }),
|
|
|
|
s("diso", { f(function(_, _)
|
|
|
|
return os.date("%Y-%m-%dT%H:%M:%S")
|
|
|
|
end) }),
|
2024-01-23 11:17:00 +00:00
|
|
|
s("disoutc", { f(function(_, _)
|
|
|
|
return os.date("!%Y-%m-%dT%H:%M:%SZ")
|
|
|
|
end) }),
|
2022-04-27 21:43:49 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
require("luasnip.loaders.from_vscode").lazy_load()
|