jupyterlab-contrib / jupyterlab-vim

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

Avoid delay when entering edit mode #129

Closed nkaretnikov closed 7 months ago

nkaretnikov commented 7 months ago

I want to enter Jupyter edit mode with i, similar to Vim, because Enter is hard to reach.

I remapped it like this:

        {
            "command": "notebook:enter-edit-mode",
            "keys": [
                // "Enter"
                "I"
            ],
            "selector": ".jp-Notebook:focus",
            "args": {}
        },

This works. However, the cell becomes editable only after a significant delay (3 sec?). Enter still works and does so instantly. Also, bindings like j work fine. So why is there a delay? Does it clash with some other keybinding and waits for the second character?

krassowski commented 7 months ago

Hi @nkaretnikov what JupyterLab and jupyterlab-vim versions are you using?

krassowski commented 7 months ago

I, I is mapped to interrupt kernel in notebooks (via kernelmenu:interrupt in lab 4.x). Does overriding this shortcut to something else helps?

nkaretnikov commented 7 months ago

Tried commenting I, I out - didn't work. JupyterLab - Version 4.0.8. axlair-jupyterlab-vim - 4.1.0 (installed via plugins menu).

krassowski commented 7 months ago

I think commenting it out does not disable the shortcut itself. Changing it to a different one would do.

nkaretnikov commented 7 months ago

Tried that as well - same delay.

firai commented 7 months ago

Remapping the key binding doesn't disable the default one in JupyterLab, leading to a conflict as you have suspected. This exact remapping was attempted by someone else, leading to the issue reported upstream at https://github.com/jupyterlab/jupyterlab/issues/15038. This would need to be solved upstream, so I'm closing this issue here.