Warning: Note with same name exists in another folder

Use case or problem

I want to avoid having duplicate note names. But sometimes I like to create new notes in a different folder than where they will eventually be moved. When doing this, Obsidian allows matching note names in since they are in different locations, which can be okay if you don’t mind your links potentially later getting updated to include paths. In my case, I really prefer avoiding these link changes.

Request

If Obsidian had a setting that allowed a warning to appear informing me that a note with same name already exists in another folder, I could simply use a different name for the note and avoid any later issues.

Current workaround (optional)

It isn’t really a workaround, but if you keep all your notes in a single folder, you can rest assured that Obsidian will not allow you to create matching note names. But this workflow is not very realistic in the long run.

Below, @moritzschulz shares a helpful workaround using Quick Switcher. As I mention in my reply, it helps but I still think this feature could be needed for the various other ways that notes are created, like Templater, for example.

Related

I just had the thought that perhaps if a Flat View were ever implemented, it would make sense that while in Flat View Mode, creating new notes would automatically warn you if you were creating a note that had a duplicate elsewhere in the vault. Here’s the link the Flat view request: Flat view - Folder toggle - (mode to only show files in Explorer pane)

Thanks!

3 Likes

Another workaround (due to @bencodezen) that works quite well in most cases is to remap the Ctrl+N hotkey to opening the quick switcher. If you start typing your new note’s title in the search bar there, you are not only shown existing notes with similar yet non-identical titles, but can simply proceed to creating a new note by hitting enter if there is no good match. Even more useful if you set the quick switcher to include non-existent notes.

The only downside to this is that the search criteria of the quick switcher are so fuzzy that it won’t suggest creating a new note if the new titel is very similar (though not identical) to that of an existing note - say if you have a note titled “Obsidian” and would like to create a new note titled “Obsidi” or “Obsdian”.

2 Likes

@moritzschulz Thanks for the great suggestion. I used to actually use this technique sometimes then just sort of let it go by the wayside after it didn’t fully solve the problem. As usual, I made the mistake of neglecting something until forgetting it just because it wasn’t perfect. Thinking back, it was probably when I started using macros in concert with Templater prompts to create new notes that I abandoned the Quick Switcher trick.

Although there is a prompt in Templater that lets you search for a file similar to Quick Switcher, I never quite got it working right so as to totally trust that I was avoiding duplicates. At that point I reverted to the failsafe do-it-all-in-one-folder-to-be-sure method.

One way I sometimes double check for duplicates before links get altered is to use Windows and search for all .md files in my vault, copy them, and paste them into a temporary folder. If there are no warnings about files already existing, I know I’m still good. If there are, I will check the vault to see if links were altered into the format including paths. If they were, it is sometimes easy to use VSCode to Search and Replace in all files to fix the links after renaming one of the duplicate notes. However, in some cases, it requires carefully reviewing each occurrence and ensuring the link goes to the right note.

It is definitely a headache that would be great to be able to alleviate one way or another.

Thanks again for your helpful reply!

1 Like

This is an excellent idea and has my vote.

This is an old thread, but what I do is use the core plugin “Unique note creator”. This is what it was intended for.

I create a new note, and append it with YYYY-MM-DD-HHmm and then I’ll add my own additional title after that (optional.)

If the title works for me, I can later remove that date tag from the title. Or keep it. Or just use the date, and have no specific title. But this way, I can create the note without thinking about it in the first place. Then organize later.

1 Like