Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode: editor.background, per user, per workspace

I often work on multiple projects with multiple instances of VSCode open simultaneously. It would be nice to have a different background color in each instance so I can differentiate them easily.

I can add:

"workbench.colorCustomizations": {
   "editor.background": "#xxxxxxx"
 }

in my user settings, but then it changes the background color for all instances of VSCode. Or, I can add that to the workspace settings. Unfortunately the workspace setting file is under source code control (for other workspace-relevant settings), so that changes it for everyone else on my team, annoying them.

Is there a way to configure a per-user, per-workspace setting, or perhaps an extension?

like image 457
keithb Avatar asked Nov 01 '17 21:11

keithb


People also ask

Can you have multiple workspaces in VS Code?

You can work with multiple project folders in Visual Studio Code with multi-root workspaces. This can be helpful when you are working on several related projects at one time.

How do I manage my workspace in VS Code?

Workspace tasks and launch configurationscode-workspace file, the location of workspace task and launch configurations will either be inside the . vscode folder or inside the . code-workspace file. In addition, task and launch configurations can always be defined at the level of a folder, even when you have opened a .

How do I get VS Code to workspace settings?

Similar to User Settings, Workspace Settings are also stored in a settings.json file, which you can edit directly via the Preferences: Open Workspace Settings (JSON) command. The workspace settings file is located under the .vscode folder in your root folder.


1 Answers

From workspace and user settings

VS Code provides two different scopes for settings:

User These settings apply globally to any instance of VS Code you open

Workspace These settings are stored inside your workspace in a .vscode folder and only apply when the workspace is opened. Settings defined on this scope override the user scope.

So in your root folder for each workspace within a .vscode folder you can add a settings.json with

// Place your settings in this file to overwrite default and user settings.

{

  "workbench.colorCustomizations": {
      "editor.background": "#f00"
  }
}
like image 97
Mark Avatar answered Nov 11 '22 18:11

Mark