Wiki.vim/Obsidian interoperability

What I’m trying to do

I was attracted to Obsidian because it was billed as creating/editing/managing plain text/markdown files. When I started out here with files created with Vim I was discouraged go find out that links created with Vim were dead in Obsidian. They were greyed out and clicking/tapping on them had not effect.

It took me a while, with help from folks here, to find out that Obsidian creates and expects links that have %20 in spaces in file names. So links created in Vim don’t work in Obsidian and links created in Obsidian don’t work in Vim

I am under the impression that in spite of this more than a few Obsidianan users create/edit/manage files with Vim. I’m curious, given the differences between links created in Vim and Obsidian. Is there a way to configure Obsidian so links created in either app are straightforwardly read in the other app?

I’m trying to do the same. But my Obsidian links are dead in Vim. As were those I imported from Vim when I started trying to work in Obsidian.

Things I have tried

It was with a great deal of help here that I finally learned that Obsidian links and links created in Vim are different.

First of all, you should clarify that you are talking about the Vim plugin Vimwiki, right? Not Vim in general.

Well… :slight_smile: I’ve been suggesting to you since September 2022 that you should consider using Wikilink format instead of Markdown. I still think it would make your life easier.

In the help docs for Vimwiki, I see that it does support [[This Type Of Link]]. And that VimWiki mode is actually the default, same as in Obsidian. Markdown is an option.

Did you ever try the VimWiki link mode? Maybe you could make a small test vault and test if this will work for you? Try it out before you commit to any big change.

I did a test, and it works for me. But it seems to need to use “Relative path to file” in Obsidian. So you would have [[Folder/Note Name]]. This works in Vimwiki for me. It follows the links in my vault just fine. If your note is in a sub-folder, and you use “Shortest path when possible” [[Note Name]] then it won’t work. It will make a new note.

I also did a test, and VimWiki mode supports custom note names in the link. So this also works for me: [[Folder/Note Name|Custom Note Name]]

What I don’t know is how easy or hard it is to find and then create relative links that include the folders in Vimwiki. I just installed it today to test, so I’m not familiar with if it has search or auto-complete features. I know it can search and jump to a file.


From the Vimwiki docs:

A VimWiki link can be constructed from more than one word. Just visually select the words to be linked and press Enter. Try it, with Project Gutenberg. The result should look something like:

= My knowledge base =
    * [[Tasks]] -- things to be done _yesterday_!!!
    * [[Project Gutenberg]] -- good books are power.
    * Scratchpad -- various temporary stuff.

Changing Wiki Syntax

VimWiki currently ships with 3 syntaxes: VimWiki (default), Markdown (markdown), and MediaWiki (media).

Thanks. This going to be helpful. I will just respond to your initial comment about Vim.

Yes, it’s true, I use a vim plugin to read and write files with vim. But the plug-in is wiki.vim, not vimwiki. Wiki.vim is built on what the developer considers vimwiki’s essential functions. So linking with wiki.vim is probably pretty similar to linking with vimwiki.

I’m also getting help with this issue from the developer of wiki.vim. From both of your responses it’s clear there’s a lot I don’t understand. But I’m hopeful that I’ll eventually get this sorted out.

I’ll respond to the rest of your response tomorrow—after I get a couple hours in writing. (I do want to create and edit Obsidian with Vim but doing so is not urgent.)

Thanks for going so far out of your way for me.

… I’ve been suggesting to you since September 2022 that you should consider using Wikilink format instead of Markdown. I still think it would make your life easier.

Yes, I took your advice. Have been doing wiki links for quite a while now.

In the help docs for Vimwiki, I see that it does support [[This Type Of Link]]. And that VimWiki mode is actually the default, same as in Obsidian. Markdown is an option.

For several years most of my work-related and personal note taking and writing was with vim and vimwiki. I have a folder, with no subfolders, with a huge number of files created that way. Markdown links were based on words occurring within the files.

wiki.vim, the plugin I mentioned yesterday, supports markdown, wiki, orgmode, and asciidoc link types.

