Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

id in frontmatter works great in neovim, but Obsidian app is confused about wikilinks with id as path.#735

Unanswered
joshfullmer asked this question inQ&A
Discussion options

I'm admittedly quite new to both using Obsidian and using the obsidian.nvim plugin, so I very well could be missing something (in fact, I hope that's the case).

First, here's my full obsidian.nvim config:

return {"epwalsh/obsidian.nvim",version="*",-- recommended, use latest release instead of latest commitlazy=true,ft="markdown",dependencies= {"nvim-lua/plenary.nvim",  },config=function()require("obsidian").setup({workspaces= {        {name="personal",path="~/vaults/personal",        },      },completion= {nvim_cmp=true,min_chars=2,      },follow_url_func=function(url)-- vim.fn.jobstart({ "open", url }) -- Mac OSvim.ui.open(url)-- need Neovim 0.10.0+end,---@paramspec{id:string,dir:obsidian.Path,title:string|? }---@returnstring|obsidian.Path The full path to the new note.note_path_func=function(spec)-- This is equivalent to the default behavior.localpath=spec.dir/tostring(spec.title)returnpath:with_suffix(".md")end,wiki_link_func="prepend_note_path",daily_notes= {folder="/2. Areas/Journal/",      },    })vim.keymap.set("n","<leader>oc","<cmd>lua require('obsidian').util.toggle_checkbox()<CR>",      {desc="Obsidian Check Checkbox"}    )vim.keymap.set("n","<leader>ot","<cmd>ObsidianTemplate<CR>", {desc="[T]emplate"})vim.keymap.set("n","<leader>oo","<cmd>ObsidianOpen<CR>", {desc="[O]pen in Obsidian App"})vim.keymap.set("n","<leader>ob","<cmd>ObsidianBacklinks<CR>", {desc="[B]acklinks"})vim.keymap.set("n","<leader>ol","<cmd>ObsidianLinks<CR>", {desc="[L]inks"})vim.keymap.set("n","<leader>on","<cmd>ObsidianNew<CR>", {desc="[N]ew Note"})vim.keymap.set("n","<leader>os","<cmd>ObsidianSearch<CR>", {desc="[S]earch Obsidian (grep)"})vim.keymap.set("n","<leader>oq","<cmd>ObsidianQuickSwitch<CR>", {desc="[Q]uick Switch"})vim.keymap.set("n","<leader>od","<cmd>ObsidianToday<CR>", {desc="[D]aily Note"})end,}

Currently, my workflow is to create notes withObsidianNew using the keymap. For example, I create a fileTODO, the filename isTODO.md, and it adds frontmatter that looks like this:

---id:1727199696-DZNBaliases:  -TODOtags:[]---

Then, I'll use a "wikilink" in another file to link back to this file, like this:

[[1727199696-DZNB|TODO]]

I can usegf or<Enter> with my cursor over that wikilink to successfully visit that file in neovim. However, the real problem I'm experiencing is in the Obsidian app. It's not recognizing the id frontmatter as a unique identifier of files. Clicking on any of those wikilinks in the app ends up creating a file with the id as the name. Furthermore, the graph is totally confused, having duplicates of id and the actual filename.

Ideally, I could just change some setting either in obsidian.nvim or in the app that would more easily support my flow. One thing that I would really like to maintain with my workflow is duplicate filenames in different directories, which is really why id is appealing, but I'm open to other solutions.

Thanks for any help/ideas in advance!

You must be logged in to vote

Replies: 1 comment

Comment options

Same issue here. My current workaround is deleting theid field in the frontmatter of my note, renaming it with:ObsidianRename and writing the file, so theid field is added back with a different value matching the new file name.

This works, but it's a bit tedious, plus it destroys the purpose of notes having unique IDs. Have you found a better solution?

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@joshfullmer

[8]ページ先頭

©2009-2025 Movatter.jp