admin管理员组文章数量:1279016
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.
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.
Share Improve this question edited Sep 7, 2020 at 6:28 Urasquirrel asked Jun 1, 2018 at 13:41 UrasquirrelUrasquirrel 1,5851 gold badge19 silver badges36 bronze badges 2- That does exist, but only for the import section: stackoverflow./a/68503900/6309 – VonC Commented Jul 23, 2021 at 18:53
- This app seems to be exclusively for this purpose: [marketplace.visualstudio./… – Alex Commented Apr 30, 2022 at 3:15
1 Answer
Reset to default 10As 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./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 mand-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.
本文标签: javascriptvscode auto folding on open fileStack Overflow
版权声明:本文标题:javascript - vscode auto folding on open file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741262516a2367880.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论