Gregorio GABC — Zed Extension
Note
AI-Assisted Development
This project is developed, fully or in part, with LLM/generative AI assistance. All LLM-proposed changes go through human review and local testing before being committed.
If you object to software built with generative AI assistance, we respect your opinion and regret we cannot meet your expectations. In that case, we kindly recommend exploring alternative solutions. If you know of any, feel free to open an issue — we'll be happy to include them in our documentation.
Adds support for GABC/NABC (Gregorian chant notation) files to Zed.
Features
- Syntax Highlighting — Full highlighting for GABC headers, pitches, clefs, neumes, bars, alterations, style tags, NABC notation, and comments.
- LaTeX Injection — TeX code inside
<v>…</v>tags and verbatim attributes ([nv:…],[gv:…],[ev:…]) gets LaTeX highlighting. - Bracket Matching — Auto-matching for
(),[],{}, and<>. - Code Outline — Headers appear in the document outline/symbols panel.
- Language Server — Diagnostics, hover, completion, and document symbols via gregorio-lsp.
- Document Formatting — Format
.gabcfiles via Format Document (Alt+Shift+F/⌥⇧F) or on save, powered by grefmt (part ofgregorio-lsp ≥ 0.9.0).
Prerequisites
For Language Server features (diagnostics, hover, completions, formatting):
Install gregorio-lsp via Cargo (v0.9.0 or later includes the grefmt formatter):
cargo install --git https://github.com/aiscgre-br/gregorio-lsp \
--tag v0.9.0 --bin gregorio-lspMake sure ~/.cargo/bin is in your PATH. Syntax highlighting works without any prerequisites.
Installation
From Zed Extensions Marketplace
Search for "Gregorio" in Zed → Extensions.
As Dev Extension
- Clone this repository
- In Zed, run
zed: install dev extensionand select the cloned directory
Grammar
This extension uses tree-sitter-gregorio (v0.5.2, commit c9034de8), a complete tree-sitter grammar for GABC+NABC notation compatible with Gregorio 6.2.0.
Formatting
Formatting is provided by the gregorio-lsp language server (which embeds grefmt). No additional binary is required beyond the gregorio-lsp server already installed for diagnostics.
Using the formatter
- Format Document:
Alt+Shift+F(Linux/Windows) or⌥⇧F(macOS) - Format on save: add to your Zed
settings.json:{ "languages": { "GABC": { "format_on_save": "on" } } }
Formatter options
Configure via the formatting key in Zed's LSP settings (settings.json):
{
"lsp": {
"gregorio-lsp": {
"initialization_options": {},
"settings": {
"formatting": {
"maxLineWidth": 80,
"breakAfterClef": false,
"breakAfterBar": false
}
}
}
}
}| Option | Type | Default | Description |
|---|---|---|---|
maxLineWidth |
integer | 80 |
Maximum characters per notation line |
breakAfterClef |
boolean | false |
Insert a blank line after each clef token |
breakAfterBar |
boolean | false |
Insert a blank line after each bar token |
License
MIT — Copyright (c) 2026 AISCGre Brasil. See LICENSE.