jagmeetb
jagmeetb

Reputation: 373

How to set up VS-Code to open new files in current instance?

So I've been using Visual Studio Code recently and I really like it. However, every time I open a file, a new window will open rather than a new "tab." I've already tried setting window.openInNewWindow to false and that doesn't work.

Upvotes: 27

Views: 7956

Answers (4)

GGirard
GGirard

Reputation: 1185

Edit regarding VSCode 1.9.0

The VSCode team has changed the default settings since 1.9.0, it should now be the default behavior. If VS Code is still not reusing the same window, you can enforce this behavior with:

"window.openFilesInNewWindow": off

They have also extended the settings available to configure those behaviors (see release note here).

Original answer

This is currently supported by the latest version of VSCode and solution is detailed in this SO post.

Simply add the following setting to your user setting:

"window.openFilesInNewWindow": false

Tested and approved with VSCode 1.4.0 :)

Upvotes: 31

Megaroeny
Megaroeny

Reputation: 827

Updated answer since 1.11:

"window.openFilesInNewWindow": "off"

Accepted values are now "on" "off" "default"

Upvotes: 6

syokensyo
syokensyo

Reputation: 173

Try to set "workbench.editor.enablePreview"=false

Upvotes: 0

Wade Anderson
Wade Anderson

Reputation: 2519

If you want to edit multiple files in the same directory then open the root directory.

If you want to edit multiple files that aren't in the same directory use the command line to open code with multiple files. See documentation here. Copied below for reference.

code file1 file2 file3

See setup to get Code on the command line.

Upvotes: 0

Related Questions