How can multiple files be opened in Visual Studio Code (VSC)?

How can multiple files be opened in Visual Studio Code (VSC)? For some reason, my copy of VS Code can only open one file at a time. For example if there are two files in the workspace folder, lets say an HTML and CSS file, both cannot be opened simultaneously. If one file is open, clicking any other item in VSC's file explorer will replace the current file. VSC will not open the other file in a new editing tab. Not concerned with running multiple instances, Workspaces or folders of VSC. I just want to open 2 files in the same folder. Is there a config setting controlling this? Or is this the result of upgrading to the latest version of VSC? Is just a "new feature" of VSC? It's seems ridiculously simple but I need help. Running VSC v. 1.24.0 for Win10x64. Any clues appreciated. Thank you.

Visusal Studio Code Screenshot:

enter image description here


Solution 1:

In VS Code, if you click once on a file, it opens it in a temporary tab. This is helpful if you are looking into a bunch of files searching for something, without opening every single one of them.

If you want to open a file in a new tab that persists until closed manually, double click on the file.

You can also persist a tab that was previously created as a temporary tab by double clicking on the tab. Note that temporary tabs have an italicized title, while normal tabs do not.

Solution 2:

Others have mentioned double-clicking the file in order to open it, however, I will suggest an alternative approach:

Within your settings, under workbench, set:

"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false

This will allow you to open the files with a single click, as opposed to double-clicking. It may seem minute, but it was incredibly annoying to have to double-click every single file.

Solution 3:

VS Code, by default, keep this option enabled to open a file in a temporary file, this feature comes in handy when you want to just take a look at some code.

If you want to open a file in a new tab, just double click on the tab or double click on the folder you want to open from explorer or once the file is opened press the short-cut key ctrl + k + enter.


You can even disable this option in File > Preferences > Settings, under the user settings.

Paste this code in your user's setting.

"workbench.editor.showTabs": false

Solution 4:

Please follow below steps:-

File > Preferences > Settings. Now you will see USER SETTINGS and WORKSPACE SETTINGS.

Click on WORKSPACE SETTINGS. Now search for workbench.editor.showTabs and change it's value to true.

I tested this by turning it false and it restricts from opening multiple files in tabs. When it's false whenever you open one file only that file will be opened and the earlier file gets closed.

When set to true, you can open as many files you want and all files will be a new tab.

Solution 5:

Go to 'settings' in VSCode and search for 'preview' then on the 2nd position from the top you will find " Workbench › Editor: Enable Preview " simply untick it and your problem will be solved.

In this GIF you can see it's working properly.