使用干净或自定义配置文件启动 VSC [英] Launch VSC with clean or custom profile

查看:22
本文介绍了使用干净或自定义配置文件启动 VSC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常 VSC 将设置和用户数据存储在 %appdata%\Code(以及 %userprofile%\.vscode 中的扩展名.

Normally VSC stores settings and user data in %appdata%\Code (and extensions in %userprofile%\.vscode.

有没有办法告诉新实例加载其他一些配置文件或从空白画布"开始(就像您可以使用 -no-remote -profile "path\to\profile" 使用 Firefox 一样)

Is there a way to tell new instance to load some other profile or start with a "blank canvas" (like you can do with Firefox using -no-remote -profile "path\to\profile" command line arguments)?

非常适合测试.

推荐答案

是的,这是可能的,并且记录在 高级 CLI 选项,参数:

Yes, it is possible and documented in Advanced CLI options, arguments:

--user-data-dir

指定保存用户数据的目录,以 root 身份运行时很有用.

--user-data-dir <dir> Specifies the directory that user data is kept in, useful when running as root.

--extensions-dir

设置扩展的根路径.

--extensions-dir <dir> Sets the root path for extensions.

因此使用两个参数创建快捷方式提供了拥有香草"的可能性.VSC 实例启动器:

So creating shortcut with both arguments provides possibility to have a "vanilla" VSC instance launcher:

code --extensions-dir "C:\tmp-exts" --user-data-dir "C:\tmp-profile"

重要:确保您调用的是正确的 code 可执行文件:它应该是 \VSCode\bin\code.cmd, 不是 \VSCode\Code.exe (错误?).

Important: make sure you are invoking correct code executable: it should be \VSCode\bin\code.cmd, not the \VSCode\Code.exe (bug?).

VSCode 现在支持便携模式,即文件夹名为data 优先于应用程序数据(现在甚至超过命令行开关,错误?).

VSCode now supports portable mode, i.e. folder called data located in applications directory takes precedence over appdata (and for now even over command line switches, bug?).

这篇关于使用干净或自定义配置文件启动 VSC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