'How to split cell in VSCode Jupyter Notebook?

How can a Jupyter notebook cell be split in VSCode? I.e., how to split a single cell with multiple lines into two cells with the top lines (above the cursor) in one cell and the bottom lines (below the cursor) in another cell?

I've tried Cntrl Shift - using the Daily Insiders Python Extension, but it doesn't seem to do anything.



Solution 1:[1]

The Ctrl Shift - is for zooming out the display by default in VS Code. This feature has been put for a long time in Github, and the following is the request:

Jupyter Split Cell and Select Multiple Cells command

This issue is still open, although there's Notebooks are getting revamped! existed, it's for VS Code Insiders, not our current using VS Code. Maybe the production group can improve it in the future.

Solution 2:[2]

In VSCode version 1.57.0-insider you can:

  • split cells with the hotkey: Ctrl+Shift+-

See also: Merge cells in VSCode jupyter notebook?

Solution 3:[3]

ctrl shift - works for VSCode (version 1.66.2) on Mac (Monterey 12.3.1)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2
Solution 3 Dendrobates