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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With