@@ -0,0 +1,94 @@
1+# Themes
2+
3+First you'll need to place selected themes in your `themes` directory (i.e `~/.config/helix/themes`), the directory might have to be created beforehand.
4+
5+To use a custom theme add `theme = <name>` to your [`config.toml`](./configuration.md) or override it during runtime using `:theme <name>`.
6+
7+The default theme.toml can be found [here](https://github.com/helix-editor/helix/blob/master/theme.toml), and user submitted themes [here](https://github.com/helix-editor/helix/blob/master/contrib/themes).
8+
9+## Creating a theme
10+
11+First create a file with the name of your theme as file name (i.e `mytheme.toml`) and place it in your `themes` directory (i.e `~/.config/helix/themes`).
12+
13+Each line in the theme file is specified as below:
14+
15+```toml
16+key = { fg = "#ffffff", bg = "#000000", modifiers = ["bold", "italic"] }
17+```
18+
19+where `key` represents what you want to style, `fg` specifies the foreground color, `bg` the background color, and `modifiers` is a list of style modifiers. `bg` and `modifiers` can be omitted to defer to the defaults.
20+
21+To specify only the foreground color:
22+
23+```toml
24+key = "#ffffff"
25+```
26+
27+if the key contains a dot `'.'`, it must be quoted to prevent it being parsed as a [dotted key](https://toml.io/en/v1.0.0#keys).
28+
29+```toml
30+"key.key" = "#ffffff"
31+```
32+
33+Possible modifiers:
34+
35+| Modifier |
36+| --- |
37+| `bold` |
38+| `dim` |
39+| `italic` |
40+| `underlined` |
41+| `slow\_blink` |
42+| `rapid\_blink` |
43+| `reversed` |
44+| `hidden` |
45+| `crossed\_out` |
46+
47+Possible keys:
48+
49+| Key | Notes |
50+| --- | --- |
51+| `attribute` | |
52+| `keyword` | |
53+| `keyword.directive` | Preprocessor directives (\#if in C) |
54+| `namespace` | |
55+| `punctuation` | |
56+| `punctuation.delimiter` | |
57+| `operator` | |
58+| `special` | |
59+| `property` | |
60+| `variable` | |
61+| `variable.parameter` | |
62+| `type` | |
63+| `type.builtin` | |
64+| `constructor` | |
65+| `function` | |
66+| `function.macro` | |
67+| `function.builtin` | |
68+| `comment` | |
69+| `variable.builtin` | |
70+| `constant` | |
71+| `constant.builtin` | |
72+| `string` | |
73+| `number` | |
74+| `escape` | Escaped characters |
75+| `label` | For lifetimes |
76+| `module` | |
77+| `ui.background` | |
78+| `ui.linenr` | |
79+| `ui.statusline` | |
80+| `ui.popup` | |
81+| `ui.window` | |
82+| `ui.help` | |
83+| `ui.text` | |
84+| `ui.text.focus` | |
85+| `ui.menu.selected` | |
86+| `ui.selection` | For selections in the editing area |
87+| `warning` | LSP warning |
88+| `error` | LSP error |
89+| `info` | LSP info |
90+| `hint` | LSP hint |
91+
92+These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). We half-follow the common scopes from [macromates language grammars](https://macromates.com/manual/en/language_grammars) with some differences.
93+
94+For a given highlight produced, styling will be determined based on the longest matching theme key. So it's enough to provide function to highlight `function.macro` and `function.builtin` as well, but you can use more specific scopes to highlight specific cases differently.