Syntax colours
Development reference · View source
syntax maps highlight scopes to colours:
themes:
midnight:
syntax:
keyword: "#b48ead"
string: "#a3be8c"
markup.heading: "#88c0d0"
Code scopes: attribute, comment, constant, constructor,
function, keyword, label, namespace, number, operator, property,
punctuation, string, tag, type, and variable.
Markdown scopes: markup.heading, markup.bold, markup.italic,
markup.link.text, markup.link.url, markup.list, markup.quote,
markup.raw, and markup.strikethrough.
Diagnostic scopes: diagnostic.error and diagnostic.warning.
- An omitted scope uses the theme’s
foreground, exceptdiagnostic.erroranddiagnostic.warning, which useerrorandwarning. - An unknown scope name is a configuration error, not silently ignored.
- Tree-sitter captures use the longest scope that prefixes them, so
keyword.control.returntakes thekeywordcolour. - Built-in themes colour every Markdown scope.
Some Markdown scopes also carry a text attribute, in rendered pages and in source alike. The attribute belongs to the scope, not the theme; a theme only picks the colour.
| Scope | Attribute |
|---|---|
markup.bold, markup.heading | bold |
markup.italic | italic |
markup.link.url | underline |
markup.strikethrough | crossed out |