【问题标题】:How to move tabs in Visual Studio Code with the keyboard?如何使用键盘在 Visual Studio Code 中移动选项卡?
【发布时间】:2018-03-16 16:33:51
【问题描述】:

我找到了用于移动标签的文档 herehere(在 moveActiveEditor 下),但我无法为其创建键绑定。

我创建了以下内容(对于 Mac,因此它使用 cmd):

[
  {
    "key": "alt+cmd+right",
    "command": "moveActiveEditor",
    "args": {
      "to": "position",
      "value": i + 1
    }
  }
]

但是当我按下该键命令时,选项卡会移动到第一个选项卡位置,而不是向右移动一个选项卡位置。很明显,i 的值是0,这意味着它没有返回当前选项卡的正确值。

我怎样才能让它工作?

【问题讨论】:

    标签: visual-studio-code keyboard-shortcuts vscode-settings


    【解决方案1】:

    需要将position替换为right,并去掉value属性:

    [
      {
        "key": "alt+cmd+right",
        "command": "moveActiveEditor",
        "args": {
          "to": "right"
        }
      }
    ]
    

    【讨论】:

      猜你喜欢
      • 2016-06-01
      • 2013-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-14
      • 2010-09-10
      • 1970-01-01
      相关资源
      最近更新 更多