Configure VS Code to switch to already open tab in another tab group when opening a file with Ctrl/Cmd+P

Viewed 237

When I open a file in VS Code using Ctrl/Cmd+P, the file is opened in the current tab group of the current editor (even if the file is already open in another tab group).

I am sure there is a setting that will switch the behaviour so that if the file I am opening is already open in another tab group, then the editor will switch to the tab of the already open file (in the another tab group).

But what is the setting to configure this behaviour?

2 Answers

Setting is Workbench > Editor: Reveal If Open

// Controls whether an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group.

"workbench.editor.revealIfOpen": true,

I have used this to open file in new tab, but It will not open redundant tabs

  "workbench.editor.enablePreview": false,
Related