Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open another folder in VSCode in the same instance?

Let's say I have 2 folders - apple & orange

Now I opened apple in VSCode using code apple.

In the embedded terminal in VSCode, how do I open orange folder in the same instance as apple by overriding it without starting a new instance?

like image 678
deadcoder0904 Avatar asked May 15 '19 12:05

deadcoder0904


People also ask

How to open folder directly in Visual Studio Code?

How to Open Folder Directly in Visual Studio Code by Right Clicking in Windows Explorer 1 Introduction. Visual Studio Code is a lightweight code editor and runs on any platform. It is much easier to work with it. 2 Using the Code. Apply the following code... Save the file and close it. Open that file by double click / hit Enter. ... 3 History

How do I open multiple files in Visual Studio Code?

Use the “Cmd” key to split your current editor into two windows. Click and hold “Split Editor” located at the upper right corner of a window, then drag it wherever you prefer. If VS Code doesn’t allow you to open multiple files, the issue most likely lies in the program settings. To fix that, do the following:

What is Visual Studio Code (vs Code)?

Visual Studio (VS) Code is an extremely user-friendly code editing software that allows you to open multiple files at once. You can do this either in tabs or in separate windows for your convenience and easily navigate between them using File Explorer.

How do I search for files in VS Code?

VS Code features like global search work across all folders and group the search results by folder. When you have a multi-root workspace open, you can choose to search in a single root folder by using the ./ syntax in the files to include box.


1 Answers

Support for multi-root workspaces is there.vscode-insiders which support multiple projects at same time.Please refer to our documentation for a full explanation of all the features that come with it. Extension authors should refer to our wiki that explains the new extension APIs to make your extension ready for multi-root workspaces.

You can do it like this:

I just tried in my system it working perfectly fine to open a another folder in same instance

code -r path

Like: code -r C:\Users\admin\xxxx\xxxx\apple(orange already opened in the same instance)

If you want to open a existing folder in new window from terminal:

code -n Path

Like: code -n C:\Users\admin\xxxx\xxxx\apple(apple will opens in another window and orange also there.)

If you want to open a new tab in same instance by terminal:

code filename.extension (Hit enter then just press ctrl+S and then it saved the file in the same directory).

Thanks for the question.Hope this will match your curiosity B|

like image 194
Avinash Singh Avatar answered Oct 09 '22 06:10

Avinash Singh