dotfiles/symlinks/config/nvim/plugin/snippets.lua

21 lines
491 B
Lua

local luasnip = require("luasnip")
local s = luasnip.snippet
local f = luasnip.function_node
luasnip.add_snippets("all", {
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) }),
s("disoutc", { f(function(_, _)
return os.date("!%Y-%m-%dT%H:%M:%SZ")
end) }),
})
require("luasnip.loaders.from_vscode").lazy_load()