'How to open folder in new vs code instance by right clicking on the folder?
Solution 1:[1]
This extension allows you to open a folder in a new vscode window.
Open Folder Context Menus for VS Code
Solution 2:[2]
You can go via File > New window or ctrl+shift+n for a new window, and open the second folder there.
Or the "window.openFoldersInNewWindow" setting:
// Controls if folders should open in a new window or replace the last active window.
// - default: folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu)
// - on: folders will open in a new window
// - off: folders will replace the last active window
// Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).
"window.openFoldersInNewWindow": "default",
Solution 3:[3]
Create a registry File e.g. OpenOnRightClick.reg
Add these lines to the file:
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\xx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\xx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\xx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Users\\xx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Users\\xx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Users\\xx\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""
Change the location of visual studio code as per your installation directory Now just double click on the OpenOnRightClick.reg file, confirm if asked ! All done ! on you right click you will have a open with Code option.
Solution 4:[4]
Let's make it very simple
- In vscode , Go to Files --> New Window, as shown in the image below. This will open a blank vscode window, where we will open new project.
- Drag the project folder and drop it into the vscode. as shown in the below image
That's it. New blank window has the new project opened.
Another way is discussed below
- Go to Folder URL which you want to open in the
vscode
. On the file location, type in the URLcmd
- cmd prompt will open with the folder URL.
- In the cmd prompt, type
code .
- Your folder will open in the new
vscode
window.
Solution 5:[5]
I also wanted that feature in my editor so I saved my settings and preferences and then I reinstalled VS Code in order to check the box that adds "Open with Code" as action in the context menu:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dan |
Solution 2 | katsho |
Solution 3 | Manish S |
Solution 4 | |
Solution 5 |