How to use the Vim mode in Code-Mirror?

157 views
Skip to first unread message

Mark S.

unread,
Jul 9, 2020, 2:19:23 PM7/9/20
to TiddlyWiki

I was trying to use the Code Mirror Vim keymap.

The problem is that the escape key, which is used to change edit modes in Vim, is still mapped to the the "cancel tiddler" functionality in TiddlyWiki. So you can't change modes without also closing out the current tiddler and abandoning your changes!

I assume that some alternative key has been mapped, but if so, it hasn't been documented.

Is there a magic incantation for using Vim in Code Mirror on TiddlyWiki ?

Thanks!

Mark S.

unread,
Jul 9, 2020, 11:05:33 PM7/9/20
to TiddlyWiki
Ctl-C and Ctl-[ work as alternative escape keys, if anyone is interested.

Mark S.

unread,
Jul 10, 2020, 11:55:04 AM7/10/20
to TiddlyWiki
Yesterday I was able to work for several hours with Vim in Codemirror. But I didn't have a "proper" set up -- it was a mix of node and drag-n-drop plugins.

When I set up everything "properly" in node, with pre-release, or with 5.1.22 single file, I always get this message in the RSOE:

TypeError: n is undefined

right after setting up "vim" as the CodeMirror keymap.

After that, everything is broken.

I feel that somehow I got lucky yesterday, and picked the right combination of node and actual tiddlers that allowed vim to work. Now it doesn't seem to work no matter what I do.

Anyone else have experience with vim on TW?

Thanks!

On Thursday, July 9, 2020 at 11:19:23 AM UTC-7, Mark S. wrote:

Mark S.

unread,
Jul 10, 2020, 2:17:02 PM7/10/20
to TiddlyWiki
It really appears at this point that the vim keymap and/or the codemirror plugins for in the pre-release 5.1.23 are broken. I'm able to add the codemirror plugin directories from the 5.1.22 release and it works.

Mark S.

unread,
Jul 10, 2020, 3:28:55 PM7/10/20
to TiddlyWiki
Well, I'm having a bit of a monologue here.

Maybe everyone already knew this, but apparently when you add plugins to a node.js TiddlyWiki, you have to manage the dependencies yourself. I'm not sure if that was necessary for Vim in 5.1.22 -- the commit comment on several of the codemirror items from 3 months ago mentions adding dependencies. When you add official plugins to a stand-alone TW, the dependencies are added in for you. So everything works out of the box. With the node plugins, you need to check that the non-obvious dependencies are added in.

Maybe someone else will find this thread useful ;-)

clutterstack

unread,
Jul 12, 2020, 1:15:36 AM7/12/20
to TiddlyWiki

Maybe someone else will find this thread useful ;-)

Very likely. :D

Soren Bjornstad

unread,
Jul 12, 2020, 9:53:48 AM7/12/20
to TiddlyWiki
Mark,

As you've observed, this is happening because Escape is bound to cancel-edit-tiddler by default. If you're not attached to that specific keyboard shortcut, you can easily disable it in the Keyboard Shortcuts tab of the control panel. I just change mine to Control-Escape, though that's a bad choice if you use Windows since it opens the start menu.

tony

unread,
Jul 12, 2020, 1:05:00 PM7/12/20
to TiddlyWiki
Hi 

5.1.22 on TiddlyServer
and the old controls still work like Ctrl-c for returning to Normal mode and 
cool stuff like setting and jumping to marks and command mode substitutions

Best,
tony
Reply all
Reply to author
Forward
Message has been deleted
0 new messages