Automatically switch your VS Code color theme based on the programming language of your active file.
This extension allows you to:
- Define specific color themes for different programming languages
- Automatically switch themes when you change between files of different languages
- Easily add, remove, and view your language-theme mappings
- View the current language and theme mapping in the status bar
- Temporarily enable or disable the extension
- Configure mappings via settings.json
When you open a file, the extension detects the language and applies your preferred theme for that language.
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS) to open the Command Palette - Type and select
Language Theme Selector: Add Language-Theme Mapping
- Select a language from the dropdown list
- Select your preferred theme for that language
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS) to open the Command Palette - Type and select
Language Theme Selector: Remove Language-Theme Mapping
- Select the mapping you want to remove
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS) to open the Command Palette - Type and select
Language Theme Selector: Show Current Mappings
The extension shows the current language and its associated theme in the status bar. Click on the status bar item to view all your current mappings.
If you want to temporarily disable the automatic theme switching:
- Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS) to open the Command Palette - Type and select
Language Theme Selector: Toggle Enable/Disable
This will turn the extension on or off without losing your mappings.
You can configure language-theme mappings directly in your settings.json file. This is particularly useful for:
- Configuring the same theme for multiple languages at once
- Setting a default theme for languages without specific mappings
- Sharing your configuration across multiple machines
{
"code-language-theme-selector.defaultTheme": "Default Dark+",
"code-language-theme-selector.languageMappings": [
{
"languageIds": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
],
"colorTheme": "GitHub Dark"
},
{
"languageIds": ["python"],
"colorTheme": "Monokai"
},
{
"languageIds": ["markdown"],
"colorTheme": "Light+"
}
]
}
code-language-theme-selector.defaultTheme
: The theme to use for languages without a specific mappingcode-language-theme-selector.languageMappings
: An array of language-theme mapping objects- Each mapping has
languageIds
(array of language identifiers) andcolorTheme
(theme name)
- Each mapping has
- Use a dark theme for TypeScript development
- Switch to a light theme for Markdown files
- Use a specialized theme for specific languages like Python, Rust, etc.
No special requirements or dependencies.
This extension contributes the following settings:
code-language-theme-selector.defaultTheme
: Default theme to use for any language without a specific mappingcode-language-theme-selector.languageMappings
: Language to theme mappings
None currently.
Initial release of Code Language Theme Selector.
Initial release of ...
Fixed issue #.
Added features X, Y, and Z.
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\
on macOS orCtrl+\
on Windows and Linux). - Toggle preview (
Shift+Cmd+V
on macOS orShift+Ctrl+V
on Windows and Linux). - Press
Ctrl+Space
(Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy!