epwalsh / obsidian.nvim

Obsidian 🤝 Neovim
Apache License 2.0
3.35k stars 150 forks source link

Create new file only generate random file name #321

Closed destnguyxn2 closed 5 months ago

destnguyxn2 commented 6 months ago

🐛 Describe the bug

With the recently create new file function update from Search file, when I use keymap to create new file, the file will have name random but the title in the body is correct. Example: image image image

I don't know if the previous ObsidianNew have the error too since I just use obsidian.nvim recently.

My neovim version is 0.9.1, and my config is only change the directory

Versions

my version is "obsidian.nvim": { "branch": "main", "commit": "bc2561cd4d8049a5c91415f15bfb5c3e68b79c48" },

epwalsh commented 6 months ago

@destnguyxn you can customize how the names for new notes are generated by overriding the note_id_func in your obsidian.nvim config. See :help obsidian.nvim and then search "note_id_func".

thyttan commented 6 months ago

I was also a bit confused about this, but your reply helped me to set this up to work like I expected it to.

Things leading to my confusion:

epwalsh commented 5 months ago

Gotcha. I've adding some wording to the readme to clarify your 2nd point.

nref commented 5 months ago

Thanks for the plugin! I landed here after also getting surprised by Zettelkasten naming: I have an existing vault and when I try ObsidianFollowLink it doesn't find the existing note that is in the same directory. When I accept the offer to create one, it's got this naming (which looked random to me too but I see now it's Zettelkasten).

I don't care about the file naming, but I'm having trouble following links. The nvim current working directory is my vault root, which is also configured in user.lua.

epwalsh commented 5 months ago

@nref sounds like a separate issue. Can you open a bug report with steps to reproduce?

nref commented 5 months ago

@epwalsh Of course. I should have not hijacked this one. https://github.com/epwalsh/obsidian.nvim/issues/332