dotfiles/nvim/luasnippets/all.lua
Gabriel Arazas 24b3b106ce Replace UltiSnips with LuaSnip
The UltiSnips snippets are still there, I just have to port them slowly
over time.
2022-04-24 21:19:53 +08:00

35 lines
655 B
Lua

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