13

Suppose you have 5 open tabs in order from 1-5. If you select tab 1, then select tab 5 and close it (ctrl+w), the editor goes back to tab 1.

I want it to go to tab 4, i.e. the previous neighboring tab of the tab that was closed. Not the previously selected tab.

Is there a setting in VS Code for this behavior?

Our_Benefactors
  • 490
  • 4
  • 11

2 Answers2

12

https://github.com/Microsoft/vscode/issues/43459

In settings.json:

"workbench.editor.focusRecentEditorAfterClose": false,

It opens the tab to the right.

thiagowfx
  • 1,718
  • 1
  • 16
  • 17
mathtick
  • 283
  • 4
  • 14
0

This question is duplicate with: https://stackoverflow.com/questions/62230903/how-to-get-visual-studio-code-to-select-the-correct-tab-when-closing-the-current

Answer can be found there. In short: vscode doesn't offer this functionality. You need to use a macro extension like multi-command.

xialu
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 13 '23 at 15:07
  • 1
    Better said, that question is a duplicate of this one. – Our_Benefactors Jan 13 '23 at 20:09