Themes are great but sometimes some are better than others for a certain language.
This extension lets you select which theme to apply by language.
If you prefer, like me, to edit Markdown and AsciiDoc files using a dark theme but code using a light theme, or prefer the coloration of a theme for a specific language, this extension is made for you.
Important: If you have set a theme for a language, changing the color theme using the standard
vscode
menu will not work. To change the default theme, use theSet default theme
command.
Use the command Set default theme
to set the default theme.
This theme will be used for all file languages that do not have a custom theme set.
Open a file and use the command Set theme for current file language
to set the theme to use for this file language.
To revert to the default theme for the current file language, use the command Use the default for current file language
.
To unregister all custom themes, use the command Clear all registered custom themes for file languages
.
IMPORTANT: Entries starting with
filename:
take precedence over other entries.
NOTE There is no UI to do this. You will need to edit your
settings.json
manually.
To set a theme based on the filename, open your settings.json
and add an entry to your theme-by-language.themes
configuration entry.
The key must be of the following format: filename:<filename regex>
.
Example:
"theme-by-language.themes": {
"*": "Minone",
"markdown": "Visual Studio Dark",
"python": "Default Dark+",
"filename:.*\\.ipynb": "<theme name>",
"filename:.*\\.drawio": "<theme name>",
}
- Changing the language manually for the current file will not automatically change the theme. You will need to switch editors.
- Does not work well when switching between multiple instances of
vscode
.
Special thanks to @MrDoomy for creating the logo!
Enjoy!