jwkvam / jupyterlab-vim

:neckbeard: Vim notebook cell bindings for JupyterLab
MIT License
975 stars 73 forks source link

`i` enters Vim insert mode from Jupyter command mode #71

Closed wmayner closed 6 years ago

wmayner commented 6 years ago

This addresses #70.

wmayner commented 6 years ago

This currently works, but there's a ~0.5 second delay before insert mode is actually entered. I couldn't figure out how to fix that.

I suspect it has to do with CodeMirror waiting for more input, but I'm not sure.

jwkvam commented 6 years ago

@wmayner I forgot that the interrupt shortcut is I,I

so like vim, jupyterlab waits a while to resolve this shortcut. Raises the question if we should remap the interrupt shortcut? I never use the interrupt shortcut so I wouldn't miss it if we just unmapped it but I wouldn't be surprised if people liked it.

wmayner commented 6 years ago

I prefer using Ctrl + c as the interrupt hotkey, similar to the command line. But that's a personal preference, and I'm also hesitant to remap jupyterlab defaults. It's a shame though, since i is so fundamental to using Vim.

At least if we add the command, users can remap as they see fit. Perhaps we can just add the command for now and defer the binding to a later PR?

wmayner commented 6 years ago

I just realized I was actually wrong about the original functionality: in jupyter-vim-binding, i would only enter Vim command mode. So in fact your initial suggestion was totally right if the goal is to duplicate the jupyter-vim-binding functionality, and all I need to is override the default bindings in jupyterlab.

wmayner commented 6 years ago

Perhaps we could use Ctrl + I as a binding to go directly into Vim insert mode, and leave it up to users to override the I + I binding if they want. Ctrl + I doesn't seem to interfere with jupyterlab bindings.

jwkvam commented 6 years ago

This sounds like a good compromise to me, thanks for the suggestion. I'll merge this in now. Sometime in the next few days I'll cut a new release.