Issue
When working with Jupyter notebooks inside of Visual Studio Code (using the Python extensions by Microsoft), it is possible to configure the application as to prevent the arrow keys from exiting the current cell?
Basically, I would like NOT to go to the previous or next cell when I move inside of an editable cell (code or markdown) using the arrow keys.
Solution
The setting you are looking for is: Notebook › Navigation: Allow Navigate To Surrounding Cells
Description: When enabled cursor can navigate to the next/previous cell when the current cursor in the cell editor is at the first/last line.
When you first use VS Code with a notebook it asks you this question, and you have virtually no chance of remembering the setting. Of course this is before you have a chance to realize that this is a horrible option for many coders. Using the down arrow does not move to the end of the line in the last cell, but to whereever your cursor last happened to be in the next cell.
They are cells for a reason, and treating them as if they are just paragraphs may make sense to a non-coder who is looking at them as if they were documentation. For a coder, cells are collections of small files, not paragraphs, and pressing down arrow always goes to the end of the line. Navigation between them should be explicit, certainly not something that can accidentally be done when trying to add a line.
If there were an option to add an empty line at the end of the cell, to continue the cell, this would be fine, but pressing ctrl+Enter runs the cell, instead of opening a new line, as it does in the code editor. It isn't always clear when you are on the last line, as the bottom border of the cells is huge, so half the time you press down arrow just to move to the border space, only to find you have the hit up arrow ten times to get back there, or escape+uparrow+enter+end to get to where you wanted to be in the first place.
Answered By - Michael Erickson
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.