feat: add own Gruvbox tmTheme, drop the AGPL dependency

Syntax highlighting for the file preview no longer points at an external
repository. gruvbox-dark.tmTheme is written from scratch here: 39 scope rules
following morhetz/gruvbox's own vim highlight links (Comment=gray italic,
String=green, Constant=purple, Keyword=red, Identifier=blue, Function=green
bold, Type=yellow, StorageClass=orange, PreProc=aqua, Operator=Normal).

The theme commonly paired with Yazi is AGPL-3.0 and would have forced that
licence on this repository. Writing our own keeps everything MIT and makes the
repo self-contained.

Verified under syntect (the library Yazi uses): rendering a sample through bat
emits only palette colours, and a Yazi frame shows 14 distinct colours with no
foreign value.

regen-tmtheme.py reproduces the file byte-for-byte.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
thomas.koppandClaude Opus 5 committed 2026-09-22 12:26:24 +02:00
1 parent 4ea70c669e
commit 6dc8e1b3ae
5 files changed
+644 -29

No files matched your search

+20 -19
View File
@@ -31,6 +31,13 @@ popups, picker, input, completion, task manager, help — plus:
**Icons** (`[icon]`): all 725 entries of Yazi's preset table, every glyph colour
remapped to its nearest Gruvbox tone.
**Syntax highlighting** (`gruvbox-dark.tmTheme`): 39 scope rules for the file
preview, written from scratch against
[morhetz/gruvbox](https://github.com/morhetz/gruvbox)'s own vim highlight links
— comments gray italic, strings green, constants purple, keywords red,
identifiers blue, functions green bold, types yellow, preprocessor aqua,
operators plain foreground.
## How the icon colours were derived
Yazi's preset ships 725 icon entries using 221 distinct colours from the
@@ -58,28 +65,14 @@ distinguishable; they just stop shouting.
```sh
git clone https://git.opennerds.org/templis/yazi-gruvbox
cp yazi-gruvbox/theme.toml ~/.config/yazi/theme.toml
cp yazi-gruvbox/theme.toml yazi-gruvbox/gruvbox-dark.tmTheme ~/.config/yazi/
```
`theme.toml` overrides Yazi's built-in `theme-dark.toml`; anything it does not
set keeps the default.
### Optional: Gruvbox syntax highlighting in previews
Not shipped here — the usual Gruvbox `.tmTheme` for Yazi is AGPL-3.0 and would
pull this repository along with it (see `THIRD-PARTY.md`). To get it:
```sh
curl -o ~/.config/yazi/Gruvbox-Dark.tmTheme \
https://raw.githubusercontent.com/poperigby/gruvbox-dark-yazi/main/Gruvbox-Dark.tmTheme
```
Then uncomment in `theme.toml`:
```toml
[mgr]
syntect_theme = "~/.config/yazi/Gruvbox-Dark.tmTheme"
```
Both files are needed — `theme.toml` points at the `.tmTheme` for syntax
highlighting in file previews.
## Keeping the icon table current
@@ -95,7 +88,15 @@ awk '/^\[icon\]/{f=1} f' yazi/yazi-config/preset/theme-dark.toml > icons-src.tom
Then replace the `[icon]` block in `theme.toml` with the generated file. The
script prints which Gruvbox tone each source colour landed on.
`regen-tmtheme.py` does the same for `gruvbox-dark.tmTheme` — edit the palette
or the scope rules at the top of the script and re-run it.
## Self-contained
Everything needed is in this repository — nothing has to be fetched from a
third-party theme repo, and no file here carries a copyleft licence.
## Licence
MIT — see `LICENSE`. Derived icon data is MIT as well; notices in
`THIRD-PARTY.md`.
MIT — see `LICENSE`. The `.tmTheme` is original work; the derived icon data is
MIT as well. Notices in `THIRD-PARTY.md`.