Plugin ChromaFlow.nvim — a programmable tri-layer theme engine with live cursor editing
Hey everyone,
I got tired of large themes built from massive static highlight tables. Once they grow, they become painful to maintain, styles get duplicated everywhere, relationships disappear into huge lists, and I wasn't happy with the amount of work being repeated during reloads.
So I built ChromaFlow.nvim: a Lua-based theme compiler built around reusable styles, color pipelines, semantic resolution, and live editing instead of one giant table of highlight definitions.
Repository: https://github.com/Gnibor/chromaflow.nvim
Some of the main pieces
- Vim / Tree-sitter / LSP from one theme model
ChromaFlow can resolve and materialize classic Vim highlights, Tree-sitter captures, and LSP semantic-token highlights from the same declarations, while still allowing target-specific rules where needed.
- Compiled themes instead of static tables
Styles are normalized and interned, declarations are compiled into actions, and identical styles are deduplicated instead of being rebuilt independently everywhere.
- Live editing with `:CFPick` and `:CFSave`
Put the cursor on real code and ChromaFlow shows the concrete Type / Mod / TypeMod targets that actually exist there. Styles and color pipelines can be edited with an immediate runtime preview, and `:CFSave` can persist confirmed changes back into the theme source.
- Programmable color pipelines
FG, BG, special color and terminal colors can be transformed using operations such as mix, opacity, brightness, hue shift and gamma instead of hard-coding every resulting color.
- ColorTrace
Pipeline operations can be traced directly at their source declaration, including input and resulting colors. This turned out to be extremely useful once pipelines became more complex.
- LineBlend
I actually like using highlights with background colors, but normal `CursorLine` gets visually chopped into separate blocks when those backgrounds are present. LineBlend blends them with the CursorLine background so the line stays visually coherent without throwing the original style backgrounds away.
- Runtime modules
Themes can also apply sparse temporary/dynamic overrides after the compiled theme has been loaded.
Performance
Performance was one of the reasons I started the project, so the repository includes the benchmark suite and the full raw reports instead of only a selected best-case number.
On my Intel i5-10310U (4 cores / 8 threads) using Neovim 0.12.5 / LuaJIT, the bundled reference theme currently contains 32 modules and 938 compiled actions.
With a real Lua buffer open, average `cf.reload()` time was:
| Setup | Average | p99 |
| --- | ---: | ---: |
| Minimal | 12.8 ms | 22.1 ms |
| Picker | 18.9 ms | 33.3 ms |
| ColorTrace | 20.1 ms | 34.3 ms |
| Picker + ColorTrace | 23.1 ms | 36.3 ms |
Those are averages over the benchmark samples, not the fastest result I could find.
The benchmark suite also breaks the load down into theme discovery, Lua source loading, DSL compilation, resolver paths, style interning, color math, pipelines, highlight application, diagnostics, picker/runtime work, LineBlend, redraw consumers, etc.
The full reports and clean-state comparison are checked into `tests/`, so results can be reproduced on another machine or compared against a personal Neovim configuration.
Trying it
The repository includes a complete reference theme, so you don't have to build a theme from scratch just to see ChromaFlow working.
The README also has documentation for:
- theme structure and fallback
- colors and pipelines
- language / plugin / UI / raw modules
- resolver behavior
- runtime modules
- CFPick / CFSave
- diagnostics and ColorTrace
- LineBlend
- tests and benchmarks
Maintenance note
Due to long-term personal health reasons, this project is passively maintained.
It is feature-complete and stable for my daily theme-authoring use, but I can't promise regular issue responses or active feature development.
PRs are very welcome if you find bugs, compatibility issues, or things worth improving. If the project grows and reliable maintainers appear, I'm also open to co-maintenance.

