3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
1.03k stars 42 forks source link

[feature request] Obsidian Link support #117

Closed anton-granzow closed 8 months ago

anton-granzow commented 8 months ago

It would be nice if the Obsidian Syntax for Images was supported: ![[VaultPath/to/image]] Maybe the obsidian.nvim plugin can be used to find the images in the Vault because the images are normally either referenced only by name or by their realative path in the Obsidian Vault. Otherwise just ![[path/to/image]] would be a nice starting point

benlubas commented 8 months ago

Agreed that the place to start is with adding support for that syntax.

I think a general solution to that "what is this path relative to?" problem would be to provide some type of configurable fallback function.

Would you be okay with something that first searched relative to the file and then searched relative to whatever folder a provided function gives?

anton-granzow commented 8 months ago

So you mean, it looks for the file the normal way first and if it doesnt find anything it looks from a specified path? Sounds good to me

benlubas commented 8 months ago

Cool. Ill hopefully be able to take a look tomorrow. Currently a little under the weather.

Also I just had a thought. If we're providing a function as a config option. Might as well call the function first in case someone wants full control. It probably doesn't need to be a fallback.