Visual Studio代码-键盘快捷键-展开/折叠全部


Answers:


194

这里是。

Ctrl+Shift+[    Fold (collapse) region  editor.fold
Ctrl+Shift+]    Unfold (uncollapse) region  editor.unfold
Ctrl+K Ctrl+[   Fold (collapse) all subregions  editor.foldRecursively
Ctrl+K Ctrl+]   Unfold (uncollapse) all subregions  editor.unfoldRecursively
Ctrl+K Ctrl+0   Fold (collapse) all regions editor.foldAll
Ctrl+K Ctrl+J   Unfold (uncollapse) all regions

在此链接上查看“ Visual Studio代码键绑定”部分。

在pdf中还提供了特定于平台的键盘快捷键。

WindowsMACLinux


4
这可能与Vim插件有冲突。提到人们来这里挠头的原因,这似乎是行不通的。Vim插件对Ctrl键序列非常不好,而MSoft不太在乎。
Jatal

Ctrl + K Ctrl + 3
noririco '20

30

您可以为此设置自定义值。

  1. 打开命令调色板(+ +PF1Mac上)
  2. 搜索 Open Keyboard Shortcuts
  3. 然后搜寻 collapse
  4. 最后,点击和选项+附近的符号,Collapse All然后Collapse Folders in Explorer像我一样设置快捷方式

键盘vscode折叠所有快捷方式

或者,您可以打开keybindings.json文件并将其添加到主阵列。

 ,
  {
    "key": "cmd+k cmd+s",
    "command": "search.action.collapseSearchResults"
  },
  {
    "key": "cmd+k cmd+e",
    "command": "workbench.files.action.collapseExplorerFolders"
  }

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.