Skip to content

Conversation

thorinf
Copy link

@thorinf thorinf commented Sep 26, 2025

Fix note_id_func to use title parameter and readable timestamps

What does the PR do?

Changes for zettel id when creating a new note, improving file naming:

  • Zettel ID will use a more readable version of time.
  • If the title is provided it's formatted and used as a suffix.
  • Removed the random 4 letters as suffix.

Before: :Obsidian new "My Note" -> 1758908292-NZNT.md
After: :Obsidian new "My Note" -> 202509261930-my-note.md

Very happy to be corrected if the Unix timestamp and random letters is better, this just feels more intuitive as a default to me.

If the change isn't good then I would like to suggest adding the note_id_func override as a commented section in the install snippets.

PR Checklist

  • The PR contains a description of the changes
  • I read the [CONTRIBUTING.md] file
  • The CHANGELOG.md is updated
  • The changes are documented in the README.md file
  • The code complies with make chores (for style, lint, types, and tests)

@neo451
Copy link
Member

neo451 commented Sep 26, 2025

Thank you for the PR. Here's my thoughts:

  1. the old and your new zettel approach are both very specific approach that one can do for note_id_func. And yours is undoubtedly better.
  2. Obsidian app has another two approaches, one with just title as id, one with an even simpler zettel id, where it is just a timestamp.
  3. Since we have already have a option that gives so many possibility, the default one should be the least opinionated one (title as id). This has just been a change on my mind that should be executed on 4.0.0, which is a major breaking change.
  4. So I believe your example should be in the wiki, I just opened a new page here, you can add a new section, and link to it in the comment in this PR, thanks. https://github.com/obsidian-nvim/obsidian.nvim/wiki/Recipes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants