obsidian.nvim icon indicating copy to clipboard operation
obsidian.nvim copied to clipboard

Ability to configure default ID when creating new notes

Open jacobrreed opened this issue 4 months ago • 1 comments

🚀 The feature, motivation and pitch

I like my notes to have certain ids, and dont really like the default ids like 1711464520-VABT, but instead would like to enter the new note alias as well as the new notes id

Alternatives

No response

Additional context

No response

jacobrreed avatar Mar 26 '24 14:03 jacobrreed

You can configure the "generate note ID" process using the opts.note_id_func -- more context about halfway down in the config block here.

If the note ID is non-consistently deterministic and you would like to specify it each time, you could use the above feature and do something like this (note: untested)

opts = {
  note_id_func = function(title)
    local utils = require("obsidian.util")

    local id = utils.input("Enter note ID: ")
    
    -- ... do some defensive checks for valid string etc (e.g. remove invalid chars etc)

    return id
  end
}

tgallacher avatar Apr 05 '24 12:04 tgallacher