Vscode: [themes] Put theme configuration to settings.json

Created on 7 Jun 2016  路  15Comments  路  Source: microsoft/vscode

Having a theme/currentTheme key that could be set in settings.json would be useful in automatically setting the theme in an automated setup. I'm assuming right now it's handled in local storage or something instead?

feature-request plan-item themes

Most helpful comment

When developing extensions, I often have two vscode instances running (sometimes four!) and it would be _very_ helpful if I could quickly distinguish them by assigning each a different theme.

All 15 comments

Yes, part of your workbench settings that know about recently opened VSCode input, window sizes, cursor positions.
We could put that in the settings. Would we remove it from the File>Preferences menu then? We would loose the theme previewing. If we keep it we would have to ask the user of where to define the theme in user or workbench settings.

Couldn't the theme preview just live update the settings.json?

Which one? User or workspace settings?

@aeschli well it would be weird to have a workspace-associated theme, so user. Good point though that there would be a bit of weirdness there. In the end I think it would be good to be able to script your entire vscode setup, themes are the main missing piece in that now that extensions can be installed via the CLI.

I say you keep the two synced. I'd like to have that ability.

@Tyriar actually there are situations when theme per workspace makes sense -- I am dealing with the reduced color pallet in the default light+ and dark+ themes which forced me to switch the theme every time I am working with different types of code i.e. workspace.

When developing extensions, I often have two vscode instances running (sometimes four!) and it would be _very_ helpful if I could quickly distinguish them by assigning each a different theme.

To add some use cases, I'd like the set the theme per workstation for our environment. I specifically want to mandate a light theme because our users screenshot examples from VSCode and it'd save a lot of toner. But I appreciate that's quite specific. If you add printing support you might also want the ability to use a specific print theme.

Perhaps a workstation.json can be superseded by the settings.json which as currently is superseded by the workspace.json?

I think the quickest improvement would be to add the theme key to settings.json which takes precedence over storage.json. I currently create a fixed settings.json with a GPO to preset other things, it's easy enough for admins to copy across settings they want to keep.

it would be weird to have a workspace-associated theme

I actually found this thread because I was trying to figure out how to get a workspace-associated theme. I'm quite frequently working on multiple projects and being able to associate a specific project's editor window with a particular color would be incredibly helpful

this would be a killer feature.

just setting up a new machine after putting my settings.json in source control to maintain across boxes. Having the theme 'settable' from settings.json seems a really worthwhile feature (as well as the icon theme)

is automatically installing a theme from the market place if it isn't currently installed (and set in settings.json) too big a step?

Could it be implemented with an additional setting key called "saveThemeTo" with the values, "user", "workspace" to decide where to make changes by default during live preview?

Also, what are the scenarios when the "theme" setting would need to be auto-changed? Just when live-previewing I guess?

EDIT

Another mechanism can be changing the "theme" in user settings unless a "theme" has been specified in workspace settings.
If a theme has been specified in worskspace settings, update both when live-previewing?

The dirtiest but easiest way would be to obviously add two different menu items.

Theme configuration is now part of the settings:

  // Specifies the color theme used in the workbench.
  "workbench.colorTheme": "Default Dark+",

  // Specifies the icon theme used in the workbench.
  "workbench.iconTheme": null,

It can be configured as a user and also as a workspace setting.

So i can get all the installed file icons and themes both from iterating in the extensions ?
(vscode.extension.all.forEach(e => e.packageJSON.contributes ....)

And set current via settings.json !

Yes, in the packageJSON you find all contributed themes & icon theme including the path to the theme file and icon theme file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

borekb picture borekb  路  3Comments

mrkiley picture mrkiley  路  3Comments

shanalikhan picture shanalikhan  路  3Comments

biij5698 picture biij5698  路  3Comments

sijad picture sijad  路  3Comments