Open axelfahy opened 5 years ago
Interesting I didn't realize ctrl-[ wasn't working on all platforms, I typically only use chrome. I just tried Firefox and it seems like it was working for me? I check Safari and it was working there for me as well.
I'm using Firefox 68.0 (Quantum) and jupyterlab-vim 0.11.0.
Maybe it is a plugin that is capturing the key, but when I use CTRL-[, it leaves the cell instead of going to normal mode (which is annoying since I have to re-click on the cell to have the focus again).
However, if I add the keybinding in src/index.ts
(as in PR #86), it works as expected.
Using Firefox 68.0.1, jupyterlab 1.0.2, jupyterlab-vim 0.11.0
@llinfeng seems to have the same issue since he said in #81 that he recompiled the plugin with CTRL-[ added in the keybindings.
@axelfahy Were you also recompiling the plugin when you "added the keybindings in src/index.ts
"? I am interested to learn a better way to simplify the following steps:
src\index.ts
commands.addKeyBinding({
selector: '.jp-Notebook.jp-mod-editMode',
keys: ['Ctrl ['],
command: 'leave-insert-mode'
});
commands.addKeyBinding({
selector: '.jp-Notebook.jp-mod-editMode',
keys: ['Ctrl ]'],
command: 'notebook:enter-command-mode'
});
jlpm install
jlpm run build
jupyter labextension link .
I have compared things side-by-side across Chrome, Edge and Firefox
Ctrl + [
is working with all three browsers, per its newly mapped function of exiting from Insert mode to normal mode within the "editing cell";Ctrl + ]
is not working in Firefox, but working well in Chrome and Edge. When it is working, Ctrl + ]
did get me out of the "editing cell" to manipulate all other cells in the notebook.Raw conclusion: something is wrong with Firefox :) May need further debugging to see what captures Ctrl + ]
.
Yes, I recompiled the plugin after adding the keybinding. Afterwards, CTRL-[ worked fine. I followed the same steps to compile the plugin, I haven't found a simpler way to do it.
In vim,
Ctrl-[
is the equivalent of Esc andCtrl-C
quits insert mode. I think it would be nice to have the same behaviors in jupyterlab-vim.Maybe implementing
Ctrl-C
is not a good idea since it will interfere with the copy shortcut. However, I think thatCtrl-[
won't interfere with other shortcuts.Reference from vim documentation (https://vimhelp.org/insert.txt.html):
CTRL-[
CTRL-C
Update:
Ctrl-[
seems to be working on Chrome but not on Firefox (v67.0.4), not sure why. (other browsers not tested)