简体   繁体   English

使用打开文件夹命令启动的 VSCode Win 快捷方式

[英]VSCode Win Shortcut to Launch with Open Folder Command

I have 10 applications that I constantly work on.我有 10 个我经常处理的应用程序。 At times I need to open them all up separately to run bash commands on them.有时我需要单独打开它们以对它们运行 bash 命令。 Is there a way I can create a windows shortcut for each folder, then I select all 10 shortcuts and click enter to initiate 10 different VSCode applications each opens up with their respective folder I set to?有没有一种方法可以为每个文件夹创建一个 windows 快捷方式,然后我 select 所有 10 个快捷方式并单击 enter 以启动 10 个不同的 VSCode 应用程序,每个应用程序都打开我设置的各自文件夹?

(Windows 10) To open VS Code in desired directory using shortcut: (Windows 10) 使用快捷方式在所需目录中打开 VS Code:

  • Create shortcut to Visual Code Studio app,创建 Visual Code Studio 应用程序的快捷方式,
  • Right click on the shortcut and select Properties ,右键单击快捷方式和 select属性
  • In Target field append your directory path (remember to use quotes " " if there are spaces in the path).目标字段 append 中,您的目录路径(如果路径中有空格,请记住使用引号“”)。

截屏

I use a batch file like in Sean's solution.我使用像 Sean 解决方案中那样的批处理文件。 You can automatically close the terminal after launch if you use the start command rather than "code."如果您使用启动命令而不是“代码”,则可以在启动后自动关闭终端。

Here's an example:这是一个例子:

@echo off
cd "C:\path\to\your\project\folder\"
start "" "C:\Program Files\Microsoft VS Code\Code.exe" .
exit

Note: if you don's like how the batch file looks, you can make a shortcut to the batch file and change the shortcut's icon to the VS Code icon.注意:如果您不喜欢批处理文件的外观,可以创建批处理文件的快捷方式并将快捷方式的图标更改为 VS Code 图标。

ctr + K + O open a folder vs code most common shortcut key available all platforms same ctr + K + O打开文件夹 vs 代码最常用的快捷键所有平台都可用在此处输入图像描述

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

In a similar situation, I use a batch file to launch my most used vscode windows.在类似的情况下,我使用批处理文件来启动我最常用的 vscode windows。 I am not yet smart enough to make the cmd windows disappear after they open vscode, but maybe someday.我还不够聪明,无法让 cmd windows 在打开 vscode 后消失,但也许有一天。 In each batch file, use the following changing the directory for each project.在每个批处理文件中,使用以下更改每个项目的目录。

@ECHO OFF
cd C:\directory\where\your\project\is
code .
exit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM