Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move tabs in Visual Studio Code with the keyboard?

I found the documentation here and here (under moveActiveEditor) for moving tabs, but I have trouble creating a key binding for it.

I created the following (for a Mac, so it uses cmd):

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

But when I hit that key command, the tab moves to the first tab position instead of moving one tab position to the right. So clearly, the value of i is 0, meaning it isn't returning the correct value of the current tab.

How can I get this to work?

like image 288
Gary Avatar asked Mar 16 '18 16:03

Gary


1 Answers

You need to replace position with right and remove the value attribute:

[
  {
    "key": "alt+cmd+right",
    "command": "moveActiveEditor",
    "args": {
      "to": "right"
    }
  }
]
like image 93
HaaLeo Avatar answered Sep 19 '22 23:09

HaaLeo