当前的功能是给我一个下拉选项,选择哪个选项卡是如此烦人。是否有可能删除它,使标签将像在一些现代网络浏览器。


当前回答

有多种方法可以切换选项卡。

基于位置的现代浏览器方式。

{
       "key": "ctrl+tab",
       "command": "workbench.action.nextEditor"
   },
   {
       "key": "ctrl+shift+tab",
       "command": "workbench.action.previousEditor"
   }

最近排序

{
   "key": "ctrl+shift+tab",
   "command": "workbench.action.openNextRecentlyUsedEditor"
 },
 {
   "key": "ctrl+tab",
   "command": "workbench.action.openPreviousRecentlyUsedEditor"
 }

其他回答

Linux键映射来匹配浏览器:

[
    {
        "key": "ctrl+0",
        "command": "workbench.action.lastEditorInGroup"
    },
    {
        "key": "ctrl+1",
        "command": "workbench.action.openEditorAtIndex1"
    },
    {
        "key": "ctrl+2",
        "command": "workbench.action.openEditorAtIndex2"
    },
    {
        "key": "ctrl+3",
        "command": "workbench.action.openEditorAtIndex3"
    },
    {
        "key": "ctrl+4",
        "command": "workbench.action.openEditorAtIndex4"
    },
    {
        "key": "ctrl+5",
        "command": "workbench.action.openEditorAtIndex5"
    },
    {
        "key": "ctrl+6",
        "command": "workbench.action.openEditorAtIndex6"
    },
    {
        "key": "ctrl+7",
        "command": "workbench.action.openEditorAtIndex7"
    },
    {
        "key": "ctrl+8",
        "command": "workbench.action.openEditorAtIndex8"
    },
    {
        "key": "ctrl+9",
        "command": "workbench.action.openEditorAtIndex9"
    },
    {
        "key": "alt+1",
        "command": "workbench.action.focusFirstEditorGroup"
    },
    {
        "key": "alt+2",
        "command": "workbench.action.focusSecondEditorGroup"
    },
    {
        "key": "alt+3",
        "command": "workbench.action.focusThirdEditorGroup"
    }
]

当我把窗口分成多个面板时,我发现CTRL+TAB和CTRL+SHIFT+TAB只在一个面板中循环打开文件(而不是所有面板),这真的很烦人。要更改行为,使其在快速打开对话框中循环所有面板,同时保留行为,请将这些添加到您的键绑定:

  {
    "key": "ctrl+tab",
    "command": "workbench.action.quickOpenPreviousRecentlyUsedEditor"
  },
  {
    "key": "ctrl+shift+tab",
    "command": "workbench.action.quickOpenLeastRecentlyUsedEditor"
  },
  {
    "key": "ctrl+tab",
    "command": "workbench.action.quickOpenNavigateNextInEditorPicker",
    "when": "inEditorsPicker && inQuickOpen"
  },
  {
    "key": "ctrl+shift+tab",
    "command": "workbench.action.quickOpenNavigatePreviousInEditorPicker",
    "when": "inEditorsPicker && inQuickOpen"
  }

使用Sublime文本键图。更直观了。

⌘k⌘m

导入Sublime文本键图:

Name: Sublime Text Keymap and Settings Importer
Id: ms-vscode.sublime-keybindings
Description: Import Sublime Text settings and keybindings into VS Code.
Version: 4.0.3
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings

窗户

在Windows上使用Visual Studio Code时,可以使用CTRL + PAGE_UP切换到上一个选项卡,CTRL + PAGE_DN切换到下一个选项卡。

您还可以根据选项卡的(非零相对)索引切换到选项卡。你可以按住ALT键,再加一个数字(1到9)。

操作系统

要在选项卡之间快速导航,请按住CMD键,然后按下要切换到的选项卡的数字(1到9)。

您还可以通过CMD + ALT +左/右键盘快捷键在上一个/下一个选项卡之间切换。

请注意,要切换到不同编辑器组中的选项卡,必须首先切换到所需的编辑器组。

专业提示:如果您不喜欢任何一个键绑定,您可以将它们更改为您觉得更舒服的任何键绑定!

卓帕卡布拉有修正行为的正确答案。

我通常更喜欢使用CTRL + PAGE UP / DOWN来导航,而不是使用TAB键。

    {
        "key": "ctrl+pageUp",
        "command": "workbench.action.nextEditor"
    },
    {
        "key": "ctrl+pageDown",
        "command": "workbench.action.previousEditor"
    }