Skip to content

Commit 6a884d1

Browse files
authored
Consolidate recent theme change docs in THEMES.md (#2575)
1 parent 65b57c4 commit 6a884d1

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

THEMES.md

+29-3
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:
@@ -16,7 +18,7 @@ Alternatively, you can create a theme in the same directory mentioned above and
1618

1719
Example theme override:
1820

19-
```
21+
```ron
2022
(
2123
selection_bg: Some("Blue"),
2224
selection_fg: Some("#ffffff"),
@@ -32,19 +34,43 @@ Notes:
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)
3436

37+
## Preset Themes
38+
39+
You can find preset themes by Catppuccin [here](https://github.com/catppuccin/gitui.git).
40+
41+
## Syntax Highlighting
42+
43+
The syntax highlighting theme can be defined using the element `syntax`. Both [default themes of the syntect library](https://github.com/trishume/syntect/blob/7fe13c0fd53cdfa0f9fea1aa14c5ba37f81d8b71/src/dumps.rs#L215) and custom themes are supported.
44+
45+
Example syntax theme:
46+
```ron
47+
(
48+
syntax: Some("InspiredGitHub"),
49+
)
50+
```
51+
52+
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:
53+
```ron
54+
(
55+
syntax: Some("Blackboard"),
56+
)
57+
```
58+
59+
[filmgirl/TextMate-Themes](https://github.com/filmgirl/TextMate-Themes) offers many [beautiful](https://inkdeep.github.io/TextMate-Themes) TextMate themes to choose from.
60+
3561
## Customizing line breaks
3662

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

39-
```
65+
```ron
4066
(
4167
line_break: Some("¶"),
4268
)
4369
```
4470

4571
Note that if you want to turn it off, you should use a blank string:
4672

47-
```
73+
```ron
4874
(
4975
line_break: Some(""),
5076
)

0 commit comments

Comments
 (0)