zed
Generates a complete theme file for the Zed editor — a fast Rust-based collaborative code editor. The output is a single JSON file conforming to Zed's v0.2.0 theme schema, mapping tinct's semantic palette onto Zed's UI tokens, syntax highlighting, terminal ANSI block, and diff/diagnostic colours. Zed auto-discovers themes by directory and reloads the active theme live when its file changes on disk.
When tinct is run with both primary and alternate themes (--dual-theme), the plugin emits a single JSON file containing both variants inside the themes array. Zed displays them as separate entries in the theme picker.
Installation
Via the official plugin repository
tinct plugins install zed
Build from source
cd contrib/plugins/output/zed
go build -ldflags "-X main.Version=0.1.0" -o tinct-plugin-zed
install -m 0755 tinct-plugin-zed ~/.local/bin/
Verify
which tinct-plugin-zed
tinct-plugin-zed --plugin-info | jq .
The plugin uses tinct's go-plugin RPC protocol and is discovered automatically once it's on $PATH.
Quick start
tinct generate -i image -p ~/Pictures/wallpaper.jpg -o zed
Generated files
| File | Path | Role |
|---|---|---|
tinct.json | ~/.config/zed/themes/tinct.json | Complete Zed theme — UI tokens, syntax highlighting, terminal ANSI block, diff/diagnostic colours. Wrapped in Zed's v0.2.0 themes array. |
The plugin auto-detects Zed's config directory at both ~/.config/zed/themes (native) and ~/.var/app/dev.zed.Zed/config/zed/themes (Flatpak), writing to whichever exists. If both exist, both get the theme.
Integration
No manual configuration required to make the theme available. Zed scans ~/.config/zed/themes/ on startup and watches it for changes. Generating the theme is enough to make it appear in Zed's theme picker.
To activate it, choose one:
Via the command palette (recommended)
Press Cmd+Shift+P (macOS) / Ctrl+Shift+P (Linux), then run:
theme selector: toggle
then select Tinct from the list.
Via Zed's settings file
$EDITOR ~/.config/zed/settings.json
{
"theme": "Tinct"
}
For dual-theme mode, point both light and dark slots:
{
"theme": {
"mode": "system",
"light": "Tinct LIGHT",
"dark": "Tinct DARK"
}
}
Reload behaviour
Automatic
Zed watches its themes directory and reloads the active theme live when its file changes. After the initial selection, regenerating with tinct propagates immediately to any running Zed window — no restart, no re-selection.
Manual fallback
If a regeneration doesn't appear:
- Confirm Zed has the theme selected (
grep theme ~/.config/zed/settings.json). - Reload the theme manually via the command palette:
theme selector: toggle→ select Tinct again. - Restart Zed if all else fails.
Uninstall / revert
-
Remove the config line from
~/.config/zed/settings.jsonif you set"theme": "Tinct"— pick a different theme, or remove the key to fall back to Zed's default:$EDITOR ~/.config/zed/settings.json -
Delete the generated file:
rm ~/.config/zed/themes/tinct.json# also remove from Flatpak install if present:rm -f ~/.var/app/dev.zed.Zed/config/zed/themes/tinct.json -
Reload: Zed picks up the file deletion live via its themes-dir watcher. If the active theme was Tinct, Zed will switch to its default — re-select your preferred theme via the command palette.
-
External state: this plugin only writes to Zed's
themes/directory. To also remove the plugin binary:tinct plugins uninstall zed# or, for a source build:rm ~/.local/bin/tinct-plugin-zed
Flags
| Flag | Default | Description |
|---|---|---|
--zed.output-dir / -o | auto-detected (~/.config/zed/themes) | Override the output directory |
Colour role mapping
Zed's v0.2.0 theme schema is large — ~100 tokens covering editor chrome, syntax, terminal, diagnostics, diffs, and Git status. Selected mappings:
UI chrome
| Zed token | Tinct role |
|---|---|
background | background |
surface.background / elevated_surface.background | surface |
element.background | surfaceContainer |
element.hover | surfaceContainerHigh |
element.active / element.selected | surfaceContainerHighest |
border | outline |
border.variant | outlineVariant |
border.focused | accent1 |
border.disabled | borderMuted |
text | foreground |
text.muted | foregroundMuted |
text.accent | accent1 |
panel.background / tab_bar.background | surfaceContainerLowest |
tab.active_background / toolbar.background | surfaceContainerLow |
Diagnostics & status
| Zed token | Tinct role |
|---|---|
error | danger |
warning | warning |
success | success |
info / hint | info |
Terminal ANSI
All 16 ANSI colours (terminal.ansi.black–white and bright_*) use tinct's perceptual ANSI matcher so terminal output sits close to standard expectations regardless of palette source.
Syntax highlighting
| Zed token | Tinct role |
|---|---|
comment | foregroundMuted (italic) |
keyword | accent4 |
function | accent1 |
string | success |
type | accent2 |
constant | accent3 |
operator | onSurface |
variable | foreground |
Customising the template
mkdir -p ~/.config/tinct/templates/zed
tinct plugins templates dump -o zed -l ~/.config/tinct/templates/zed
$EDITOR ~/.config/tinct/templates/zed/theme.json.tmpl
Tinct prefers your version over the embedded default. See the templating reference for available functions.
Troubleshooting
Plugin skipped: "Zed not installed (config directory does not exist)"
ls ~/.config/zed 2>/dev/null
ls ~/.var/app/dev.zed.Zed/config/zed 2>/dev/null
The plugin requires either the native or Flatpak Zed config directory to exist. If you've installed Zed in a non-standard location, pass --zed.output-dir explicitly.
Theme not appearing in Zed's picker
ls -l ~/.config/zed/themes/tinct.json
jq '.themes[].name' ~/.config/zed/themes/tinct.json
If the file exists and is valid JSON, the picker scans on each toggle — open theme selector: toggle again. If the file is missing, the plugin was skipped: run with --verbose to see detection logs.
JSON parse errors in Zed
jq . ~/.config/zed/themes/tinct.json
A template syntax error from a custom override is the usual cause. Remove the override or fix it; if you didn't customise the template, file an issue with the verbose output.