我在VS Code实例中打开了两个文件夹。
例如(文件夹名称):A和B
我想在新的VS Code实例中打开文件夹B,但是没有通过右键单击该文件夹打开的选项。
Even Atom可以选择在新实例中打开文件夹。
答案 0 :(得分:5)
您可以通过“文件”>“新建”窗口或按ctrl + shift + n进入新窗口,然后在此处打开第二个文件夹。
或“ window.openFoldersInNewWindow”设置:
// 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",
答案 1 :(得分:1)
此扩展程序允许您在新的vscode窗口中打开文件夹。
the wait()
man page
答案 2 :(得分:1)
创建注册表文件,例如OpenOnRightClick.reg
将以下行添加到文件中:
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\""
根据安装目录更改Visual Studio代码的位置 现在,只需双击OpenOnRightClick.reg文件,确认是否询问! 全做完了 !右键单击,将打开“打开代码”选项。
答案 3 :(得分:0)
vscode
中打开的文件夹URL。在文件位置上,输入URL cmd
code .
vscode
窗口中打开。