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
feat(theme): load a VS Code/Shiki theme JSON for syntax highlighting
Custom themes could only approximate syntax colors with nine semantic
tokens, so any real VS Code theme (e.g. Shades of Purple) rendered as a
rough remap of Pierre's default theme rather than the theme itself.
Add `custom_theme.syntax_theme`: a path (absolute, or relative to the
config file) to a full VS Code/Shiki theme JSON. The file is loaded and
validated at config time, registered with Pierre's highlighter, and used
as the active syntax theme so code is colored exactly as that theme would
in the editor. The nine `[custom_theme.syntax]` tokens stay as the
collision-normalization palette against diff add/remove backgrounds.
Add `custom_theme.syntax_theme` to load a full VS Code / Shiki theme JSON for source-accurate syntax highlighting. The referenced theme is registered with the highlighter and drives code coloring, so any VS Code theme renders exactly as it would in the editor instead of being approximated by the nine `[custom_theme.syntax]` tokens.
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,16 @@ variable = "#eef4ff"
157
157
158
158
All custom theme colors must use `#rrggbb` hex values. Press `t` in the app, or choose `View -> Themes…`, to open the theme selector.
159
159
160
+
For source-accurate syntax highlighting, point `syntax_theme` at a VS Code / Shiki theme JSON file. Hunk loads it and hands it to its Shiki-based highlighter, so any VS Code theme colors your code exactly as that theme would:
161
+
162
+
```toml
163
+
[custom_theme]
164
+
base = "catppuccin-mocha"
165
+
syntax_theme = "shades-of-purple.json"# absolute, or relative to this config file
166
+
```
167
+
168
+
When `syntax_theme` is set it drives code highlighting; the `[custom_theme.syntax]` colors then only refine tokens that would otherwise collide with diff add/remove backgrounds.
169
+
160
170
### Git integration
161
171
162
172
Set Hunk as your Git pager so `git diff` and `git show` open in Hunk automatically:
0 commit comments