I did a test, and it works for me. But it seems to need to use “Relative path to file” in Obsidian. So you would have [[Folder/Note Name]]. This works in Vimwiki for me. It follows the links in my vault just fine. If your note is in a sub-folder, and you use “Shortest path when possible” [[Note Name]] then it won’t work. It will make a new note.

Exchanges with Karl Lervag, the wiki.vim developer, have made me wonder whether the path setting might have something to do with the problem I have. Yesterday I tried all three settings, restarting Obsidian after each change of setting, then copied the Obsidian Url from a note and pasted them into a note. I could not see any difference among them. But maybe that’s not the way the effect of the path settings would show up.

If I use “relative path to file” do I have to enter the folder, if there is a folder into the link manually when creating a link or is it set automatically if “relative path file” is set?

What I don’t know is how easy or hard it is to find and then create relative links that include the folders in Vimwiki. I just installed it today to test, so I’m not familiar with if it has search or auto-complete features. I know it can search and jump to a file.

I’d be interested in what you find, If you’ve continued to explore Vimwiki.

My linking so far has been pretty simple, mainly between an index file and groups of files that themselves are not linked to any other files. And it is just the names that are linked.

From the Vimwiki docs:

A VimWiki link can be constructed from more than one word. Just visually select the words to be linked and press Enter. Try it, with Project Gutenberg. The result should look something like:

= My knowledge base =
    * [[Tasks]] -- things to be done _yesterday_!!!
    * [[Project Gutenberg]] -- good books are power.
    * Scratchpad -- various temporary stuff.

That was how I did it. Except I don’t think link brackets were displayed when the cursor was not on them.

Thanks again.

All you said was “links”. Since you said %20, I assumed you were still talking about Markdown links. You didn’t mention that you are talking about Obsidian URLs.

But you are also saying you are using Wikilinks. I am thoroughly confused here.

I have only wiki style links in my vault. With the cursor on a link, in the drop down menu revealed by clicking on the three vertical dots in the upper right corner of the Obsidian window there is a command, “Copy Obsidian URL.”

This is what I got as the Obsidian URL with each path setting:

absolute path
obsidian://open?vault=ZK&file=cook%20wilson%20two%2F1%20is%20inference%20material

relative path:
obsidian://open?vault=ZK&file=cook%20wilson%20two%2F1%20is%20inference%20material

shortest path:
obsidian://open?vault=ZK&file=cook%20wilson%20two%2F1%20is%20inference%20material

Those settings are for internal links, not for Obsidian URLs.

So you’re saying those settings have no effect on the Obsidian URL? And have nothing to do with why my links are not being read by Vim with wiki.vim plugin?

Is it possible that there’s a mismatch between the Obsidian URL and the URL used by wiki.vim?

I’m way in over my head here. I know you know, but just so you know I know.

What URL used by wiki.vim? Can you show an example? Are you talking about wiki links or something://something URLs now?

Exactly. The settings in Obsidian are for links in Obsidian. The Obsidian URL scheme is totally separate, and has a specific syntax. The Obsidian URL scheme is (more or less) for making hyperlinks that would launch Obsidian and jump to specific places. If you’re trying to make wiki links that Vim would follow from note to note, that isn’t the way.

1 Like

What URL used by wiki.vim? Can you show an example? Are you talking about wiki links or something://something URLs now?

I don’t know. I just asked the developer.

So you’re saying those settings have no effect on the Obsidian URL?

Exactly. The settings in Obsidian are for links in Obsidian. The Obsidian URL scheme is totally separate, and has a specific syntax. The Obsidian URL scheme is (more or less) for making hyperlinks that would launch Obsidian and jump to specific places. If you’re trying to make wiki links that Vim would follow from note to note, that isn’t the way.

I have at least one file that still has markdown links. Vim/wiki.vim reads them. But when creating markdown links in Obsidian Obsidian doesn’t suggest link names the way it does when wiki links are being created. And markdown links created in vim/wiki.vim will not be read by Obsidian.

