Question: I'm editing an .ipynb file in VS Code using the Jupyter Notebook extension. I can't seem to figure out how to collapse (or expand) cells.

Can someone explain to me how to do this (using hotkeys or not using hotkeys), or give ideas for what I might be doing wrong?

I tried each of the hotkeys shown below, under three sets of conditions: 1. with the blue vertical bar on the left-hand side of my cell input selected, 2. with the blue vertical bar on the left-hand side of my cell output selected, 3. with my cursor in my cell input.

[!["Notebook: Collapse Cell Input" and "Notebook: Collapse Cell Output", with default bindings](https://i.stack.imgur.com/Rxg85.png)](https://i.stack.imgur.com/Rxg85.png)

Answer: 
And another way to collapse cells is coming to v1.64. See

> 
> ### Cell collapsing UI
> 
> 
> Notebook cells have a blue bar on the left side to indicate that they
> are focused. This bar is now interactive - you can click the top part
> to collapse the cell input, and the bottom part to collapse the
> output.
> 
> 
> 

[![cell collapse demo](https://i.stack.imgur.com/uHxCM.gif)](https://i.stack.imgur.com/uHxCM.gif)

* from <https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_64.md#cell-collapsing-ui>
I'm using version 1.58.2 and this functionality is now available!

Simply right-click a code cell and select 'Collapse Cell Output'.

Alternatively, click a code cell (make sure you are in command mode) and use the keyboard shortcut ⌘K T (on Mac) or Ctrl-K T on Windows.

[![Collapse Cell Output](https://i.stack.imgur.com/a4gi8.png)](https://i.stack.imgur.com/a4gi8.png)