自Visual Studio代码版本0.10.11以来,折叠已经推出并现已实现。有以下键盘快捷键可用:
>
展开在光标处展开折叠的区域: 折叠所有折叠编辑器中的所有区域: 全部展开在编辑器中展开所有区域: 引用:https://code.visualstudio.com/docs/getstarted/keybindings
Windows和Linux/LI>上的
Windows和Linux/LI>上的
Windows和Linux/LI>上的
Windows和Linux/LI>上的
从Visual Studio代码版本1.12.0(2017年4月)开始,请参见基本编辑&>;在文件中折叠部分。
默认键为:
全部折叠:
折叠级别[n]: 全部展开: 折叠区域: 展开区域: *折叠级别:要折叠除最外类以外的所有内容,请尝试 MACS:使用而不是
按区域进行代码折叠的版本是V1.17。按区域折叠文档。以及V1.19和1.23。
[通常,您可以向添加一个空格,例如
,它也可以工作。]
TypeScript/JavaScript: //#region and //#endregion or // #region and // #endregion
C#: #region and #endregion
C/C++: #pragma region and #pragma endregion
F#: //#region and //#endregion
PowerShell: #region and #endregion
Python: #region and #endregion
VB: #Region and #End Region
PHP: #region and #endregion
Bat: ::#region and ::#endregion or REM #region and REM #endregion
Markdown: <!-- #region --> and <!-- #endregion -->
Golang //region and //endregion or //#region and //#endregion
Java //#region and //#endregion
CSS/SCSS/Less: /* #region */ and /* #endregion */ or /*#region*/ and /*#endregion*/
SCSS/Less: // #region and // #endregion
Go: // region, // endregion and // #region, // #endregion
shellscript: # region and # endregion
Perl5 #region and #endregion or =pod and =cut`
重要提示:如果您在列表中没有看到您的语言::
每种语言都有标记可用的片段。键入“。”并调用代码完成来查看它们。若要为您的语言配置区域标记,请与语言扩展提供程序联系。
因此键入,然后键入