今天微软发布了Visual Studio Code文件/文件夹编辑器。

第一个限制是它似乎是一个单实例应用程序。

是否有一种方法可以获得多个实例,或者让它同时打开多个文件夹?


当前回答

在Windows中

按“Ctrl + Shift + P” 将光标移动到“工作区:在新窗口中复制为工作区”这一行。 单击该行上的设置图标,配置按键绑定。 为这个命令指定“Ctrl + Alt + D”(或其他你喜欢的键)。 使用“Ctrl + Alt + D”打开多个实例。

其他回答

Ctrl+ Shift + N将打开一个新窗口,而Ctrl+K则释放键,按O将在一个新窗口中打开当前选项卡。然后,您可以使用菜单文件→打开文件夹,在每个窗口中有两个不同文件夹的Visual Studio Code实例。

Mac⌘+ Shift + N和⌘+ K。

有用的快捷键列表可以在这里找到。

当你不知道CTRL+SHIFT+N快捷键时,最简单的方法是使用菜单:文件,新建窗口

从0.9.0版本开始,我们添加了一个新的设置窗口。reopenFolders来控制Visual Studio Code是否应该恢复前一个会话的所有文件夹。

默认情况下,只会恢复您使用过的最后一个活动窗口,但如果将此设置更改为“全部”,visualstudio Code将自动重新打开其窗口中的所有文件夹。

如果你使用VS Code用于多种目的(c#, Python,数据库客户端等),用不同的颜色和主题在任务栏中分离每个实例是很有用的。

要做到这一点,你可以结合使用这些技巧:

For having separated icons in taskbar follow these steps (taken from https://www.reddit.com/r/vscode/comments/fkplzc/how_do_i_prevent_vscode_portable_copies_from/fkulriu?utm_source=share&utm_medium=web2x&context=3): Download portable version from https://code.visualstudio.com/docs/editor/portable (go to download page link and get proper '.zip' file), extract it somewhere and create a folder named 'data' in it (beside code.exe) to enable portable mode. Open directory {vscode_installation_dir}/resources/app Edit the file product.json with a text editor (VS Code/Notepad.exe/Notepad++ or whatever) Locate the key win32AppUserModelId Change its value to what you want it to be, and save the file: Now, if you run the executable, this modified copy of VS Code should remain separate from other VS Codes in the Windows Taskbar. For changing the VS Code theme color itself use Peacock (https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock) For changing taskbar icon you can use https://github.com/electron/rcedit (sample use: https://www.reddit.com/r/vscode/comments/fkplzc/how_do_i_prevent_vscode_portable_copies_from/fky786v?utm_source=share&utm_medium=web2x&context=3) By pining the icons to the taskbar you can use shortcut of (Win key + Numbers) to easily open and switch between them.

最终结果:

如果您想打开同一文件夹的多个实例,则目前不支持。如果你想看到它的实现,请观看并为这个GitHub问题投票:支持在多个Visual Studio Code窗口中打开一个项目文件夹