Struggling with vim and zettelkasten

Non-coder vim-enthusiast. New to zettelkasten. Actually struggling less with zettelkasten, at least at the moment, than vim. Specifically with getting syncing going between vim installations on iPhone, iPad, and MacBook.

Vim on the mobile devices is actually iVim, an amazing porting of vim to the iOS environment. It has a command (:iexdir) that, in spite of Apple’s sandboxing, makes it possible to establish connections with external directories. I’ve used it to set up a connection to iCloud Drive. My intention was to enable syncing between my iPhone, iPad, and MacBook..

I’ve adopted wiki.vim as my writing plugin of choice. I requires that I place a path to to the root directory in my .vimrc. With a lot of trial-and-error and pleas for help I’ve tried without success to identify a workable path to the directory I’ve placed in iCloud Drive.

At one point I thought I’d discovered a workable path in a file in iVim’s system directories. It is “ /private/var/mobile/Containers/Data/Application/BBD512C7-CCA0-47FD-B2F2-0AF17D9D03B5/Documents/wiki”. Alas, iVim does not recognize the path.

I desperation, wanting to move on from fiddling with technology to must writing, I’ve signed up for Bear Notes, mainly for the syncing between devices it provides. I feel like a traitor. I would much prefer to continue experimenting with zettelkasten with vim as my companion.

I write in the unlikely chance, and the desperate hope, that someone here might be able to point me to a solution.

Thanks in any case.

•  /private/var/mobile/Containers/Data/Application/BBD512C7-CCA0-47FD-B2F2-0AF17D9D03B5/Documents/wiki


That, unfortunately, is a sandboxed path the app likely will not be able to access, even if it's the full path to its own data.

If the ID BBD512C7-CCA0-47FD-B2F2-0AF17D9D03B5 truly is iVim's own sandbox, then you can omit everything before that ID. The path then is ~/Documents/wiki or /Documents/wiki, if I'm not mistaken.

The sandboxing here really just maps regular-looking paths, like user directories, as relative paths inside the sanbox.

Fingers crossed!

Author at Zettelkasten.de • https://christiantietze.de/

• Thanks. Actually I misquoted in presenting that path. (Careless me. 🙁) I knew that it was a sandboxed path. And it is not the one I discovered in iVim’s system directories. That is: “ ~/private/var/mobile/library/Mobile Documents/com~apple~CloudDocs/vimfiles/wiki/.”

It also seems not to be a valid path. At least not one iVim recognizes. Using it I get very strange results. Wiki.vim commands result in files getting saved in a new “/0” folder created in various locations depending where I was in the directory structure when I issues the command.

Surely there is a valid path. Other iOS/iPaOS apps have access to iCloud Drive. And iVim’s “:iexdir” command does establish links to directories outside its sandbox.

• Something else that seems significant: If I navigate to the directory in iCloud Drive linked with the “:iexdir” command, open a file instead of executing a “wiki.vim” command, then do “:echo wiki#get_root()” what I get is: “/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/vimfiles/wiki”.

I am in way over my head, but what that suggests to my naive mind is that vim has no problem with this path, that it is “wiki.vim” that has the problem. I am fully prepared to be told I am mistaken.

• The actions reported in the preceding comment were executed in iVim on an iPad.

• edited August 4

If I used vim/iVim to compose markdown files saved to an ICloud Drive directory and then do the more strictly zettelkasten processing in The Archive, would that work?

Another alternative: Create and manage zettelkasten in vim/iVim using markdown and plugins related only to doing markdown in vim, i.e., and no other plugins, e.g., wiki.vim, vimwiki.vim, vim-zettel. Would that work?

• @ericweir said:
Something else that seems significant: If I navigate to the directory in iCloud Drive linked with the “:iexdir” command, open a file instead of executing a “wiki.vim” command, then do “:echo wiki#get_root()” what I get is: “/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/vimfiles/wiki”.

Could be just you typing this by hand -- but here, Library is correctly capitalized, and in the post before, it wasn't. Just to make sure it's not case sensitive path components getting in the way!

You could also maybe try a different vim?

FWIW, I had some success with the iSH app. It runs a small Linux emulator, and I was able to successfully launch Emacs in there, so that was something. And you could mount stuff from Files.app, including iCloud Drive, as local mount points like you would with regular Linux distros.

That way the (emulates) operating system handles the path mapping, and you could launch vim inside that Linux including all the usual .vimrc stuff (but likely slower?), and access that regular path in the OS's context.

Author at Zettelkasten.de • https://christiantietze.de/

