本文へ移動

ツール

Editor themes

これらのページは英語です。仕様は一つの言語で保つことで、一つのことだけを語ります。

The T0 Editor's colour schemes are JSON files. Thirty-four ship with TTT (Midnight, the default; Fleet Dark; T0 Brand; Gruber Darker; Darcula; Solarized Osaka; Gruvbox Darker and Dark; Dracula; One Dark; Tokyo Night and Storm; Nord; Monokai; Catppuccin Mocha and Macchiato; Rosé Pine and Moon; Everforest; Kanagawa; Ayu Dark and Mirage; Night Owl; Material Palenight; GitHub Dark Dimmed; Solarized Dark; Zenburn; Cobalt2; Synthwave '84; Horizon; Oceanic Next; Nightfox; Moonlight; VS Code Dark+), and you can add your own.

Choosing and loading#

  • View ▸ Color Theme… opens the command palette on the themes; type to narrow, Enter to apply. The choice is remembered.
  • Your files go in ~/.config/ttt/t0/themes/ ($XDG_CONFIG_HOME/ttt/t0/themes/), one scheme per *.json file. They are read when the terminal starts and when you choose View ▸ Reload Themes.
  • View ▸ Export Current Theme writes the scheme in force into that folder with every colour spelled out: the easiest way to start. Change the name (a file with the name of a shipped theme replaces it) and the colours, then Reload Themes.
  • A file that cannot be used (bad JSON, a misspelt key, a colour that is not a colour) is skipped and the first problem is shown in the editor's status line. The rest still load.

The format#

{
  "name": "My Theme",
  "colors": { "editor": "#1D2021", "text": "#EBDBB2", "accent": "#FE8019" },
  "syntax": { "keyword": "#FB4934", "string": "#B8BB26", "comment": "#928374" }
}

A colour is #RRGGBB, or #RRGGBBAA (the alpha matters for found and found_current). Keys this document does not list are an error. Only name, colors.editor, colors.text and colors.accent are required; everything else is worked out when missing:

key when missing
colors.activity the editor mixed 30 % toward black
colors.sidebar the editor mixed 3.5 % toward white
colors.panel sidebar
colors.tabs, colors.status activity
colors.hairline / colors.raised the editor mixed 12 % / 7 % toward white
colors.text_dim / text_faint / fog the text mixed 30 % / 52 % / 68 % toward the editor
colors.on_accent near-black or white, whichever reads better on the accent
colors.error warning info success red #F85149, amber #D29922, blue #58A6FF, green #3FB950
syntax.keyword the accent
syntax.contextual (namespaces, functions) colors.info
syntax.type, syntax.number colors.warning
syntax.string colors.success
syntax.comment colors.text_faint
syntax.punctuation colors.text_dim
syntax.text / error / warning colors.text / error / warning
syntax.found / found_current the warning at 25 % / the accent at 44 % opacity

Surfaces are written for dark schemes: hovers and indent guides are white at low opacity, so a light scheme will look wrong in places.

The shipped schemes are held to a legibility floor by a test (code colours 4.5:1 against their editor, comments 3.5:1, text 7:1); yours are not checked.