You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
Is this possible? I played around with the code a bit. What I tried is to assign a key handler to Ctrl+C and inside that check whether the user is currently in insert mode. In insert mode, it should leave insert mode. Otherwise, I tried to return false to get the default copying behavior, but this didn't work.
Update: More generally it would be cool to be able to configure different keybindings for different modes.
The text was updated successfully, but these errors were encountered:
I face the same problem and recognize <Ctrl-c> as vim's default shortcut to leave insert mode. To actually manually map <Ctrl-c> to <Esc> I tried the following two variations within a cell:
:imap <Ctrl-c> <Esc>
:imap <C-c> <Esc>
Unfortunately this does not work. I had no problems mapping other Ctrl shortcuts like :imap <C-o> <Esc>. I'm not quite sure how intertwined Jupyter's cells are with IPython's interactive console, because I was able to bind <Ctrl-c> within IPython.
How were you able to leave insert mode through <Ctrl-c>@danijar ?
I think this may be possible using the codemirror map commands https://codemirror.net/doc/manual.html#vimapi but @flxai if you ran those commands from inside a cell there may be some strangeness in how codemirror handles them due to how the extrakeys are being set
Is this possible? I played around with the code a bit. What I tried is to assign a key handler to
Ctrl+C
and inside that check whether the user is currently in insert mode. In insert mode, it should leave insert mode. Otherwise, I tried to returnfalse
to get the default copying behavior, but this didn't work.Update: More generally it would be cool to be able to configure different keybindings for different modes.
The text was updated successfully, but these errors were encountered: