Themes
To use a theme add theme = "<name>" to the top of your config.toml file, or select it during runtime using :theme <name>.
Without a configured theme, Mitos uses modus_operandi for light mode and
modus_vivendi for dark mode. If the terminal does not report a preference,
Mitos uses modus_vivendi. Terminals without true-color support use the
built-in ANSI default theme instead. To always use the terminal’s ANSI
palette, set theme = "default".
Separate themes can be configured for light and dark modes. On terminals supporting mode 2031 dark/light detection, the theme mode is detected from the terminal and updates when the terminal follows a system appearance change. On other terminals, Mitos uses the configured fallback theme, or the dark theme when no fallback is specified.
[theme]
dark = "modus_vivendi"
light = "modus_operandi"
## Optional. Used if the terminal doesn't declare a preference.
## Defaults to the theme set for `dark` if not specified.
# fallback = "modus_vivendi"
Creating a theme
Create a file with the name of your theme as the file name (i.e mytheme.toml) and place it in your themes directory (i.e ~/.config/mitos/themes or %AppData%\mitos\themes on Windows). The directory might have to be created beforehand.
💡 The names “default” and “base16_default” are reserved for built-in themes and cannot be overridden by user-defined themes.
Overview
Each line in the theme file is specified as below:
key = { fg = "#ffffff", bg = "#000000", underline = { color = "#ff0000", style = "curl"}, modifiers = ["bold", "italic"] }
Where key represents what you want to style, fg specifies the foreground color, bg the background color, underline the underline style/color, and modifiers is a list of style modifiers. bg, underline and modifiers can be omitted to defer to the defaults.
To specify only the foreground color:
# Valid hex-color format is `#RGB` or `#RRGGBB`
# (each letter is a nibble)
key = "#ffffff"
If the key contains a dot '.', it must be quoted to prevent it being parsed as a dotted key.
"key.key" = "#fff"
Color values must be either a CSS hex RGB string or a name declared in the palette.
💡 Note that Mitos doesn’t support transparency (alpha channel).
For inspiration, you can find the built-in ANSI theme base16_terminal.toml
here and
user-submitted themes
here.
Panel and popup borders
Use ui.border to style panel and popup borders, including file pickers and
documentation hovers, independently of their text:
"ui.text" = "#d8dee9"
"ui.border" = "#4c566a"
If ui.border is omitted, borders use ui.text. Split separators use
ui.window; internal separators retain their own theme scopes.
Border shapes and visibility are controlled by the
border configuration.
The details of theme creation
Color palettes
It’s recommended to define a palette of named colors, and refer to them in the
configuration values in your theme. To do this, add a table called
palette to your theme file:
"ui.background" = "white"
"ui.text" = "black"
[palette]
white = "#ffffff"
black = "#000000"
Keep in mind that the [palette] table includes all keys after its header,
so it should be defined after the normal theme options.
The default palette uses the terminal’s default 16 colors, and the colors names
are listed below. The [palette] section in the config file takes precedence
over it and is merged into the default palette.
| Color Name |
|---|
default |
black |
red |
green |
yellow |
blue |
magenta |
cyan |
gray |
light-red |
light-green |
light-yellow |
light-blue |
light-magenta |
light-cyan |
light-gray |
white |
Modifiers
The following values may be used as modifier, provided they are supported by your terminal emulator.
| Modifier |
|---|
bold |
dim |
italic |
underlined |
slow_blink |
rapid_blink |
reversed |
hidden |
crossed_out |
💡 The
underlinedmodifier is deprecated and only available for backwards compatibility. Its behavior is equivalent to settingunderline.style="line".
Underline style
One of the following values may be used as a value for underline.style, providing it is
supported by your terminal emulator.
| Modifier |
|---|
none |
line |
curl |
dashed |
dotted |
double_line |
Inheritance
Extend other themes by setting the inherits property to an existing theme.
inherits = "modus_vivendi"
# Override the theming for "keyword"s:
"keyword" = { fg = "gold" }
# Override colors in the palette:
[palette]
gold = "#D4AF37"
Rainbow
The rainbow key is used for rainbow highlight for matching brackets.
The key is a list of styles.
rainbow = ["#ff0000", "#ffa500", "#fff000", { fg = "#00ff00", modifiers = ["bold"] }]
Colors from the palette and modifiers may be used.
Scopes
Syntax queries assign a kind, such as function.method, and optional
qualifiers, such as definition, public, or deprecated. Kinds form a
hierarchy; qualifiers describe independent roles or traits. For example,
function.method.public.definition identifies a public method definition.
Qualifier order does not affect theme matching.
Definitions, declarations, calls, and references are distinct:
| Scope | Meaning |
|---|---|
function.definition | Function definition |
function.declaration | Function declaration/signature without a known definition body |
function.call | Function invocation |
function.reference | Reference to a function value |
function.method.definition | Method definition |
function.method.declaration | Method declaration/signature without a known definition body |
function.method.call | Method invocation |
function.method | Method with an unspecified occurrence role |
A query may use a broader scope when syntax alone cannot establish the kind or
role. Calling pkg.name() does not necessarily establish whether pkg is a
package or a value. Passing a callable as an argument does not invoke it.
Language coverage varies with each grammar and query.
Style syntax with ordinary theme keys. Use * in place of the kind to match a
qualifier across kinds:
"function" = "blue"
"function.method" = "cyan"
"*.definition" = { modifiers = ["bold"] }
"*.deprecated" = { modifiers = ["crossed_out"] }
"*.documentation" = { modifiers = ["italic"] }
"function.method.public" = { modifiers = ["underlined"] }
"function.method.call" = "green"
These rules make public method definitions cyan, bold, and underlined; method
calls green; and deprecated symbols crossed out. Both
function.method.public.definition and function.method.definition.public
match the public-method and definition rules.
Matching syntax rules are applied from broad to specific. Specificity compares
kind depth first, then the number of qualifiers. Equally specific rules apply
in lexical order, with the later rule winning conflicting properties. An exact
combination can resolve a tie explicitly. Properties are merged: a bold-only
rule keeps the inherited foreground. More specific colors and underline
properties override broader ones; style modifiers combine. Use
remove-modifiers = ["bold"] to remove an inherited modifier, or
underline = { style = "none" } to remove inherited underlining.
This property inheritance applies to syntax styles, including markup and
diff syntax kinds. Interface keys keep their existing longest-prefix fallback
and do not merge parent properties. Theme-file inherits continues to replace
an explicitly overridden key, while merging palettes.
Existing keys such as function.public, function.method.private,
variable.parameter.mutable, and comment.block.documentation remain valid.
Custom scopes are accepted at runtime and retain prefix fallback. Bundled
queries and themes must use the public vocabulary below; the generated capture
inventory ensures every bundled classification can resolve composed rules.
Semantic highlighting
When enabled, a language server can refine syntax highlighting with resolved
symbol kinds and traits, such as type.class, variable.other.member.readonly,
or function.method.definition.deprecated. Syntax queries and semantic tokens
use the same theme selectors. Semantic styles are applied over syntax colors,
before selections, search matches, and diagnostics. An unspecified semantic
occurrence role preserves a call or reference already established by syntax.
Explicit semantic roles take precedence, except that a generic declaration
flag preserves a definition body established by syntax. Servers often mark
both declarations and definitions with that flag. Unstyled properties retain
the underlying syntax appearance.
Semantic highlighting is enabled by default. To disable it:
[editor.lsp.semantic-tokens]
enable = false
A language can exclude a particular server from semantic highlighting using
except-features = ["semantic-tokens"] in its language-servers entry. If
several servers support the feature, Mitos uses the first configured provider.
Full-document and range-only providers are supported. Requests are debounced
after edits. Tokens touched by an edit are cleared immediately, while other
tokens track their text until a fresh response arrives. Responses are discarded
when their document snapshot or server binding has changed. Unsupported server
extensions fall back to syntax highlighting. Delta updates and dynamic
semantic-token registration are not advertised.
Use variable.readonly and variable.other.member.readonly to style read-only
bindings and fields. Bundled themes define these rules explicitly.
A semantic token without a declaration or definition modifier is not assumed to be a call: it may be a reference to a callable value.
Independent interface and annotation colors
Use ui.picker.match for matching text in pickers and the file explorer.
Welcome-screen headings and command examples use ui.welcome.heading and
ui.welcome.command. Use comment.error, comment.warning, comment.info,
and comment.hint for annotations in comments. These settings let source
annotations and interface matches differ from diagnostics and language syntax.
Inline diagnostic text uses ui.diagnostic.inline.error, .warning, .info,
and .hint. Diagnostic underlines in the editing area use diagnostic.error,
diagnostic.warning, and related keys.
Changed words in syntax-highlighted diffs keep their syntax colors and are bold
by default. Use diff.plus.word and diff.minus.word to override that style.
Set a background or text modifier to preserve syntax foreground colors.
Automatic symbol references use ui.highlight.symbol. Bundled themes can use a
subdued background from their palette without changing syntax colors. Otherwise,
the default is a background halfway between the editor and primary selection
backgrounds, keeping selections distinct. Themes with terminal palette colors,
transparent backgrounds, or no distinct tint use bold text instead.
This style is independent of ui.highlight, which highlights picker preview
lines. Override it in your theme, or set it to {} to remove the decoration:
"ui.highlight.symbol" = { bg = "#e8edf5" }
Inspecting and validating scopes
Run :highlight-inspect to see syntax classifications, semantic refinement,
matching theme selectors, and resolved styles at the cursor. :tree-sitter-scopes shows syntax-tree node
names instead.
For contributors, cargo xtask scope-check checks bundled theme keys and query
captures against the registry. cargo xtask theme-check checks style values
and palettes. Run cargo xtask docgen after changing the registry or captures
to regenerate the reference and capture inventory.
Scope reference
The reference is generated from crates/theme/src/scopes/. Syntax kinds are
inspired by Helix and
Neovim;
independent roles and traits also map the standard
LSP semantic classifications.
Syntax kinds
| Name | Meaning |
|---|---|
attribute | Attributes and decorators; markup tag attributes. |
comment | Comments. |
comment.block | Block comments. |
comment.error | Error annotations in comments. |
comment.hint | Hints in comments. |
comment.info | Informational annotations in comments. |
comment.line | Line comments. |
comment.unused | Intentionally unused bindings and patterns. |
comment.warning | Warning annotations in comments. |
constant | Named constants. |
constant.character | Character literals. |
constant.character.escape | Escape sequences. |
constant.macro | Preprocessor constants. |
constant.numeric | Numeric literals. |
constant.numeric.float | Floating-point literals. |
constant.numeric.integer | Integer literals. |
constructor | Constructors and record literals in value position. |
diff | Version-control changes. |
diff.delta | Modifications. |
diff.delta.conflict | Conflicts. |
diff.delta.moved | Moves and renames. |
diff.minus | Deletions. |
diff.plus | Additions. |
embedded | Embedded expressions. |
error | Error severity. |
function | Functions, including references with no known occurrence role. |
function.macro | Macros. |
function.method | Member functions and methods. |
function.special | Special compiler or preprocessor functions. |
hint | Hint severity. |
info | Information severity. |
keyword | Language keywords. |
keyword.control | Control-flow keywords. |
keyword.control.conditional | Conditional keywords. |
keyword.control.exception | Exception-handling keywords. |
keyword.control.import | Import and export keywords. |
keyword.control.repeat | Loop keywords. |
keyword.control.return | Return keywords. |
keyword.coroutine | Coroutine and asynchronous control keywords. |
keyword.directive | Preprocessor directives. |
keyword.function | Function declaration keywords. |
keyword.operator | Word operators. |
keyword.storage | Storage and declaration keywords. |
keyword.storage.modifier | Storage modifiers. |
keyword.storage.modifier.mut | Mutability modifiers. |
keyword.storage.modifier.ref | Reference modifiers. |
keyword.storage.type | Type and binding declaration keywords. |
label | Labels, including CSS selectors. |
markup | Markup text. |
markup.bold | Bold text. |
markup.heading | Headings. |
markup.heading.1 | Level 1 heading text. |
markup.heading.2 | Level 2 heading text. |
markup.heading.3 | Level 3 heading text. |
markup.heading.4 | Level 4 heading text. |
markup.heading.5 | Level 5 heading text. |
markup.heading.6 | Level 6 heading text. |
markup.heading.marker | Heading markers. |
markup.italic | Italic text. |
markup.link | Links. |
markup.link.label | Link reference labels. |
markup.link.text | Link descriptions. |
markup.link.url | Link destinations. |
markup.list | Lists. |
markup.list.checked | Checked items. |
markup.list.numbered | Ordered lists. |
markup.list.unchecked | Unchecked items. |
markup.list.unnumbered | Unordered lists. |
markup.normal | Ordinary rendered documentation. |
markup.quote | Quotations. |
markup.raw | Raw text and code. |
markup.raw.block | Code blocks. |
markup.raw.inline | Inline code. |
markup.strikethrough | Strikethrough text. |
markup.underline | Underlined text. |
namespace | Namespaces, packages and modules. |
operator | Symbolic operators. |
operator.control | Control operators. |
operator.special | Language-specific operators. |
punctuation | Punctuation. |
punctuation.bracket | Brackets and parentheses. |
punctuation.delimiter | Separators and delimiters. |
punctuation.special | Interpolation and other special punctuation. |
special | Legacy language-specific syntax. |
string | String literals. |
string.code | Code strings. |
string.regexp | Regular expressions. |
string.special | Special string literals. |
string.special.format | Formatting placeholders. |
string.special.path | Paths. |
string.special.subscript | Subscript text. |
string.special.superscript | Superscript text. |
string.special.symbol | Atoms and symbols. |
string.special.url | URLs. |
tag | Markup tags. |
tag.delimiter | Markup tag delimiters. |
tag.special | Special markup tags. |
type | Types. |
type.alias | Type aliases. |
type.class | Classes. |
type.enum | Enumeration types. |
type.enum.variant | Enumeration variants. |
type.interface | Interfaces. |
type.parameter | Generic type parameters. |
type.struct | Structs and records. |
type.trait | Traits. |
type.union | Unions. |
variable | Variables. |
variable.other | Other variable-like identifiers. |
variable.other.member | Fields and member properties. |
variable.parameter | Function and method parameters. |
variable.special | Language-specific variables. |
warning | Warning severity. |
Occurrence roles and traits
| Name | Meaning |
|---|---|
declaration | A symbol declaration or signature without a known definition body. |
definition | A symbol definition. |
reference | A symbol reference that is not classified more specifically. |
call | An invocation, rather than a reference to a callable value. |
modification | A write to a symbol. |
builtin | A language or standard-library symbol. |
boolean | A built-in boolean constant. |
mutable | A mutable binding. |
readonly | A read-only binding or member. |
public | Public or exported visibility. |
private | Private visibility. |
static | A static member. |
async | An asynchronous callable. |
abstract | An abstract symbol. |
deprecated | A deprecated symbol. |
documentation | Documentation text or a symbol occurrence in documentation. |
special | A language-specific specialization. |
Interface scopes
| Name | Meaning |
|---|---|
diagnostic | Diagnostics fallback style (editing area) |
diagnostic.deprecated | Diagnostics with deprecated tag (editing area) |
diagnostic.error | Diagnostics error (editing area) |
diagnostic.hint | Diagnostics hint (editing area) |
diagnostic.info | Diagnostics info (editing area) |
diagnostic.spelling | Spelling diagnostics in the editing area (falls back to the hint diagnostic style). |
diagnostic.unnecessary | Diagnostics with unnecessary tag (editing area) |
diagnostic.warning | Diagnostics warning (editing area) |
markup.heading.completion | Rendered completion documentation. |
markup.heading.hover | Rendered hover documentation. |
markup.normal.completion | Rendered completion documentation. |
markup.normal.hover | Rendered hover documentation. |
markup.raw.inline.completion | Rendered completion documentation. |
markup.raw.inline.hover | Rendered hover documentation. |
tabstop | Snippet placeholder |
ui.background | Editor interface style. |
ui.background.separator | Picker separator below input line |
ui.border | Panel and popup borders; falls back to ui.text |
ui.breadcrumb | Breadcrumb bar |
ui.breadcrumb.separator | Separator between breadcrumb segments |
ui.bufferline | Style for the buffer line |
ui.bufferline.active | Style for the active buffer in buffer line |
ui.bufferline.background | Style for bufferline background |
ui.bufferline.separator | Separator between buffer tabs |
ui.cursor | Editor interface style. |
ui.cursor.insert | Editor interface style. |
ui.cursor.match | Matching bracket etc. |
ui.cursor.normal | Editor interface style. |
ui.cursor.primary | Cursor with main selection |
ui.cursor.primary.insert | Editor interface style. |
ui.cursor.primary.normal | Editor interface style. |
ui.cursor.primary.select | Editor interface style. |
ui.cursor.select | Editor interface style. |
ui.cursorcolumn | Fallback for cursor columns. |
ui.cursorcolumn.primary | The column of the primary cursor (if cursorcolumn is enabled) |
ui.cursorcolumn.secondary | The columns of any other cursors (if cursorcolumn is enabled) |
ui.cursorline | Fallback for cursor lines. |
ui.cursorline.primary | The line of the primary cursor (if cursorline is enabled) |
ui.cursorline.secondary | The lines of any other cursors (if cursorline is enabled) |
ui.debug | Fallback for debugger indicators. |
ui.debug.active | Indicator for the line at which debugging execution is paused at, found in the gutter |
ui.debug.breakpoint | Breakpoint indicator, found in the gutter |
ui.diagnostic.inline.error | Inline error diagnostic text. |
ui.diagnostic.inline.hint | Inline hint diagnostic text. |
ui.diagnostic.inline.info | Inline info diagnostic text. |
ui.diagnostic.inline.warning | Inline warning diagnostic text. |
ui.gutter | Gutter |
ui.gutter.selected | Gutter for the line the cursor is on |
ui.help | Description box for commands |
ui.highlight | Highlighted lines in the picker preview |
ui.highlight.frameline | Line at which debugging execution is paused at |
ui.highlight.symbol | References to the symbol at the cursor; defaults to a subtle selection tint, or bold text when colors cannot be blended. |
ui.linenr | Line numbers |
ui.linenr.selected | Line number for the line the cursor is on |
ui.link | Navigable links in the document. |
ui.menu | Code and command completion menus |
ui.menu.scroll | fg sets thumb color, bg sets track color of scrollbar |
ui.menu.selected | Selected autocomplete item |
ui.picker | Fallback for picker interface styles. |
ui.picker.header | Header row area in pickers with multiple columns |
ui.picker.header.column | Column names in pickers with multiple columns |
ui.picker.header.column.active | The column name in pickers with multiple columns where the cursor is entering into. |
ui.picker.match | Matching text in pickers and the file explorer; falls back to special. |
ui.popup | Documentation popups (e.g. Space k) |
ui.popup.info | Prompt for multiple key options |
ui.selection | For selections in the editing area |
ui.selection.primary | Editor interface style. |
ui.statusline | Statusline |
ui.statusline.inactive | Statusline (unfocused document) |
ui.statusline.insert | Statusline mode during insert mode (only if editor.statusline.mode.color is enabled) |
ui.statusline.normal | Statusline mode during normal mode (only if editor.statusline.mode.color is enabled) |
ui.statusline.select | Statusline mode during select mode (only if editor.statusline.mode.color is enabled) |
ui.statusline.separator | Separator text in the statusline |
ui.text | Default text style, command prompts, panel titles, popup text, and fallback for panel borders |
ui.text.directory | Directory names in prompt completion |
ui.text.focus | The currently selected line in the picker |
ui.text.inactive | Same as ui.text but when the text is inactive (e.g. suggestions) |
ui.text.info | The key: command text in ui.popup.info boxes |
ui.text.symlink | Symlink names in prompt completion |
ui.virtual | Fallback for virtual text. |
ui.virtual.code-lens | End-of-line code lens labels; falls back to ui.virtual.inlay-hint |
ui.virtual.conflict.base | Original version in a three-way conflict |
ui.virtual.conflict.current | Current changes, opening marker, and label |
ui.virtual.conflict.incoming | Incoming changes, closing marker, and label |
ui.virtual.debug-value | Runtime values beside source while debugging; falls back to ui.virtual.inlay-hint |
ui.virtual.fold | Ellipsis representing folded text |
ui.virtual.indent-guide | Vertical indent width guides |
ui.virtual.inlay-hint | Default style for inlay hints of all kinds |
ui.virtual.inlay-hint.parameter | Style for inlay hints of kind parameter (language servers are not required to set a kind) |
ui.virtual.inlay-hint.type | Style for inlay hints of kind type (language servers are not required to set a kind) |
ui.virtual.inline-blame | Inline blame indicator (see the editor.inline-blame config) |
ui.virtual.inline-completion | LSP ghost text; falls back to ui.virtual.inlay-hint |
ui.virtual.jump-label | Style for virtual jump labels |
ui.virtual.ruler | bg for background rulers; fg for glyph rulers, falling back to bg (see editor.rulers) |
ui.virtual.trailing_whitespace | Trailing whitespace; falls back to ui.virtual.whitespace |
ui.virtual.whitespace | Visible whitespace characters |
ui.virtual.wrap | Soft-wrap indicator (see the editor.soft-wrap config) |
ui.window | Borderlines separating splits |
diff.plus.gutter | Plus gutter style. |
diff.plus.line | Plus line style. |
diff.plus.word | Plus word style. |
diff.minus.gutter | Minus gutter style. |
diff.minus.line | Minus line style. |
diff.minus.word | Minus word style. |
diff.delta.gutter | Delta gutter style. |
ui.welcome.heading | Welcome-screen heading; falls back to special. |
ui.welcome.command | Welcome-screen command examples; falls back to constant. |