You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
* support loading custom syntax highlighting themes from a file [[@acuteenvy](https://github.com/acuteenvy)] ([#2565](https://github.com/gitui-org/gitui/pull/2565))
13
13
* Select syntax highlighting theme out of the defaults from syntect [[@vasilismanol](https://github.com/vasilismanol)] ([#1931](https://github.com/extrawurst/gitui/issues/1931))
14
14
* new command-line option to override the default log file path (`--logfile`) [[@acuteenvy](https://github.com/acuteenvy)] ([#2539](https://github.com/gitui-org/gitui/pull/2539))
* add `use_selection_fg` to theme file to allow customizing selection foreground color [[@Upsylonbare](https://github.com/Upsylonbare)] ([#2515](https://github.com/gitui-org/gitui/pull/2515))
Copy file name to clipboardExpand all lines: THEMES.md
+42-3
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
default on light terminal:
4
4

5
5
6
+
## Configuration
7
+
6
8
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.
7
9
8
10
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
16
18
17
19
Example theme override:
18
20
19
-
```
21
+
```ron
20
22
(
21
23
selection_bg: Some("Blue"),
22
24
selection_fg: Some("#ffffff"),
@@ -32,20 +34,57 @@ Notes:
32
34
* valid colors can be found in ratatui's [Color](https://docs.rs/ratatui/latest/ratatui/style/enum.Color.html) struct.
33
35
* 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
36
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
+
35
61
## Customizing line breaks
36
62
37
63
If you want to change how the line break is displayed in the diff, you can also specify `line_break` in your `theme.ron`:
38
64
39
-
```
65
+
```ron
40
66
(
41
67
line_break: Some("¶"),
42
68
)
43
69
```
44
70
45
71
Note that if you want to turn it off, you should use a blank string:
46
72
47
-
```
73
+
```ron
48
74
(
49
75
line_break: Some(""),
50
76
)
51
77
```
78
+
## Customizing selection
79
+
80
+
By default the `selection_fg` color is used to color the text of the selected line.
81
+
Diff line, filename, commit hashes, time and author are re-colored with `selection_fg` color.
82
+
This can be changed by specifying the `use_selection_fg` boolean in your `theme.ron`:
0 commit comments