acarapetis/nvim-treesitter-jjconfig
{ "createdAt": "2025-08-09T03:25:38Z", "defaultBranch": "main", "description": "treesitter injections for jj config files in neovim", "fullName": "acarapetis/nvim-treesitter-jjconfig", "homepage": "", "language": "Lua", "name": "nvim-treesitter-jjconfig", "pushedAt": "2025-12-05T00:11:02Z", "stargazersCount": 4, "topics": [ "jj", "jujutsu", "neovim", "neovim-plugin", "nvim-treesitter", "treesitter" ], "updatedAt": "2025-12-05T00:10:51Z", "url": "https://github.com/acarapetis/nvim-treesitter-jjconfig"}nvim-treesitter-jjconfig
Section titled “nvim-treesitter-jjconfig”This is a neovim plugin providing filetype detection and a treesitter parser for revset expressions and templates inside jj configuration files.
It gives you syntax highlighting and autoindentation for:
- toml strings containing jj revset expressions:
- in
[revsets]/[revset-aliases]tables - in command aliases when immediately following “—revisions”, “—from”, “—to”, etc. (I’ve left out the short forms for now because they seem likely to trigger false positives.)
- in
- toml strings containing jj templates:
- in
[templates]/[template-aliases]tables - in command aliases when immediately following “—template” or “-T”.
- in
- toml strings containing shell scripts:
- in command aliases when immediately following the sequence “sh”, “-c” or “bash”, “-c”.
![screenshot]!(./screenshot.png)
These features should be activated whenever you’re editing a toml file that declares its schema to be jj’s config-schema, either with a top-level JSON Schema declaration:
"$schema" = "https://jj-vcs.github.io/jj/latest/config-schema.json"or with a Taplo/Tombi schema directive comment:
#:schema https://docs.jj-vcs.dev/latest/config-schema.jsonNote that this schema directive comment must be part of a comment block at the very top of the file.
Dependencies
Section titled “Dependencies”Installation
Section titled “Installation”Install this neovim plugin in whatever manner you prefer, and somewhere in your setup
after setting up nvim-treesitter, call
require("nvim-treesitter-jjconfig").config(). You can optionally provide an options
table with any of the following options:
| Option | Type | Effect |
|---|---|---|
| ensure_installed | bool | automatically install the jj treesitter parsers at startup |
| sync_install | bool | do the automatic installation synchronously |
Example lazy.nvim config:
return { { "nvim-treesitter/nvim-treesitter", lazy = false, build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup({ -- ... }) end }, { "acarapetis/nvim-treesitter-jjconfig", dependencies = { "nvim-treesitter/nvim-treesitter" }, lazy = false, opts = { ensure_installed = true }, }}Thanks
Section titled “Thanks”This would not be possible without the jjtemplate and jjrevset parsers by bryceberger.
The syntax highlighting queries for jjtemplate and jjrevset included in this repo were originally written by bryceberger for helix.
Thanks to bryceberger and algmyr for a fruitful conversation on the JJ discord.