Introduction to Zed Themes and Customization
Zed is a high-performance, multiplayer code editor built in Rust by the creators of Atom. One of its standout features is the deep customization system that allows developers to tailor the editor's appearance and behavior to their exact preferences. Whether you want a minimalist dark theme for late-night coding sessions or a vibrant color scheme that highlights syntax with surgical precision, Zed's theming engine has you covered.
In this complete guide, we'll explore everything from installing pre-built themes to crafting your own custom theme from scratch, configuring the editor's UI, and applying best practices that keep your setup maintainable and portable across machines.
What Are Zed Themes?
A Zed theme is a JSON-formatted configuration file that defines the visual appearance of the editor. Themes control syntax highlighting colors, UI element colors (such as the status bar, panels, and tabs), and various stylistic attributes like opacity and contrast. Zed themes are structured to separate the theme definition (colors and styles) from the editor configuration (keybindings, fonts, and behavior).
Themes in Zed are composed of several key components:
- Syntax highlighting — colors assigned to tokens like keywords, strings, functions, and comments.
- UI elements — backgrounds, borders, and text colors for panels, tabs, the status bar, and modals.
- Accents — highlight colors used for selections, active lines, and search matches.
- Style variants — most themes ship both a light and dark variant.
Why Theme Customization Matters
Customizing your editor is not just about aesthetics. A well-tuned theme directly impacts productivity and comfort:
- Reduced eye strain — proper contrast and color choices prevent fatigue during long sessions.
- Faster code scanning — distinct syntax colors help your brain parse structure at a glance.
- Fewer errors — highlighting mismatches, unused variables, and errors with clear colors catches bugs earlier.
- Personal ownership — a personalized environment fosters focus and flow.
- Team consistency — sharing a theme file ensures a uniform experience across pair-programming sessions.
Installing and Switching Themes
Using Built-in Themes
Zed ships with several built-in themes. The fastest way to switch is through the command palette. Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Linux) and type theme selector. You can also toggle between light and dark variants with Cmd+K Cmd+T.
Installing Community Themes via Extensions
Zed has a growing extension marketplace. To install a community theme:
- Open the command palette and search for
zed: extensions. - Browse or search for the theme you want.
- Click Install.
- Activate it through the theme selector.
Setting a Theme in Your Configuration
You can pin your preferred theme in the settings.json file. Open it with Cmd+, and add the following:
{
"theme": {
"mode": "system",
"light": "One Light",
"dark": "One Dark"
}
}
The mode field accepts "system", "light", or "dark". When set to "system", Zed follows your OS appearance setting and switches between the specified light and dark themes automatically.
Creating a Custom Theme
Theme File Location
Custom themes live in your Zed configuration directory. On macOS, this is ~/.config/zed/themes/. On Linux, it is typically ~/.config/zed/themes/ as well. Create the themes directory if it does not exist, then add a JSON file named after your theme, for example my-theme.json.
Basic Theme Structure
Here is a minimal custom theme that defines both a dark and light variant:
{
"$schema": "https://zed.dev/schema/themes.json",
"name": "My Custom Theme",
"author": "Your Name",
"themes": [
{
"name": "My Custom Theme Dark",
"appearance": "dark",
"style": {
"background": "#1e1e2e",
"foreground": "#cdd6f4",
"syntax": {
"keyword": "#cba6f7",
"function": "#89b4fa",
"string": "#a6e3a1",
"comment": "#6c7086",
"variable": "#f38ba8",
"constant": "#fab387",
"type": "#f9e2af"
},
"players": [
{
"cursor": "#f5e0dc",
"selection": "#45475a",
"background": "#1e1e2e"
}
],
"status_bar": {
"background": "#181825",
"foreground": "#cdd6f4"
},
"panel": {
"background": "#181825",
"foreground": "#cdd6f4"
},
"tab": {
"background": "#181825",
"foreground": "#a6adc8",
"active_background": "#1e1e2e",
"active_foreground": "#cdd6f4"
}
}
},
{
"name": "My Custom Theme Light",
"appearance": "light",
"style": {
"background": "#eff1f5",
"foreground": "#4c4f69",
"syntax": {
"keyword": "#8839ef",
"function": "#1e66f5",
"string": "#40a02b",
"comment": "#9ca0b0",
"variable": "#d20f39",
"constant": "#fe640b",
"type": "#df8e1d"
},
"players": [
{
"cursor": "#dc8a78",
"selection": "#bcc0cc",
"background": "#eff1f5"
}
]
}
}
]
}
Once saved, your theme appears in the theme selector. Select it to apply it immediately.
Understanding the Style Schema
The style object is the heart of a theme. Here are the most important keys:
backgroundandforeground— the base editor canvas colors.syntax— a map of syntax token types to colors.players— an array defining cursor, selection, and multiplayer participant colors.status_bar,panel,tab,border,editor— UI component overrides.search— colors for match highlighting.repl— colors for the REPL pane if you use it.
Advanced Syntax Highlighting
Zed supports a rich set of syntax token categories. Here is a more detailed syntax block:
"syntax": {
"keyword": "#cba6f7",
"function": {
"color": "#89b4fa",
"font_style": "italic"
},
"string": {
"color": "#a6e3a1",
"font_weight": 400
},
"comment": {
"color": "#6c7086",
"font_style": "italic"
},
"variable": "#f38ba8",
"variable.special": "#f5c2e7",
"constant": "#fab387",
"constant.builtin": "#f9e2af",
"type": "#f9e2af",
"type.builtin": "#89dceb",
"constructor": "#f5c2e7",
"punctuation": "#9399b2",
"operator": "#89dceb",
"tag": "#f38ba8",
"attribute": "#f9e2af",
"number": "#fab387",
"boolean": "#fab387",
"property": "#cdd6f4",
"module": "#89b4fa",
"error": "#f38ba8",
"warning": "#f9e2af"
}
Notice that each token can be either a simple color string or an object with color, font_style, and font_weight properties, giving you fine-grained typographic control.
Customizing the Editor Beyond Themes
Font and Typography
Zed lets you configure font family, size, and line height in settings.json:
{
"buffer_font_family": "JetBrains Mono",
"buffer_font_size": 14,
"buffer_font_weight": 450,
"buffer_line_height": {
"custom": 1.6
},
"ui_font_family": "Inter",
"ui_font_size": 14
}
Separating buffer (code) and UI fonts lets you use a highly legible monospace font for code while keeping the interface clean with a proportional font.
Editor Behavior and Appearance
Here are some commonly customized editor settings:
{
"cursor_blink": "on",
"cursor_shape": "bar",
"current_line_highlight": "all",
"gutter": {
"line_numbers": true,
"code_actions": true,
"folds": true
},
"scroll_beyond_last_line": "off",
"tab_size": 2,
"hard_tabs": false,
"preferred_line_length": 100,
"soft_wrap": "preferred_line_length",
"show_whitespaces": "selection",
"indent_guides": {
"enabled": true,
"coloring": "indent_aware"
}
}
Customizing the Status Bar and Tabs
You can control the visibility and behavior of UI chrome:
{
"status_bar": {
"show_active_branch": true,
"show_diagnostics": true,
"show_workspace_name": true
},
"tabs": {
"file_icons": true,
"git_status": true,
"show_close_button": "always",
"activate_on_close": "neighbour"
}
}
Vim Mode and Keybindings
Zed has first-class Vim emulation. Enable it and customize keybindings in ~/.config/zed/keymap.json:
{
"vim_mode": true,
"vim": {
"use_system_clipboard": "always",
"toggle_relative_line_numbers": true
}
}
For custom keybindings, the keymap file uses a context-aware format:
[
{
"context": "Editor && vim_mode == normal",
"bindings": {
"space f": "file_finder::Toggle",
"space g": "git::Toggle",
"space t": "terminal_panel::Toggle"
}
},
{
"context": "Editor",
"bindings": {
"ctrl-d": "editor::DuplicateLineDown",
"ctrl-shift-up": "editor::MoveLineUp"
}
}
]
Sharing and Distributing Themes
Packaging as an Extension
To share your theme with the community, package it as a Zed extension. Create a directory with the following structure:
my-theme-extension/
├── extension.toml
├── themes/
│ └── my-theme.json
└── README.md
The extension.toml file describes the extension:
id = "my-theme"
name = "My Custom Theme"
version = "0.1.0"
schema_version = 1
description = "A warm, low-contrast theme for focused coding."
authors = ["Your Name <you@example.com>"]
repository = "https://github.com/you/zed-my-theme"
themes = ["themes/my-theme.json"]
Once published to the Zed extension registry, users can install your theme directly from the extensions panel.
Version Control Your Configuration
Keep your ~/.config/zed/ directory in a dotfiles repository. This makes your theme and settings portable and version-controlled. A common pattern is to symlink the config directory to a checked-out repository:
# From your home directory
mv ~/.config/zed ~/dotfiles/zed
ln -s ~/dotfiles/zed ~/.config/zed
Best Practices
Design for Readability First
Avoid using more than 5–7 distinct syntax colors. Too many colors create visual noise and make it harder to distinguish token types. Group related concepts: for example, use one hue for all keywords and another for all types.
Maintain Sufficient Contrast
Follow WCAG contrast guidelines. Aim for at least 4.5:1 contrast between text and background for normal text. Comments are often dimmed, but they should still be readable — never drop below 3:1.
Always Ship Both Variants
If you publish a theme, include both light and dark appearances. Users who rely on automatic OS switching will appreciate a seamless experience.
Test Across Languages
Syntax highlighting varies by language. Test your theme against JavaScript, Python, Rust, Go, HTML, CSS, and JSON to ensure token coverage looks consistent. Pay special attention to less common tokens like attribute, constructor, and module.
Use the Schema for Validation
Always include the $schema key at the top of your theme file. This enables autocomplete and validation in Zed itself, catching typos and invalid color values before you reload.
Keep Settings and Themes Separate
Do not conflate editor behavior settings with theme definitions. Themes should be purely visual. Behavioral preferences like tab size, soft wrap, and keybindings belong in settings.json and keymap.json. This separation keeps your config modular and makes themes shareable without dragging along personal workflow preferences.
Leverage Alpha and Opacity Thoughtfully
Zed supports alpha channels in colors using 8-digit hex codes (e.g., #1e1e2ecc). Use subtle transparency for selections and overlays to create depth, but avoid making text backgrounds translucent, which harms readability.
Conclusion
Zed's theming and customization system strikes a rare balance between simplicity and power. With a single JSON file, you can redefine the entire visual identity of your editor, while the broader settings and keymap files give you granular control over behavior and workflow. By understanding the theme schema, leveraging syntax token styling, and following best practices around contrast, portability, and separation of concerns, you can build a coding environment that is not only beautiful but genuinely enhances your productivity. Whether you stick with a community theme or craft your own from scratch, the key is to iterate: start simple, test across languages, and refine until the editor feels like an extension of your own thinking.