Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open files always in a new tab

I am using Visual Studio Code 1.3.1 with the newly introduced tabs.

When I click on files, the first file will open in a tab. If I do not make any changes to this file, the second clicked file will open in the same tab.

How can I avoid this and make Visual Studio Code always open a new tab?

like image 330
Michael Hoeller Avatar asked Aug 02 '16 06:08

Michael Hoeller


People also ask

How do I open all files in Visual Studio?

In Visual Studio, click File > Open > Folder. Navigate to the folder, and click Select Folder. This opens the folder in Solution Explorer and displays its contents, files and any subfolders.


1 Answers

When you [single-]click a file in the left sidebar's file browser or open it from the quick open menu (Ctrl-P, type the file name, Enter), Visual Studio Code opens it in what's called "Preview Mode", which allows you to quickly view files.

Preview Mode tabs are not kept open. As soon as you go to open another file from the sidebar, the existing Preview Mode tab (if one exists) is used. You can determine if a tab is in Preview Mode, by looking at its title in the tab bar. If the title is italic, the tab is in preview mode.

To open a file for editing (i.e. don't open in Preview Mode), double-click on the file in the sidebar, or single-click it in the sidebar then double click the title of its Preview Mode tab.

If you want to disable Preview Mode all together, you can do so by setting "workbench.editor.enablePreview": false in your settings file. You can also use the "workbench.editor.enablePreviewFromQuickOpen" option to disable it only from the quick open menu.

Before you can disable Preview Mode, you'll need to open your Settings File.

Pro Tip: You can use the Command Palette(shortcut Ctrl+Shift+P) to open your settings file, just enter "Preferences: Open User Settings"!

Once you've opened your settings file (your settings file should be located on the right), add the "workbench.editor.enablePreview" property, and set its value to false.

You can learn more about Visual Studio Code's "Preview Mode", here.

like image 128
Brynden Bielefeld Avatar answered Oct 16 '22 02:10

Brynden Bielefeld