The developer of wiki.vim (Karl Lervag) has checked out the Obsidian documentation on links and linking. He thinks wiki.vim can be configured to read and write Obsidian wiki links.

What I’m trying to do

I would like to use markdown links to achieve interoperability with vim/wiki.vim. I believe obsidian does not suggest file names when markdown links are being created. However this text under Internal links in the documentation suggests otherwise:

Even if you disable the Wikilink format, you can still autocomplete links by typing two square brackets [[. When you select one of the suggested files, Obsidian instead generates a Markdown link.

If this doesn’t mean what I hope it means, and I suspect it doesn’t, is there a way to get suggested names when creating markdown links?

Things I have tried

As I wrote above, I checked the documentation under Internal links. I also search ed on the title of this post. Nothing was found.

Never mind: I just tried creating a markdown link. I got suggestions. (But I swear on a previous attempt I did not.)

Hi Eric,

I use the Various Complements plugin in all my vaults, which enables me not to have to type in those brackets and still get link suggestions. VC obviously uses Obsidian’s internal index to do that, so I kind of expect core Obsidian to have the same functionality in future releases.

Thanks, zanador. I’ve checked it out and installed it but haven’t enabled it yet. Looks a bit intimidating. I imagine with experience with it will seem less so.

I would want to use it, at least initially, when creating links. In that case puzzled what would trigger suggestions if not typing “[[“.

Also, I’ve discovered that, contrary to what I believed previously, Obsidian does suggest names when creating markdown links.

Yes, that’s what I thought would happen.
Happened to me too, and in fact, is still happening: it is simply too much to convert all my stuff from MS Office and make everything look the same in Obsidian, which is – for many – intimidating in itself, but with all the plugins one must try out in an effort to find out which works for them or not (oftentimes having to fit the plugin creator’s mindset to suit your needs), while reading the forum to look for yet more ideas, workarounds, etc. It is too much. I figured you’d come back to me saying something like that.
But still, once you figure things out (and as a teacher yourself, you know full well the best knowledge is what you teach yourself, through first-hand experience, according to your own logic, at your own pace, etc.), it will make your editing experience in Obsidian a whole lot better.
The plugin creator made comprehensive documentation by the way:
https://tadashi-aikawa.github.io/docs-obsidian-various-complements-plugin/

  • I seem to remember the out-of-the-box settings will make it work, but if not, you need to specify the vault name.

One can add one’s own dictionary as well so I can put in frequently needed headings, e.g.:
[[ThisisnotaneasilyrememberedNotename#ButThisHeadingIkeepComingBacktoLately]], which comes in especially handy for me now that I have a new workflow on the iPad.
This plugin, together with the Typing Transformer (maybe slightly less intimidating, despite some far eastern ideograms creeping up here again) make a great combination.

But as I said, at your own pace will be best. And maybe, just maybe you’re trying to bite too large with that vim stuff as well…

I wasn’t dismissing it, zanador. I appreciate the suggestion. And I’ll get around to it. I’m retired. So nothing is urgent anymore.

If I was still working–and work for me involved a lot of writing–my preference would be vim for composing and Latex for printing and publishing. I’m on macOS, so my apps are Pages and Numbers. But I have no use for them anymore.

Do you use vim?

There was no disagreement or misunderstanding on my part, either.
I scrapped Pages and Word for Obsidian and because I prefer to use a handheld device I have no use for keyboard shortcuts, although I use them on Linux (or Windows), hence no use for Vim.
I know about the pudding probe but haven’t tasted it yet.
For me, automations (I learned mechanics, pneumatics, Siemens and CNC programming at college) are also important so I’m trying to piece it all together as I go along (mainly for iOS with the Shortcuts app which you can use for Mac as well).

In the meantime, I have some 3000 PDF’s in my Zotero/Box account and another 1000 that were over the 250MB limit, so I wonder whether Obsidian has a plugin for making a 24 hr day 240 hrs…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.