nixos-config/configs/nixvim/fiesta/modules/setups/snippets/snippets/all.lua

32 lines
541 B
Lua
Raw Normal View History

return {
2024-02-02 04:40:16 +00:00
s(
"today",
f(function()
return os.date("%F")
end)
),
2024-02-02 04:40:16 +00:00
s(
"retrieve",
f(function()
return string.format("(retrieved %s)", os.date("%F"))
end)
),
2024-02-02 04:40:16 +00:00
s(
{ trig = 'reldate (-?%d+) "(.+)"', regTrig = true },
f(function(_, snip)
-- The point is in number of days.
local point = 60 * 60 * 24 * snip.captures[1]
2024-02-02 04:40:16 +00:00
local now = os.time()
return os.date(snip.captures[2], now + point)
end)
),
2024-02-02 04:40:16 +00:00
s("#!", fmt("#!{}", i(1, "/usr/bin/env bash"))),
2024-02-02 04:40:16 +00:00
parse("ie", "(i.e., $1)"),
parse("eg", "(e.g., $1)"),
}