cargo install or built from source, no grammars are bundled: you install only the languages you need — from the command line with the vorto grammar subcommand, or from inside the editor with the :grammar command. Each grammar is fetched from its upstream Git repository and compiled into a shared library that Vorto loads at startup. The same commands also let you add languages beyond the built-in catalog, or refresh an embedded grammar’s files, regardless of how you installed Vorto.
Grammars bundled in prebuilt binaries
Release binaries are built with grammars for all 44 built-in languages embedded. On first launch, Vorto extracts them into~/.config/vorto/grammars/ and ~/.config/vorto/queries/ — no vorto grammar install, no network request, and no C compiler. From there they behave exactly like grammars you installed yourself: you can list, refresh, or remove them with the commands below.
A few details worth knowing:
- Upgrades refresh them. When you run a newer Vorto, it re-extracts the bundled set so updated grammar libraries and queries replace the old ones. It’s a no-op once everything is already current.
- Your overrides win. If you’ve repointed a language with a
[grammars.<name>]config entry, Vorto never overwrites it with the bundled copy — your recipe stays authoritative for that name. cargoand source builds don’t bundle. The crates.io binary and a plaincargo buildship without embedded grammars, so on those you install grammars on demand as described below. (A source build can embed them — see Install from source.)
Where grammars are stored
Vorto reads its configuration from$XDG_CONFIG_HOME/vorto/ (typically ~/.config/vorto/). Installed grammars land in two subdirectories:
Both paths are printed at the top of
vorto grammar list output so you always know where to look.
Grammar commands
List available grammars
[grammars.*] appear in their own custom (from config) section. For a detailed per-language breakdown — whether the compiled library is present and which query files are installed or only bundled (vendored inside the Vorto binary but not yet written to disk) — pass -v:
Install grammars
Build and install one or more grammars by name, or install all built-in grammars at once:~/.config/vorto/grammars/. It also writes the vendored query files to ~/.config/vorto/queries/<lang>/. Grammars that are already fully installed are skipped automatically.
Multiple grammars are built in parallel, capped at your CPU count, so --all completes faster on multi-core machines.
Compilation happens in-process, so a C compiler (
clang or gcc) needs to be on your PATH — if you installed Vorto with cargo or from source, you already have one. Should an install fail, see Installing a C compiler. (git fetches sources when no release tarball is published, and the tree-sitter CLI is only used as a fallback for the rare grammar that ships no pre-generated parser.c.)install also accepts the alias add: vorto grammar add rust.Refresh query files only
.scm files in ~/.config/vorto/queries/<lang>/ from Vorto’s vendored bundle without rebuilding the compiled library. Use it when you want to pick up updated query files after upgrading Vorto, without the time cost of a full grammar recompile.
Remove a grammar
~/.config/vorto/grammars/. The command accepts multiple names and reports whether each grammar was installed or not. Query files under ~/.config/vorto/queries/<lang>/ are not removed; delete them manually if needed.
remove also accepts the aliases rm and uninstall.Installing grammars from the editor
You don’t have to drop to a shell to manage grammars. Run:grammar (or :grammar list) from the command prompt to open an interactive modal listing every recipe with its install status:
The modal stays open across installs, which run on a background thread. When an install finishes, the active buffer re-highlights automatically — no restart needed.
To find a grammar in a long list, press
/ and start typing — the list narrows to grammars whose name contains what you’ve typed (case-insensitive). Enter installs the highlighted match and leaves the filter input with the query still applied. Esc peels back one step at a time: out of the filter input, then clearing the query, then closing the modal.
You can also install or remove grammars inline:
:grammar command appears in the which-key hint panel and supports Tab completion for its subcommands.
Install on open
When you open a file whose language has an install recipe but whose grammar isn’t on disk, Vorto shows a install this grammar? prompt instead of a highlight-failed error. Pressy to install — the buffer lights up once the install completes — or n to dismiss and open the file as plain text. You can also move between the Yes and No buttons with the arrow keys (or h / l / Tab) and confirm the highlighted one with Enter; the prompt opens on Yes, so a bare Enter installs. Each grammar is asked about at most once per session, so opening more files of the same language stays quiet.
How queries work
Tree-sitter queries are.scm files that tell the highlighter how to map syntax nodes to highlight groups. Vorto ships a vendored set of queries for every built-in grammar. When you run vorto grammar install, those files are written to ~/.config/vorto/queries/<lang>/ alongside the compiled library.
The query files Vorto uses include:
You can replace any of these files with your own by overwriting them in the query directory. Run
vorto grammar install-queries <lang> to restore the vendored versions.
Grammars outside the built-in catalog
For languages without a built-in recipe, you have two options.Define a recipe in config
Add a[grammars.<name>] block to your config.toml and vorto grammar install <name> — and the in-editor :grammar command — will build it just like a built-in:
Custom recipes build the library, but Vorto has no vendored queries for them — only built-ins ship bundled
.scm files. Supply your own query files in ~/.config/vorto/queries/<name>/ so highlighting has something to map against.Install the library by hand
You can also skip recipes entirely: drop a compiled shared library directly into~/.config/vorto/grammars/ and place your query files in ~/.config/vorto/queries/<lang>/. The filename stem must match the language name in your config.toml.