• @ericweir This does not solve the issue with iVim (I tried in the past to make it work in this way and did not succeed). The following is an alternate approach that may prove interesting or useful to you or someone else.

If the goal is to have a zettelkasten accessible on iOS and use vim modal editing on a laptop/desktop, the following achieves that. If the goal is to use modal editing for a zettelkasten on an iOS device, this does NOT achieve that.

Doom emacs for modal editing (vim keybindings through evil-mode):
https://github.com/doomemacs/doomemacs
Obsidian for zettelkasten (desktop and mobile):
https://obsidian.md/
Obisidian.el as an emacs front-end for obsidian:
https://github.com/licht1stein/obsidian.el

This set up results in doom emacs for most things zettelkasten on laptop, obsidian for iOS.

Admittedly, if the goal is to stop fiddling, these tools will definitely not do that (unless one is already familiar with emacs). That said, after a period of configuring and learning doom emacs, it's been some time since I needed to fiddle. I just get work done using emacs.

Point of information, I actually use org-roam but if I ever need iOS editing/access, this is the setup I would use.

• @ctietze said:

You could also maybe try a different vim?

FWIW, I had some success with the iSH app. It runs a small Linux emulator, and I was able to successfully launch Emacs in there, so that was something. And you could mount stuff from Files.app, including iCloud Drive, as local mount points like you would with regular Linux distros.

That way the (emulates) operating system handles the path mapping, and you could launch vim inside that Linux including all the usual .vimrc stuff (but likely slower?), and access that regular path in the OS's context.

Thanks for the suggestion, Christian. I’ll keep it in mind. I’m afraid pursuing it now would keep me where I am: bogged down fiddling with, or reading about fiddling with, technology.

For the time being I’m going to do what I said I would do: try to do as much “zettelkestening” with barebones vim and markdown as I can. I’m even going to prioritize reading, thinking, note making over zettelkasten-related structuring.

That’s what you advise at the beginning, isn’t it?

• @kohled said:

If the goal is to have a zettelkasten accessible on iOS and use vim modal editing on a laptop/desktop, the following achieves that. If the goal is to use modal editing for a zettelkasten on an iOS device, this does NOT achieve that.

Doom emacs for modal editing (vim keybindings through evil-mode):
https://github.com/doomemacs/doomemacs
Obsidian for zettelkasten (desktop and mobile):
https://obsidian.md/
Obisidian.el as an emacs front-end for obsidian:
https://github.com/licht1stein/obsidian.el

Thanks for this. I checked out your links. Fascinating. Two reactions: I wish someone would do something like this for vim; it looks like you could do almost everything with emacs alone, leaving Obsidian behind.

It may well be that someone has done something like this for vim. I haven’t checked. Not going to. Not right now. As for Obsidian. I’ve had it on my mobile devices for a while. It’s initial blank slate appearance has discouraged me from diving in. I understand it’s eminently configurable and personalizable, but at the beginning it’s unclear how to start.

So, I’m going to what I told Christian I was going to do: stick to vim with markdown and prioritize reading, thinking, note making. When structuring seems clear and straightforward I’ll give in to it. But I’m not gonna let it distract me from the most important thing: again, reading, thinking, note making.

• @ericweir said:
So, I’m going to what I told Christian I was going to do: stick to vim with markdown and prioritize reading, thinking, note making. When structuring seems clear and straightforward I’ll give in to it. But I’m not gonna let it distract me from the most important thing: again, reading, thinking, note making.

Sounds like an excellent course of action. I basically ended up in a similar place, just with emacs instead of vim. I did a good deal of time-wasting, but I admit... it's kind of fun.

Over time, I haven't found working with notes on iOS all that necessary. Same thing with note graphs.

Anyway, wishing you well on the journey.

• @ericweir Yeah it might be a good point to stop investing time into this and instead do the real work Like @kohled wrote -- it can be fun do fiddle with things, so it's always an option to do this as a past-time activity.

Author at Zettelkasten.de • https://christiantietze.de/

• @kohled said:

Over time, I haven't found working with notes on iOS all that necessary. . . . .

I appreciate the ready availability of a computer that I can put in my pocket, carry with me wherever I go. Getting started with zettelkasten I’ve found iOS a huge frustrating obstacle. Just barebones vim and markdown is not all that hospitable. Not yet.

Anyway, wishing you well on the journey.

Thank you.

• @ctietze said:
@ericweir Yeah it might be a good point to stop investing time into this and instead do the real work. . . .

Agree totally.

. . . . Like @kohled wrote -- it can be fun do fiddle with things. . . .

I don’t find it fun.