'Launch VSC with clean or custom profile
Normally VSC stores settings and user data in %appdata%\Code
(and extensions in %userprofile%\.vscode
.
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)?
It would be great for testing.
Solution 1:[1]
Yes, it is possible and documented in Advanced CLI options, arguments:
--user-data-dir <dir>
Specifies the directory that user data is kept in, useful when running as root.
--extensions-dir <dir>
Sets the root path for extensions.
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"
Important: make sure you are invoking correct code
executable: it should be \VSCode\bin\code.cmd
, not the \VSCode\Code.exe
(bug?).
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?).
Solution 2:[2]
You could create your own settings profile and then reuse that for testing or to set up a new machine. Load with a custom profile, see Settings Profile, v1.67 Release Notes.
Import/Export Settings Profile
In this milestone we introduced Settings Profile that is a collection of your settings, extensions and UI customizations. If you customized VS Code, you can now export your customizations to a Settings Profile file (
mysetup.code-profile
) and save it to your computer and share it with others. Following gif shows exporting a Settings Profile from VS Code:
You can also import a Settings Profile file to restore your customizations. Following gif shows importing a Settings Profile into VS Code:
You can host your Settings Profile file in the Internet, for example save it as a public GitHub gist, and share the URL with others. One can import the Settings Profile file by providing the URL.
Note: At present only following UI customizations are included in the Settings Profile. More will be added in the future.
Status bar items visibility Activity Bar, Bottom Panel & Side Panel items visibility and order Views visibility, location and order
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Community |
Solution 2 | Mark |