Context
PR #32 fixed the No handler for is-not? error that nvim-treesitter users were hitting (see #12). But PerchunPak's follow-up comment on that issue highlighted a deeper divergence: nvim-treesitter vendors its own Nix queries because our capture names don't match nvim-treesitter's current conventions. Nvim-treesitter is now archived (2026-04-03), so those vendored queries are frozen and won't track future grammar updates.
Aligning our capture names with the modern tree-sitter conventions (used by nvim-treesitter, Helix, Zed, and most current tree-sitter theme ecosystems) means:
- Modern themes (Tokyo Night, Catppuccin, Gruvbox-Material, etc.) highlight Nix out-of-box without per-theme mappings.
- When a post-archival Neovim integration picks up Nix queries, ours plug in directly — no vendoring gap.
- Theme authors have one set of captures to target.
Proposed rename table
| Current |
v0.5.0 |
@escape |
@string.escape |
@string.special.uri |
@string.special.url |
@keyword (flat) for if, then, else |
@keyword.conditional |
@keyword (flat) for or (in select-default) |
@keyword.operator |
@keyword for let, inherit, in, rec, with, assert |
@keyword (unchanged) |
(missing) on (comment) |
add @spell so nvim triggers spellcheck |
@variable.builtin for true, false |
@boolean |
@variable.builtin for null |
@constant.builtin |
@variable.builtin for builtins, __currentSystem, etc. |
@variable.builtin (unchanged) |
@embedded inside (interpolation) |
drop (let the injected language's theme take over) |
@property (attrset keys, select attrs, binding lhs) |
consider @variable.member (some conventions use this for attrset keys) — needs evaluation |
Files to touch
queries/highlights.scm — capture renames (~15-20 lines).
test/highlight/basic.nix — update every # ^ <capture> annotation that references a renamed capture (63 assertions; many will NOT need changes since only the affected ones move).
docs/highlight-groups.md — regenerate the reference list.
CHANGELOG.md — section under v0.5.0 "Changed (breaking for some theme consumers)".
Why v0.5.0 and not v0.4.0
This is strictly breaking for consumers who string-map capture names (older themes, custom editor configs). v0.4.0 is intended as a purely additive / non-breaking release (bindings, fixes, doc-comment split). The modernization rightfully lives in a separate minor bump so downstream has a clear upgrade signal.
Out of scope for this issue
- Changing any grammar rule or node type (pure query work).
- Adding new queries (e.g.
folds.scm) — covered separately.
Verification plan
tree-sitter test — all 63 (or however many after this lands) highlight assertions pass against the new annotations.
- Eyeball the output of
tree-sitter highlight on a representative Nix file to confirm nvim-treesitter-like coloring.
References
Context
PR #32 fixed the
No handler for is-not?error that nvim-treesitter users were hitting (see #12). But PerchunPak's follow-up comment on that issue highlighted a deeper divergence: nvim-treesitter vendors its own Nix queries because our capture names don't match nvim-treesitter's current conventions. Nvim-treesitter is now archived (2026-04-03), so those vendored queries are frozen and won't track future grammar updates.Aligning our capture names with the modern tree-sitter conventions (used by nvim-treesitter, Helix, Zed, and most current tree-sitter theme ecosystems) means:
Proposed rename table
@escape@string.escape@string.special.uri@string.special.url@keyword(flat) forif,then,else@keyword.conditional@keyword(flat) foror(in select-default)@keyword.operator@keywordforlet,inherit,in,rec,with,assert@keyword(unchanged)(comment)@spellso nvim triggers spellcheck@variable.builtinfortrue,false@boolean@variable.builtinfornull@constant.builtin@variable.builtinforbuiltins,__currentSystem, etc.@variable.builtin(unchanged)@embeddedinside(interpolation)@property(attrset keys, select attrs, binding lhs)@variable.member(some conventions use this for attrset keys) — needs evaluationFiles to touch
queries/highlights.scm— capture renames (~15-20 lines).test/highlight/basic.nix— update every# ^ <capture>annotation that references a renamed capture (63 assertions; many will NOT need changes since only the affected ones move).docs/highlight-groups.md— regenerate the reference list.CHANGELOG.md— section under v0.5.0 "Changed (breaking for some theme consumers)".Why v0.5.0 and not v0.4.0
This is strictly breaking for consumers who string-map capture names (older themes, custom editor configs). v0.4.0 is intended as a purely additive / non-breaking release (bindings, fixes, doc-comment split). The modernization rightfully lives in a separate minor bump so downstream has a clear upgrade signal.
Out of scope for this issue
folds.scm) — covered separately.Verification plan
tree-sitter test— all 63 (or however many after this lands) highlight assertions pass against the new annotations.tree-sitter highlighton a representative Nix file to confirm nvim-treesitter-like coloring.References