You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try using the ObsidianFollowLink command, of the gf mapping on an image link that's on the default assert directory (assets/imgs/x.jng), I get the following error:
# Place cursor on link, type either `:ObsidianFollowLink` or `gf`
![island.png](assets/imgs/island.png)
Error 13:20:13 notify.error Obsidian.nvim Failed to resolve file 'assets/imgs/island.png'
If I try using the command I specified on the follow_img_func function on the terminal, it works as expected:
return {
"epwalsh/obsidian.nvim",
lazy = true,
version = "*", -- recommended, use latest release instead of latest commit
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
mappings = {
--- follow the link under the cursor
["gf"] = {
action = function()
return require("obsidian").util.gf_passthrough()
end,
opts = { noremap = false, expr = true, buffer = true },
},
},
-- ... redacted for brevity
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
-- file it will be ignored but you can customize this behavior here.
---@param img string
follow_img_func = function(img)
vim.fn.jobstart({ "qlmanage", "-p", img }) -- Mac OS quick look preview
-- vim.fn.jobstart({"xdg-open", url}) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
end,
}
Environment
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382
Run "nvim -V1 -v" for more info
Obsidian.nvim v3.9.0 (ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b)
Status:
• buffer directory: nil
• working directory: /Users/<redacted>/notes
Workspaces:
✓ active workspace: Workspace(name='notes', path='/Users/<redacted>/notes', root='/Users/<redacted>/notes')
Dependencies:
✓ plenary.nvim: 2d9b06177a975543726ce5c73fca176cedbffe9d
✓ nvim-cmp: 29fb4854573355792df9e156cb779f0d31308796
Integrations:
✓ picker: TelescopePicker()
✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
all sources:
• copilot
• nvim_lsp
• path
• buffer
• snippets
• lazydev
Tools:
✓ rg: ripgrep 14.1.1
Environment:
• operating system: Darwin
Config:
• notes_subdir: inbox%
The text was updated successfully, but these errors were encountered:
🐛 Describe the bug
When I try using the
ObsidianFollowLink
command, of thegf
mapping on an image link that's on the default assert directory (assets/imgs/x.jng
), I get the following error:If I try using the command I specified on the
follow_img_func
function on the terminal, it works as expected:Config
Environment
The text was updated successfully, but these errors were encountered: