Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 underlined modifier is deprecated and only available for backwards compatibility. Its behavior is equivalent to setting underline.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:

ScopeMeaning
function.definitionFunction definition
function.declarationFunction declaration/signature without a known definition body
function.callFunction invocation
function.referenceReference to a function value
function.method.definitionMethod definition
function.method.declarationMethod declaration/signature without a known definition body
function.method.callMethod invocation
function.methodMethod 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

NameMeaning
attributeAttributes and decorators; markup tag attributes.
commentComments.
comment.blockBlock comments.
comment.errorError annotations in comments.
comment.hintHints in comments.
comment.infoInformational annotations in comments.
comment.lineLine comments.
comment.unusedIntentionally unused bindings and patterns.
comment.warningWarning annotations in comments.
constantNamed constants.
constant.characterCharacter literals.
constant.character.escapeEscape sequences.
constant.macroPreprocessor constants.
constant.numericNumeric literals.
constant.numeric.floatFloating-point literals.
constant.numeric.integerInteger literals.
constructorConstructors and record literals in value position.
diffVersion-control changes.
diff.deltaModifications.
diff.delta.conflictConflicts.
diff.delta.movedMoves and renames.
diff.minusDeletions.
diff.plusAdditions.
embeddedEmbedded expressions.
errorError severity.
functionFunctions, including references with no known occurrence role.
function.macroMacros.
function.methodMember functions and methods.
function.specialSpecial compiler or preprocessor functions.
hintHint severity.
infoInformation severity.
keywordLanguage keywords.
keyword.controlControl-flow keywords.
keyword.control.conditionalConditional keywords.
keyword.control.exceptionException-handling keywords.
keyword.control.importImport and export keywords.
keyword.control.repeatLoop keywords.
keyword.control.returnReturn keywords.
keyword.coroutineCoroutine and asynchronous control keywords.
keyword.directivePreprocessor directives.
keyword.functionFunction declaration keywords.
keyword.operatorWord operators.
keyword.storageStorage and declaration keywords.
keyword.storage.modifierStorage modifiers.
keyword.storage.modifier.mutMutability modifiers.
keyword.storage.modifier.refReference modifiers.
keyword.storage.typeType and binding declaration keywords.
labelLabels, including CSS selectors.
markupMarkup text.
markup.boldBold text.
markup.headingHeadings.
markup.heading.1Level 1 heading text.
markup.heading.2Level 2 heading text.
markup.heading.3Level 3 heading text.
markup.heading.4Level 4 heading text.
markup.heading.5Level 5 heading text.
markup.heading.6Level 6 heading text.
markup.heading.markerHeading markers.
markup.italicItalic text.
markup.linkLinks.
markup.link.labelLink reference labels.
markup.link.textLink descriptions.
markup.link.urlLink destinations.
markup.listLists.
markup.list.checkedChecked items.
markup.list.numberedOrdered lists.
markup.list.uncheckedUnchecked items.
markup.list.unnumberedUnordered lists.
markup.normalOrdinary rendered documentation.
markup.quoteQuotations.
markup.rawRaw text and code.
markup.raw.blockCode blocks.
markup.raw.inlineInline code.
markup.strikethroughStrikethrough text.
markup.underlineUnderlined text.
namespaceNamespaces, packages and modules.
operatorSymbolic operators.
operator.controlControl operators.
operator.specialLanguage-specific operators.
punctuationPunctuation.
punctuation.bracketBrackets and parentheses.
punctuation.delimiterSeparators and delimiters.
punctuation.specialInterpolation and other special punctuation.
specialLegacy language-specific syntax.
stringString literals.
string.codeCode strings.
string.regexpRegular expressions.
string.specialSpecial string literals.
string.special.formatFormatting placeholders.
string.special.pathPaths.
string.special.subscriptSubscript text.
string.special.superscriptSuperscript text.
string.special.symbolAtoms and symbols.
string.special.urlURLs.
tagMarkup tags.
tag.delimiterMarkup tag delimiters.
tag.specialSpecial markup tags.
typeTypes.
type.aliasType aliases.
type.classClasses.
type.enumEnumeration types.
type.enum.variantEnumeration variants.
type.interfaceInterfaces.
type.parameterGeneric type parameters.
type.structStructs and records.
type.traitTraits.
type.unionUnions.
variableVariables.
variable.otherOther variable-like identifiers.
variable.other.memberFields and member properties.
variable.parameterFunction and method parameters.
variable.specialLanguage-specific variables.
warningWarning severity.

Occurrence roles and traits

NameMeaning
declarationA symbol declaration or signature without a known definition body.
definitionA symbol definition.
referenceA symbol reference that is not classified more specifically.
callAn invocation, rather than a reference to a callable value.
modificationA write to a symbol.
builtinA language or standard-library symbol.
booleanA built-in boolean constant.
mutableA mutable binding.
readonlyA read-only binding or member.
publicPublic or exported visibility.
privatePrivate visibility.
staticA static member.
asyncAn asynchronous callable.
abstractAn abstract symbol.
deprecatedA deprecated symbol.
documentationDocumentation text or a symbol occurrence in documentation.
specialA language-specific specialization.

Interface scopes

NameMeaning
diagnosticDiagnostics fallback style (editing area)
diagnostic.deprecatedDiagnostics with deprecated tag (editing area)
diagnostic.errorDiagnostics error (editing area)
diagnostic.hintDiagnostics hint (editing area)
diagnostic.infoDiagnostics info (editing area)
diagnostic.spellingSpelling diagnostics in the editing area (falls back to the hint diagnostic style).
diagnostic.unnecessaryDiagnostics with unnecessary tag (editing area)
diagnostic.warningDiagnostics warning (editing area)
markup.heading.completionRendered completion documentation.
markup.heading.hoverRendered hover documentation.
markup.normal.completionRendered completion documentation.
markup.normal.hoverRendered hover documentation.
markup.raw.inline.completionRendered completion documentation.
markup.raw.inline.hoverRendered hover documentation.
tabstopSnippet placeholder
ui.backgroundEditor interface style.
ui.background.separatorPicker separator below input line
ui.borderPanel and popup borders; falls back to ui.text
ui.breadcrumbBreadcrumb bar
ui.breadcrumb.separatorSeparator between breadcrumb segments
ui.bufferlineStyle for the buffer line
ui.bufferline.activeStyle for the active buffer in buffer line
ui.bufferline.backgroundStyle for bufferline background
ui.bufferline.separatorSeparator between buffer tabs
ui.cursorEditor interface style.
ui.cursor.insertEditor interface style.
ui.cursor.matchMatching bracket etc.
ui.cursor.normalEditor interface style.
ui.cursor.primaryCursor with main selection
ui.cursor.primary.insertEditor interface style.
ui.cursor.primary.normalEditor interface style.
ui.cursor.primary.selectEditor interface style.
ui.cursor.selectEditor interface style.
ui.cursorcolumnFallback for cursor columns.
ui.cursorcolumn.primaryThe column of the primary cursor (if cursorcolumn is enabled)
ui.cursorcolumn.secondaryThe columns of any other cursors (if cursorcolumn is enabled)
ui.cursorlineFallback for cursor lines.
ui.cursorline.primaryThe line of the primary cursor (if cursorline is enabled)
ui.cursorline.secondaryThe lines of any other cursors (if cursorline is enabled)
ui.debugFallback for debugger indicators.
ui.debug.activeIndicator for the line at which debugging execution is paused at, found in the gutter
ui.debug.breakpointBreakpoint indicator, found in the gutter
ui.diagnostic.inline.errorInline error diagnostic text.
ui.diagnostic.inline.hintInline hint diagnostic text.
ui.diagnostic.inline.infoInline info diagnostic text.
ui.diagnostic.inline.warningInline warning diagnostic text.
ui.gutterGutter
ui.gutter.selectedGutter for the line the cursor is on
ui.helpDescription box for commands
ui.highlightHighlighted lines in the picker preview
ui.highlight.framelineLine at which debugging execution is paused at
ui.highlight.symbolReferences to the symbol at the cursor; defaults to a subtle selection tint, or bold text when colors cannot be blended.
ui.linenrLine numbers
ui.linenr.selectedLine number for the line the cursor is on
ui.linkNavigable links in the document.
ui.menuCode and command completion menus
ui.menu.scrollfg sets thumb color, bg sets track color of scrollbar
ui.menu.selectedSelected autocomplete item
ui.pickerFallback for picker interface styles.
ui.picker.headerHeader row area in pickers with multiple columns
ui.picker.header.columnColumn names in pickers with multiple columns
ui.picker.header.column.activeThe column name in pickers with multiple columns where the cursor is entering into.
ui.picker.matchMatching text in pickers and the file explorer; falls back to special.
ui.popupDocumentation popups (e.g. Space k)
ui.popup.infoPrompt for multiple key options
ui.selectionFor selections in the editing area
ui.selection.primaryEditor interface style.
ui.statuslineStatusline
ui.statusline.inactiveStatusline (unfocused document)
ui.statusline.insertStatusline mode during insert mode (only if editor.statusline.mode.color is enabled)
ui.statusline.normalStatusline mode during normal mode (only if editor.statusline.mode.color is enabled)
ui.statusline.selectStatusline mode during select mode (only if editor.statusline.mode.color is enabled)
ui.statusline.separatorSeparator text in the statusline
ui.textDefault text style, command prompts, panel titles, popup text, and fallback for panel borders
ui.text.directoryDirectory names in prompt completion
ui.text.focusThe currently selected line in the picker
ui.text.inactiveSame as ui.text but when the text is inactive (e.g. suggestions)
ui.text.infoThe key: command text in ui.popup.info boxes
ui.text.symlinkSymlink names in prompt completion
ui.virtualFallback for virtual text.
ui.virtual.code-lensEnd-of-line code lens labels; falls back to ui.virtual.inlay-hint
ui.virtual.conflict.baseOriginal version in a three-way conflict
ui.virtual.conflict.currentCurrent changes, opening marker, and label
ui.virtual.conflict.incomingIncoming changes, closing marker, and label
ui.virtual.debug-valueRuntime values beside source while debugging; falls back to ui.virtual.inlay-hint
ui.virtual.foldEllipsis representing folded text
ui.virtual.indent-guideVertical indent width guides
ui.virtual.inlay-hintDefault style for inlay hints of all kinds
ui.virtual.inlay-hint.parameterStyle for inlay hints of kind parameter (language servers are not required to set a kind)
ui.virtual.inlay-hint.typeStyle for inlay hints of kind type (language servers are not required to set a kind)
ui.virtual.inline-blameInline blame indicator (see the editor.inline-blame config)
ui.virtual.inline-completionLSP ghost text; falls back to ui.virtual.inlay-hint
ui.virtual.jump-labelStyle for virtual jump labels
ui.virtual.rulerbg for background rulers; fg for glyph rulers, falling back to bg (see editor.rulers)
ui.virtual.trailing_whitespaceTrailing whitespace; falls back to ui.virtual.whitespace
ui.virtual.whitespaceVisible whitespace characters
ui.virtual.wrapSoft-wrap indicator (see the editor.soft-wrap config)
ui.windowBorderlines separating splits
diff.plus.gutterPlus gutter style.
diff.plus.linePlus line style.
diff.plus.wordPlus word style.
diff.minus.gutterMinus gutter style.
diff.minus.lineMinus line style.
diff.minus.wordMinus word style.
diff.delta.gutterDelta gutter style.
ui.welcome.headingWelcome-screen heading; falls back to special.
ui.welcome.commandWelcome-screen command examples; falls back to constant.