Neovim plugin for GABC/NABC (Gregorio) files.
It integrates:
- tree-sitter-gregorio for Tree-sitter parsing/highlighting when available;
- static Vim syntax highlighting as fallback;
- gregorio-lsp for diagnostics and language features.
- GABC filetype detection (
*.gabc) - Tree-sitter language registration for
gregorio - Static syntax highlighting fallback (
syntax/gabc.vim) - Automatic LSP startup with
gregorio-lspforgabcbuffers - Editing commands (ported from
gregorio.nvim-oldand adapted to current architecture)::GabcTransposeUp:GabcTransposeDown:GabcFillParens:GabcConvertLigaturesToTags:GabcConvertTagsToLigatures
- Reusable resources imported from
gregorio.nvim-old:snippets/gabc.snippetstemplates/basic_gabc_template.gabctemplates/nabc_gabc_template.gabctemplates/advanced_gabc_template.gabc
- Neovim 0.9+
- Optional for Tree-sitter features:
nvim-treesitter+ installedgregorioparser - Optional for LSP features:
gregorio-lspin$PATH
Install gregorio-lsp:
cargo install --git https://github.com/AISCGre-BR/gregorio-lsp --tag v0.7.0 --bin gregorio-lsp{
"AISCGre-BR/gregorio.nvim",
ft = "gabc",
}use {
"AISCGre-BR/gregorio.nvim",
ft = "gabc",
}Default setup is automatic via plugin/gregorio.lua.
Optional manual setup:
require("gregorio").setup({
treesitter = {
enabled = true,
language = "gregorio",
},
lsp = {
enabled = true,
cmd = { "gregorio-lsp" },
},
keymaps = {
enabled = true, -- set to false to disable all keymaps
transpose_up = "<LocalLeader>tu",
transpose_down = "<LocalLeader>td",
fill_parens = "<LocalLeader>fp",
convert_ligatures_to_tags = "<LocalLeader>lt",
convert_tags_to_ligatures = "<LocalLeader>tl",
},
})Set any individual key to false to disable only that mapping.
| Command | Description |
|---|---|
:GabcTransposeUp |
Transpose notes in notation groups upward |
:GabcTransposeDown |
Transpose notes in notation groups downward |
:GabcFillParens |
Fill empty note groups with the last preceding pitch |
:GabcConvertLigaturesToTags |
Convert æ, ǽ, œ to <sp> tags in chant body |
:GabcConvertTagsToLigatures |
Convert <sp> ligature tags back to Unicode ligatures |
Buffer-local keymaps are set automatically for gabc files (normal and visual mode where applicable):
| Key | Command | Modes |
|---|---|---|
<LocalLeader>tu |
GabcTransposeUp |
n, x |
<LocalLeader>td |
GabcTransposeDown |
n, x |
<LocalLeader>fp |
GabcFillParens |
n, x |
<LocalLeader>lt |
GabcConvertLigaturesToTags |
n |
<LocalLeader>tl |
GabcConvertTagsToLigatures |
n |
All keymaps can be overridden or disabled via setup() (see Configuration).
- Range awareness (
GabcTransposeUp,GabcTransposeDown,GabcFillParens): when called without an explicit range or visual selection, the command operates on the entire chant body (all lines after%%). When a range or visual selection is given, only the selected lines are affected. Header lines are never modified. - Transpose scope: only note letters inside notation groups
(...)are shifted; bracketed fragments[...]inside groups are preserved. Accidentals (gx,hy,i#) and explicit custos (f+,g+) are handled correctly: the base pitch letter is transposed while the modifier character is preserved. - NABC awareness: when the
nabc-linesheader is present,GabcTransposeUpandGabcTransposeDownonly transpose the GABC segments inside mixed note groups. Pipe-separated segment at indexiis GABC wheni % (nabc-lines + 1) == 0. Example withnabc-lines: 2: in(AAAA|BBBB|CCCC|DDDD|EEEE|FFFF), onlyAAAAandDDDDare transposed. - Fill parens:
GabcFillParensfills each empty group (()or( )) with the last pitch letter of the nearest preceding non-empty group, tracking state across the entire selected region or body. Example:(fgh) () () () (ij) () ()→(fgh) (h) (h) (h) (ij) (j) (j). - Ligature conversion commands always operate on the whole chant body.
This repository also provides reusable resources imported from gregorio.nvim-old:
- Snippet pack:
snippets/gabc.snippets(SnipMate/UltiSnips format) - Starter templates:
templates/basic_gabc_template.gabctemplates/nabc_gabc_template.gabctemplates/advanced_gabc_template.gabc
The snippet pack includes:
- liturgical response shortcuts (
A/,R/,V/) - common lyric formatting tags (
<b>,<i>,<sc>,<ul>,<tt>) - control tags (
<clear>,<e>,<eu>,<nlba>,<sp>,<v>,<alt>) - header boilerplates (
gabcheader,nabcheader) - common neume and division helpers
When Tree-sitter support is available, the plugin registers gregorio for gabc files.
If Tree-sitter is unavailable, Neovim uses the static fallback in syntax/gabc.vim.
The static fallback is the comprehensive port from gregorio.nvim-old and includes:
- structured header highlighting (
key: value;, numeric and LaTeX-enabled headers) - full GABC note-section tokens (pitches, bars, custos, spacing, and inline chant tags)
- NABC notation support (St. Gall/Laon code families and modifiers)
- error highlighting for invalid GABC/NABC snippets
MIT — Copyright (c) 2026 AISCGre Brasil.