Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Code Folding

I am trying to install or update a setting that allows me to minimize and maximize code blocks within VS Code. Similar to below and/or like Visual Studio:

https://www.flickr.com/photos/50988329@N02/25504022561/in/dateposted-public/

Just in case the image link doesn't work, I am speaking about the plus and minus signs/icons that you see next to the line numbers in Visual Studio.

like image 219
Dylan Wright Avatar asked Mar 07 '16 21:03

Dylan Wright


People also ask

How do you collapse everything in VSCode?

How to Collapse All Source Code in VS Code? To fold all top-level and child elements of your code: Enter the command >fold and hit Enter.

How do I collapse and expand code in Visual Studio?

CTRL + M + O will collapse all. CTRL + M + P will expand all and disable outlining. CTRL + M + M will collapse/expand the current section.

How do I create a collapsible section in Visual Studio?

Select the section of code. Press Ctrl+M+H – Turn on the collapsible/expandable option. Press Ctrl+M+U – Turn off the the collapsible/expandable option.

What is Ctrl Shift P in VSCode?

You can define a keyboard shortcut for any task. From the Command Palette (Ctrl+Shift+P), select Preferences: Open Keyboard Shortcuts File, bind the desired shortcut to the workbench.


1 Answers

The February Update (0.10.10) for VSCode just added support for code folding.

Try downloading that and giving it a try. You can enable or disable code folding with the editor.folding setting.

like image 60
Matt Bierner Avatar answered Nov 03 '22 01:11

Matt Bierner