rickhg12hs
rickhg12hs

Reputation: 11932

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.

Upvotes: 19

Views: 17118

Answers (4)

Sid Johnson
Sid Johnson

Reputation: 161

The trick is to just put the cursor where you want to split and then use ctrl-shift dash. If you try to highlight the section you want split out, as in normal Jupyter splitting, you will get the zoom behavior.

Upvotes: 3

Dendrobates
Dendrobates

Reputation: 3534

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

Upvotes: 5

Benjamin Ziepert
Benjamin Ziepert

Reputation: 1754

In VSCode version 1.57.0-insider you can:

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

See also: Merge cells in VSCode jupyter notebook?

Upvotes: 17

Molly Wang-MSFT
Molly Wang-MSFT

Reputation: 9481

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.

Upvotes: 8

Related Questions