Skip to content

Commit 999f9fb

Browse files
author
Naseschwarz
committed
Document usage of custom themes
1 parent 52806d7 commit 999f9fb

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

THEMES.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
default on light terminal:
44
![](assets/light-theme.png)
55

6+
## Configuration
7+
68
To change the colors of the default theme you need to add a `theme.ron` file that contains the colors you want to override. Note that you don’t have to specify the full theme anymore (as of 0.23). Instead, it is sufficient to override just the values that you want to differ from their default values.
79

810
The file uses the [Ron format](https://github.com/ron-rs/ron) and is located at one of the following paths, depending on your operating system:
@@ -31,14 +33,27 @@ Notes:
3133
* using a color like `yellow` might appear in whatever your terminal/theme defines for `yellow`
3234
* valid colors can be found in ratatui's [Color](https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html) struct.
3335
* all customizable theme elements can be found in [`style.rs` in the `impl Default for Theme` block](https://github.com/gitui-org/gitui/blob/master/src/ui/style.rs#L305)
34-
* the syntax highlighting theme can be defined using the element `syntax`. Currently, only [default themes of the syntect library are supported](https://github.com/trishume/syntect/blob/7fe13c0fd53cdfa0f9fea1aa14c5ba37f81d8b71/src/dumps.rs#L215).
36+
37+
## Syntax Highlighting
38+
39+
The syntax highlighting theme can be defined using the element `syntax`. Both [default themes of the syntect library are supported](https://github.com/trishume/syntect/blob/7fe13c0fd53cdfa0f9fea1aa14c5ba37f81d8b71/src/dumps.rs#L215) and custom themes are supported.
3540

3641
Example syntax theme:
3742
```
3843
(
3944
syntax: Some("InspiredGitHub"),
4045
)
4146
```
47+
48+
Custom themes are located in the [configuration directory](#configuration), are using TextMate's theme format and must have a `.tmTheme` file extension. To load a custom theme, `syntax` must be set to the file name without the file extension. For example, to load [`Blackboard.tmTheme`](https://raw.githubusercontent.com/filmgirl/TextMate-Themes/refs/heads/master/Blackboard.tmTheme), place the file next to `theme.ron` and set:
49+
```
50+
(
51+
syntax: Some("Blackboard"),
52+
)
53+
```
54+
55+
[filmgirl/TextMate-Themes](https://github.com/filmgirl/TextMate-Themes) offers many [beautiful](https://inkdeep.github.io/TextMate-Themes) TextMate themes from which to choose.
56+
4257
## Customizing line breaks
4358

4459
If you want to change how the line break is displayed in the diff, you can also specify `line_break` in your `theme.ron`:

0 commit comments

Comments
 (0)