jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
691 stars 43 forks source link

remap setting 'jj' to <esc> not working #131

Closed OsicKwon closed 10 months ago

OsicKwon commented 10 months ago

Description

Hi, I wanted to remap in insert mode that pressing 'jj' to '' to exit insert mode, entering normal mode. But, it was just typeing '' in a cell, which was not executed the command(Escaping)

image

image

Reproduce

  1. Go to 'Settings > Notebook Vim > ExtraKeybindings'
  2. Enter jj in "Keybinding" input box
  3. Enter <esc> in "The key sequence to execute" input box
  4. Select insert in "Mode" selection
  5. Select map in "Map function" selection

Expected behavior

Change Insert mode to Normal mode

Context

ianhi commented 10 months ago

This is not well documented (or at all) but codemirror will only recognize <Esc> as the escape key. So if you capitalize the e then it should work

cgjosephlee commented 10 months ago

@ianhi Thanks all your efforts! I would like to send Cmd+/ in this box (to toggle comment), how do I achieve this? I tried <S-/> but it is not working.

OsicKwon commented 10 months ago

Thank you so much, @ianhi !!

OsicKwon commented 10 months ago

It works very well with <Esc>