Visual Studio Code有一个热键组合来将当前窗口分割为2或3个窗格:

"key": "ctrl + \",               "command": "workbench.action.splitEditor"

不幸的是,我无法在没有鼠标的情况下在这些窗格之间切换。我以前用F6的习惯也不管用了。

Visual Studio代码编辑器是否支持它?


当前回答

Alt+←和Alt+→在Windows上可以开箱即用。它只会在分屏窗格之间切换,不会重新激活窗格内的非活动文件。

其他回答

默认情况下,Ctrl+Tab在当前组中的编辑器之间循环,但不在组之间循环。我们可以简单地扩展默认快捷方式来获得我们想要的行为。VS Code用户指南告诉我们需要在keybindings.json中添加什么:

[
  {
    "key": "ctrl+tab",
    "command": "workbench.action.quickOpenPreviousRecentlyUsedEditor",
    "when": "!inEditorsPicker"
  },
  {
    "key": "ctrl+shift+tab",
    "command": "workbench.action.quickOpenLeastRecentlyUsedEditor",
    "when": "!inEditorsPicker"
  }
]

这将修改Ctrl+Tab遍历所有打开的编辑器,而不仅仅是当前组中的编辑器。

虽然它不能直接在组之间切换,但我更喜欢这个解决方案,因为它将两种类型的导航(在组之间移动,在编辑器之间移动)结合到一个简单的快捷方式中,并且已经在我的肌肉记忆中了。

我最近发现了这个键绑定,它可以在组中的分裂窗格之间切换焦点。

"workbench.action.focusOtherSideEditor"

https://code.visualstudio.com/docs/customization/keybindings#_editorwindow-management

Windows操作系统:Ctrl+1、Ctrl+2、Ctrl+3。

Mac: Cmd+1, Cmd+2和Cmd+3。

窗格之间没有循环切换,类似于Ctrl+制表符对文件的切换。

你需要的是: 查看:聚焦下一个编辑器组

我为这个快捷键定义了ctrl+H ! 这是所有!

此外,这个键绑定也可以:

workbench.action.navigateEditorGroups

你要找的是workbench.action.terminal.focusNextPane:

{ 
  "key": "alt+down",
  "command": "workbench.action.terminal.focusNextPane",
  "when": "terminalFocus"
},
{ 
  "key": "alt+right",
  "command": "workbench.action.terminal.focusNextPane",
  "when": "terminalFocus"
},