Deals with https://github.com/zed-industries/zed/issues/5259 Highlights brackets with different colors based on their depth. Uses existing tree-sitter queries from brackets.scm to find brackets, uses theme's accents to color them. https://github.com/user-attachments/assets/cc5f3aba-22fa-446d-9af7-ba6e772029da 1. Adds `colorize_brackets` language setting that allows, per language or globally for all languages, to configure whether Zed should color the brackets for a particular language. Disabled for all languages by default. 2. Any given language can opt-out a certain bracket pair by amending the brackets.scm like `("\"" @open "\"" @close) ` -> `(("\"" @open "\"" @close) (#set! rainbow.exclude))` 3. Brackets are using colors from theme accents, which can be overridden as ```jsonc "theme_overrides": { "One Dark": { "accents": ["#ff69b4", "#7fff00", "#ff1493", "#00ffff", "#ff8c00", "#9400d3"] } }, ``` Release Notes: - Added bracket colorization (rainbow brackets) support. Use `colorize_brackets` language setting to enable. --------- Co-authored-by: MrSubidubi <dev@bahn.sh> Co-authored-by: Lukas Wirth <lukas@zed.dev> Co-authored-by: MrSubidubi <finn@zed.dev> Co-authored-by: Lukas Wirth <me@lukaswirth.dev> Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
83 lines
2.9 KiB
Markdown
83 lines
2.9 KiB
Markdown
# Themes
|
|
|
|
Zed comes with a number of built-in themes, with more themes available as extensions.
|
|
|
|
## Selecting a Theme
|
|
|
|
See what themes are installed and preview them via the Theme Selector, which you can open from the command palette with `theme selector: toggle` (bound to {#kb theme_selector::Toggle}).
|
|
|
|
Navigating through the theme list by moving up and down will change the theme in real time and hitting enter will save it to your settings file.
|
|
|
|
## Installing more Themes
|
|
|
|
More themes are available from the Extensions page, which you can access via the command palette with `zed: extensions` or the [Zed website](https://zed.dev/extensions?filter=themes).
|
|
|
|
Many popular themes have been ported to Zed, and if you're struggling to choose one, visit [zed-themes.com](https://zed-themes.com), a third-party gallery with visible previews for many of them.
|
|
|
|
## Configuring a Theme
|
|
|
|
Your selected theme is stored in your settings file.
|
|
You can open your settings file from the command palette with {#action zed::OpenSettingsFile} (bound to {#kb zed::OpenSettingsFile}).
|
|
|
|
By default, Zed maintains two themes: one for light mode and one for dark mode.
|
|
You can set the mode to `"dark"` or `"light"` to ignore the current system mode.
|
|
|
|
```json [settings]
|
|
{
|
|
"theme": {
|
|
"mode": "system",
|
|
"light": "One Light",
|
|
"dark": "One Dark"
|
|
}
|
|
}
|
|
```
|
|
|
|
## Theme Overrides
|
|
|
|
To override specific attributes of a theme, use the `theme_overrides` setting.
|
|
This setting can be used to configure theme-specific overrides.
|
|
|
|
For example, add the following to your `settings.json` if you wish to override the background color of the editor and display comments and doc comments as italics:
|
|
|
|
```json [settings]
|
|
{
|
|
"theme_overrides": {
|
|
"One Dark": {
|
|
"editor.background": "#333",
|
|
"syntax": {
|
|
"comment": {
|
|
"font_style": "italic"
|
|
},
|
|
"comment.doc": {
|
|
"font_style": "italic"
|
|
}
|
|
},
|
|
"accents": [
|
|
"#ff0000",
|
|
"#ff7f00",
|
|
"#ffff00",
|
|
"#00ff00",
|
|
"#0000ff",
|
|
"#8b00ff"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
To see a comprehensive list of list of captures (like `comment` and `comment.doc`) see [Language Extensions: Syntax highlighting](./extensions/languages.md#syntax-highlighting).
|
|
|
|
To see a list of available theme attributes look at the JSON file for your theme.
|
|
For example, [assets/themes/one/one.json](https://github.com/zed-industries/zed/blob/main/assets/themes/one/one.json) for the default One Dark and One Light themes.
|
|
|
|
## Local Themes
|
|
|
|
Store new themes locally by placing them in the `~/.config/zed/themes` directory (macOS and Linux) or `%USERPROFILE%\AppData\Roaming\Zed\themes\` (Windows).
|
|
|
|
For example, to create a new theme called `my-cool-theme`, create a file called `my-cool-theme.json` in that directory.
|
|
It will be available in the theme selector the next time Zed loads.
|
|
|
|
## Theme Development
|
|
|
|
See: [Developing Zed Themes](./extensions/themes.md)
|