Wishlist: A Vim plugin for Composition Mode

I love both Vim and Scrivener. It would be sweet if I could have the best of both worlds with a vim plugin for composition mode.

Maybe one already exists, that I don’t know about🤔.

I can always “import & export” which is nice, but it would be a little better if I could just have my cake and eat it too in one spot! i.e. “Composition Mode”
Cheers🥂

Hello, fellow vim appreciator! This has been a bit of running joke in the forums for at least ten years :grinning: There are a couple of us who every now bring the subject up, mostly for fun, because it’s probably not towards the top of any list of future features…

There are two reasonably good solutions if you do want vim bindings, and both are available in both Editor and Composition mode (or rather, you are using Vim as both the editor and composition mode, for selected documents whenever you want to).

The first is to use one of the utilities / scripts you can find, such as Use vim to edit text anywhere · Martins code snippets, or GitHub - cknadler/vim-anywhere: Use Vim everywhere you’ve always wanted to. You invoke a shortcut in Scrivener, the text is copied to a vim session, and when you save / end the session, the Scrivener text is updated. I used to use one of those utilities (can’t remember which one, sorry), and they work well.

But these days I use the built-in Scrivener feature, Sync to External Folder. Basically, this lets you create and edit files outside Scrivener in any editor you want and the changes are kept in sync either automatically when you close / open Scrivener, or manually at your discretion. You can ask Scrivener to keep snapshots of the changes, so you won’t lose anything.

This has a couple of advantages over the first method, including that you can include {{inline footnotes}} and ((inline comments/annotations)) using that markup in the text edited in Vim and they will be translated to the Scrivener version automatically (and vice-versa.


You can use this method to create / edit a single file, or write the whole book in it if you want…

As you can see from the screenshot of the options, you have plenty of choice over what’s synced, when and in what format, so you’ll want to play around with it first in a test project, but for me it offers a very good workaround.

S14.3 of the manual deals comprehensively with the feature, so it’s a good place to start.

HTH.

4 Likes