add function for new obsidian note id

This commit is contained in:
jc 2024-06-01 13:16:33 -04:00
commit 872e0a43c6
No known key found for this signature in database

View file

@ -27,6 +27,17 @@ return {
follow_url_func = function(url)
vim.fn.jobstart({ "open", url })
end,
note_id_func = function(title)
if title ~= nil then
print("create new obsidian note with given title: " .. title)
return title
end
local suffix = ""
for _ = 1, 4 do
suffix = suffix .. string.char(math.random(65, 90))
end
return tostring(os.time()) .. "-" .. suffix
end,
},
mappings = {
["<CR>"] = {