Is it possible to enable the CodeMirror vim keybindings?

When I use jupyter, jsfiddle or codepen.io, I can enable vim keybindings in the codemirror editor. Is this possible somehow with observable notebooks as well?

https://codemirror.net/demo/vim.html

5 Likes

Yep, believe me, as the daily (neo)vim user on staff, Iā€™m rallying hard for vim keybindings soon. There are a few hurdles we need to clear before we get there (storing settings, harmonizing keybindings with jupyter, making extra-sure that no keys interfere with Windows) but itā€™s certainly a priority for me / us.

12 Likes

Is there now a way to enable vim keybindings with observable notebooks?

3 Likes

It seems like vim keybindings option is important for the vim users.
@tom do you have any updated on the ā€œhurdles cleanupā€ progress that you have mentioned a year ago?

1 Like

Iā€™ll report back here the moment that anything changes with respect to vim keybindings. The feature is still on our list.

4 Likes

More than a year passed, @tom any news on this one?

1 Like

No update still. Iā€™d love this too, but havenā€™t prioritized it.

1 Like

I donā€™t think any canned solution will please everyone, perhaps making the domain of key bindings moddable by authors who may import community configs is the way. There have been times Iā€™d have liked to change the currently available standard bindings and this strategy might address that too? Sorry if Iā€™m being naive here.

Iā€™d just like to say Mike and co, this placeā€¦ itā€™s full of stars, you folks are just about the coolest cats on the planet for me right now.

3 Likes

Iā€™d also love to be able to use vim shortcuts!

2 Likes

Enjoying my first day on Observable, but the lack of vim keybindings will be a show stopper for me and my team before too long. Itā€™s a shame theyā€™re not available after so many years.

Iā€™d even be willing to entertain a workaround - like editing in vim and then copy-paste into observable - if that was feasible (but I donā€™t think it is)

Back to using Observable again today. It looks like Tom Macwright has left observable
(About - macwright.com) ā€“ he was the guy above who said heā€™d work on this (maybe because of the tragedy of working with such a great tool that was so difficult to text edit? just sayinā€™)

So what do you say Observable friends, can you help? We really need this. Can you at least respond pls?

@LYPratt Feature requests are now tracked on GitHub. You will probably want to follow this issue:

1 Like

We have enabled an experimental feature for you which allows you to set the cell editor to ā€œvim modeā€. :tada:

In vim mode, the editor emulates a subset of the Vim editor. It uses a Codemirror extension and is not based on real Vim code, but it has most of the interactive keyboard shortcuts (no the settings or scripting capability). You can enable Vim mode along with other editor options on your user settings page (all the way at the bottom).

Try it out and give us feedback!

2 Likes

Dear Cobus, I am really happy to use Vim-like key bindings now.

There is only one minor problem that I noticed: while I am focussing (editing) a cell, I found no way to blur / close that cell again. It should be pressing Esc.

Perhaps this key press gets swallowed internally by the Vim bindings? Because when I am in Vimā€™s insert mode, an Esc will take me to Vimā€™s command mode.

It would be great if an Esc key press in Vimā€™s command mode would be interpreted by Observable and close that cell. Because right now it does nothing in command mode.

Currently I have to use the mouse as a workaround in order to close the cell, which breaks my flow on the keyboard and is harder in terms of ergonomics.

Can you try Esc-Esc (double Esc)?

Oh yes, I am double-escaping all the time :wink: It always closes fullscreen-view because I tend to over-escape.

I see this problem on all browsers (FF/Fennec, Chrome/Chromium, Samsung Internet, Kiwi) on both OSs that I am using (Ubuntu 20 + Android).

Do you have a configuration where you can Escape (close/blur) out of a cell that you have edited before?

I believe the key binding we settled on this is Alt-Esc to blur the cell, or some other modifier. In truth I donā€™t think it works in my setup, but I havenā€™t debugged why.

Please, how do I activate this vim mode?

@GeoffRussell In your settings: