Keyboard shortcut to focus on jupyter editor Follow
Everywhere in Idea pressing ESC moves focus to editor... but not in Jupyter Notebook, where it moves focus to... eh... nothing? Technically it goes to a list of cells but that's not very useful, especially that eg. pressing Enter does nothing.
Currently I constantly have to move my hands away from keyboard which is super irritating. Especially with vim bindings if I press ESC in normal mode then I'm thrown out from editor and cannot go back. So, how move focus to the editor, like in all other editors in the IDE...?
Please sign in to leave a comment.
Works correctly for me. Please verify if you're using the latest version from https://www.jetbrains.com/pycharm/download/ and check if you have any custom plugins (try disabling them). Try creating a new project. Does the issue persist?
I use the latest version.
- Install the VIM plugin
- Focus on editor in a cell
- Press ESC
Actual: Focus goes to a cell itself, with no way to go back to editor. "j" and "k" allow to select a cell, but there is no way to focus on edior again (without resorting to use a mouse).
Expected: Focus stays in editor in a cell OR to the cell itself but there is a way to go back to editor
With VIM disabled the behavior is acceptable, after pressing ESC focus goes to a cell, but focus can be moved to editor with a → (right arrow) key
PyCharm 2022.2.2 (Professional Edition)
Build #PY-222.4167.33, built on September 15, 2022
Runtime version: 17.0.4+7-b469.53 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
GC: G1 Young Generation, G1 Old Generation
Current Desktop: ubuntu:GNOME
Thank you, a clear steps to reproduce like that are very helpful.
I have successfully reproduced the issue and submitted a bug report -- https://youtrack.jetbrains.com/issue/VIM-2760/Jupyter-Notebooks-unable-to-enter-the-edit-mode-with-keyboard-after-pressing-Esc
Please follow the issue for updates, feel free to vote and comment, and let us know if you need any help. If you're not familiar with YouTrack, please see https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications
However you didn't describe task correctly. The edit mode isn't relevant to the issue. In vim, Enter in normal mode moves caret to the first non-whitespace character in the next line. To enter the edit mode, you need to press "i" (or a, s, C, o etc.). The described scenario is when I press ESC while being in a normal (command) mode. In vanilla vim it's a no-op, but it can happen accidentally, eg. by pressing ESC twice.
I've seen your edit and it seems that you didn't understand what is the problem. Let me fix your description:
The focus stays in the editor
The focus moves outside the editor, to a cell itself (an item in list of cells). It's not possible to move focus back to the editor using keyboard.
Not reproduced with IdeaVim plugin disabled.
I think this is very precise. Nothing is related to the edit mode here. If you are not familiar with vim you can just copy & paste this description. (which I assume is the case since you thought that pressing "Enter" should switch to edit mode)
I was referring to modes in terms of the notebook, i.e. "Edit" mode -- you move cursor inside the cell, and the "Command" mode -- you move selection between cells, can add/delete cells from this mode. I agree that I don't know the correct terminology for Jupyter modes so I used the same terminology as Vim. But I shouldn't have, since Vim is directly involved here. Apologies, corrected.
Cool, thank you.
I also met the same problem. Is there any solution?
Great! I updated the IdeaVim plugin to 2.1.0 and it fixed this problem. Now pressing the Enter key can go back to the cell. Thanks!