Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode auto folding on open file

Tags:

What: Is there any way to open files in vscode and have it auto fold code for you?

Why: I only need to see most code a few times before I've memorized it, and at that point a reference with a peeked definition is all I need. Interfaces, classes, and types just take up my realestate. I want more of the most valuable code on the screen at a time. This means I need to hide some or all of the code when files are large.

Ideally: I'd like to just close specific types of code (ex. interfaces) for specific types of files (ex. typescript files) for files larger than arbitrary 55 lines long, but I would settle for just auto folding all code.

like image 889
Urasquirrel Avatar asked Jun 01 '18 13:06

Urasquirrel


1 Answers

As far as I know that is not possible in vanilla vscode.

There is however an extension you might be interested in, which might do the trick for you: https://marketplace.visualstudio.com/items?itemName=bobmagicii.autofoldyeah

If you haven't tried it yet you might also want to check out "Go to symbol in file..." - it might help you navigate in larger files.

The hotkey for that is command-shift-o (on mac), if you type a colon afterwards it even sorts it into variables/functions etc.

Anyways - short answer, not possible without an extension.

like image 153
oem Avatar answered Sep 28 '22 18:09

oem