22

When I go thru open tabs in VS Code by Ctrl+Tab keyboard shortcut, the next tab to display is not always the next tab over to the right of currently displayed. (I am taking wrap-around into account; this also happens when the current tab isn't rightmost) This is a problem for me from an aesthetic/UX point of view because tab changing feels out of sync with the gui, & it slows me down.

I'd be happy with a solution that either makes Ctrl+Tab follow the order displayed onscreen or makes the displayed order follow whatever order Ctrl+Tab is using. Thanks if you have any info

ifconfig
  • 6,242
  • 7
  • 41
  • 65
Nathan Smith
  • 475
  • 4
  • 12

2 Answers2

22

By default, Ctrl+Tab switches tabs in the order of last use. (The tabs are switched to in reverse chronological order)

According to the VS Code docs, by default, the method to switch tabs linearly is as follows:

  • Ctrl+PageUp: Go left an Editor (Command: workbench.action.previousEditor)

  • Ctrl+PageDown: Go right an Editor (Command: workbench.action.nextEditor)

Of course, these are remapable to your liking, but these are the defaults.

ifconfig
  • 6,242
  • 7
  • 41
  • 65
  • @NathanSmith Does this work for you? If so, please accept the answer. – ifconfig Sep 13 '17 at 16:09
  • Thanks, it does. I went into keymappings & adjusted the linear tab switching commands ( 'open next|previous editor' ) swapping them for the history based commands tied to ctrl+tab by default – Nathan Smith Sep 13 '17 at 21:33
  • It may be worth adding the names for these commands are `workbench.action.previousEditor` `workbench.action.nextEditor` (for when you're looking to change them) – csilk Feb 12 '18 at 09:02
  • @csilk Yes! I'm not sure why they weren't there in the first place. – ifconfig Feb 12 '18 at 16:06
17

In %AppData%\Roaming\Code\User\keybindings.json add this:

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