Edit Obsidian notes in Vim

Things I have tried

I understand there’s a Vim commands plugin, but I wonder about Vim itself. One thing I feel certain would be a problem would be creating markdown links. As I learned when I came on board Obsidian, links created in Vim don’t work in Obsidian.

What I’m trying to do

What’s the problem with the links made in Vim? Can you post the Markdown of one?

Vim doesn’t insert “%20” in file names that have spaces. So Obsidian doesn’t read them.

I regularly use Vim to edit Obsidian files (mostly via the “open in default app” command) and I’ve never had any problem.

When making links in Vim, I just type them in the usual format, e.g. [[My Page]] . Are you using some other method to create links?

Glad to hear that. Where do you find files created with Vim when you start Obsidian? I have a default mew notes file.

I should’ve been more specific about links. It’s markdown links to files with spaces in the file name.

You can put angle brackets around the paths instead of changing all the spaces. [link text](<path to file>).

1 Like

You are maybe talking about a Vim plugin that handles Markdown or links? If you say what that plugin in, maybe there are already workarounds, or configuration options.

Vimwiki uses [[link]] format, for example.

I don’t mean to judge, but by the numbers of threads you’ve started with issues around Markdown links, I’m surprised you haven’t switched to Wikilinks. But I understand and accept there may be reasons I’m unaware of. From the very beginning - and still - I recommend considering switching to Wikilinks.

Obsidian can only see files within its own vault folder. So when I use Vim to create files I plan to use with Obsidian, I create them in the vault folder.

Thanks. I was wondering where in your Obsidian folder they are saved. I have designated a default folder for all my notes.

I’m guessing it’s not possible to specify a folder when creating Obsidian files with Vim.

On the other hand, why not? Obviously Vim can specify the folder in which files are created and saved.

Oh I see, thank you for clarifying. I have several folders in my vault.

In most of my vaults, all new notes go in a folder called “Inbox”, and that’s where everything lives until I either file it or delete it.

I didn’t respond to the second part of your question, about how links were being set in Vim. I was using two plugins, VimWiki and vim-markdown.

I believe markdown links created in Vim, at least with the above plugins, do not have a problem with blank spaces in file names. File names with blank spaces are created and read without inserting the “%20” filler.

Displaying my ignorance here, but curious why the filler is required by Obsidian.

A confession regarding use of Vim to create and edit files for Obsidian: it would not be a problem for me with my macOS notebook. With Vim on my iPhone and iPad I haven’t found a way to create and edit files in the cloud, in my case iCloud Drive.

On my iPhone and iPad I use iVim, an amazing port of Vim to iOS that has found ways to get around the sandboxing of apps in iOS. Given its capabilities I should be able to create and read files in iCloud Drive. Other iVim users do so.

It’s been a while since I gave up trying, so I can’t say exactly what the problem was. What I remember was files being saved in strange random locations.

As I write it occurs to me that the problem
I had may have been unique to the VimWiki plug-in I was using.

When I get time I think I try to see what happens when I try to do it in with that plug-in deactivated.

You say “paths.” So not just file names.” If file names would be enough that would be convenient for creating links while using Vim to create and edit files in my vault.

Thanks, I may want to consider that.

So, I

So, I’ve found I can create and edit files in my Obsidian vault in iCloud using an iVim external command.

1 Like

Whatever you’re putting between the parentheses, wrapping it in angle brackets will remove the need for %20.

1 Like

Thanks.