Persistent hotkey customiation for iPad Vim mode

Use case or problem

My top-level, most basic need is this: I want to be able to bind Ctrl-A to “beginning of line” and Ctrl-E to “end of line” in iPad Vim mode, consistent with macOS/iPadOS text editing conventions, harking back to the venerable Emacs keybindings. I’ve been using these bindings everywhere for decades now and bind them in my vimrc settings.

Researching this feature request turned out to be a bit of a roller-coaster. I’ll summarize that below.

Proposed solution

First-class, cross-platform support for persistent custom keybindings in both vim and regular modes. That’s the holy grail, IMO. But let’s peel that apart a bit.

Spelunking the forums turned up a great little plugin obsidian-vimrc-support by @esm90 – which unfortunately only works on desktop. That appears to be a limitation posed by the need for Electron APIs.

That suggests a shorter-term solution: Add cross-platform APIs needed for custom hotkey plugins. That may be a useful and necessary step on the road, but skimming Meta Post - Hotkeys, it feels like the broader user needs here quickly converge on “let everyone persist their custom keybindings, with or without Vim mode, full stop”.

An important aspect of this is “persistence” – it’s not just storage, but sharing and portability. Baked configuration UI like the current hotkey settings can be ergonomic, e.g. eliminating the need to know or look up key names, ui action codes, etc. But alone they are weak in the sharing and portability aspects even if the settings are persistent.

Current workaround

None known. My first attempt was to use the plugin above, but it doesn’t work on iPad, which isn’t super helpful for me as I jump between iPad and Mac frequently.

Related feature requests

I am confused by this request. There’s no vim mode on mobile.

@WhiteNoise ack, embarrassing. I’ve been flipping on the Vim setting on a few different devices, both Mac and iPad, as I’m getting into Obsidian, and somehow missed entirely that I’d never actually done that on iPad. :man_facepalming: sigh.

The inherent issue is that the Vimrc plugin, just like the Vim support itself, requires CodeMirror 5. Obsidian Mobile uses the next-gen CodeMirror 6, which doesn’t support Vim key bindings at all.
Needless to say, that’s extremely unfortunate and there’s a relevant discussion here.

1 Like