Visual Studio Code 默认文件夹

20

我最近安装了Visual Studio Code,只是为了在与朋友合作项目时随手处理文件,但我一直想知道如何设置默认目录。每次打开编辑器都要设置文件夹有点烦人。


1
这个问题在microsoft/vscode/issues/115730上有一个开放的GH问题跟踪。 - Peter Vandivier
4个回答

0

这是 VS Code 的提示:

// An explicit start path where the terminal will be launched, this is used as the current working directory (cwd) for the shell process. This may be particularly useful in workspace settings if the root directory is not a convenient cwd.

所以,你必须编辑这个变量:

 "terminal.integrated.cwd": ""

例如在Gnu-Linux/Unix系统中:

 "terminal.integrated.cwd": "/home/oldman/C#/ASP.MVC"

在Windows上

 "terminal.integrated.cwd": "C:\Users\oldman\C#\ASP.MVC"

您的终端将被设置为当前工作目录(cwd)作为资源管理器中的根目录,(在Linux上为“/home/oldman/C#/ASP.MVC”,在Windows上为“C:\Users\oldman\C#\ASP.MVC”)。


3
本答案提到了在 VS Code 中运行终端的方式,这与打开默认文件夹是不同的。 - m0j0

0

Autohotkey可以帮助你

添加一个热键到这里

vscode_wf:= "C:\Users\noway\AppData\Local\Programs\Microsoft VS Code\code.exe"
Run, %vscode_wf% "D:\markdown_folder", ,Max

-1

我不确定我是否正确理解了问题,但以下是我的想法。

  • 将Visual Studio Code添加到您的上下文菜单中,并通过简单的点击直接打开任何文件夹。
  • 调整您的设置以控制在启动vscode后如何重新打开窗口,例如"window.restoreWindows": "all"
  • 安装像Reopen Folder这样的扩展程序

希望这可以帮助您。


-1

打开你的VS Code快捷方式,右键点击它,然后选择“属性”。

在VS Code路径后面,插入你的文件夹路径。

下面是上述指令的图片说明:


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接