I'm trying to create a snippet for vimwiki. The snippet must change __ to current time.
local line_begin = require("luasnip.extras.expand_conditions").line_begin
return {
s(
{trig='__', desc="Insert current time", snippetType = "autosnippet"},
{t("_"), t(vim.fn.system([[date +"%H:%M" | tr -d '\n']])), t({'_', ''})},
{condition = line_begin}
),
}
Looks like it must work, but it past only fix time - the time of start of first vimwiki buffer. How to improve the snippet?
I tried to find in documentation how to do this, but have not find any solution.