joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

Is there any way to use Vim keybindings inside a cell? #21

Closed dclong closed 2 years ago

dclong commented 2 years ago

It seems to me that the Vi keybinding is navigation among cells only. Is there any way to use Vim keybindings when editing inside a cell?

joouha commented 2 years ago

Hello,

While the vi key-bindings are supported (they are implemented by prompt-toolkit), unfortunately in euporie it was not possible to enter vi navigation-mode, because the escape key was used to exit cell edit mode.

I have fixed this this in afd245ece5e922598313ff33d3bc73851a0a4f17 and made a new release (v1.6.1).

Now, if you activate the Vi key-bindings (Settings -> Editor key bindings -> Vi in the menu), when you enter cell edit mode, this will take you to Vi insert mode. Pressing Escape will take you to Vi navigation mode, allowing you to edit the cell using vi style key-bindings. Pressing Escape again will take you out of cell edit mode, allowing you to navigate the notebook.

Sorry this has been broken for so long - I don't really use the vi key-bindings myself and hadn't noticed they weren't working properly!