VSCode: 如何撤消分屏并只显示当前文件?

VSCode: how to undo split screen and show just current file?

VSCode 提供了操作(拆分和重新排列)屏幕的快捷方式:

  1. Ctrl + \ 将屏幕一分为二。
  2. Ctrl + 数字 将焦点放在其中一个屏幕上
  3. Ctrl + Shift + 0 改变vertical/horizontal split

但是,如何删除所有分屏并只显示当前聚焦的屏幕?

示例: 说,我按 Ctrl + \ 两次(给我三个竖屏),然后按 Ctrl + 2 到 select 中屏。现在按什么可以让左右屏消失,中间屏占满space?在 Emacs 中,这将是 Ctrl + X + 1.

看看这个键绑定是否符合您的要求:

{
  "key": "alt+q",
  "command": "workbench.action.closeEditorsInOtherGroups"
}

命令 workbench.action.closeEditorsInOtherGroups 没有默认的键绑定,所以我自己做了一个。我认为它可以实现你想要的。它会关闭其他编辑器组,让您保持专注。

调用命令面板(默认按 Ctrl + Shift + P)和 type/search 用于:

View: Close Editors in Other Groups

我通过单击应用程序菜单(左上角有 3 条水平线的图标)-> 查看 -> 编辑器布局 -> 单一解决了这个问题。 希望它也适合你 =).

查看菜单 -> 编辑器布局 -> 单个