Skip to main content

Documentation Index

Fetch the complete documentation index at: https://vorto-editor.dev/llms.txt

Use this file to discover all available pages before exploring further.

Vorto uses tree-sitter for syntax highlighting, but it does not bundle compiled grammar libraries. Instead, you install only the languages you need using the vorto grammar subcommand. Each grammar is fetched from its upstream Git repository and compiled into a shared library that Vorto loads at startup.

Prerequisites

Two tools must be on your PATH before you can build grammars:
  • tree-sitter CLI — install with cargo install tree-sitter-cli or npm install -g tree-sitter-cli
  • git — used to fetch grammar source repositories when no pre-built release tarball is available
  • A C compiler (gcc or clang) — invoked by tree-sitter build to compile the parser

Where grammars are stored

Vorto reads its configuration from $XDG_CONFIG_HOME/vorto/ (typically ~/.config/vorto/). Installed grammars land in two subdirectories:
PathContents
~/.config/vorto/grammars/Compiled shared libraries (.so, .dylib, or .dll)
~/.config/vorto/queries/<lang>/Query files (highlights.scm, indents.scm, etc.)
Both paths are printed at the top of vorto grammar list output so you always know where to look.

Grammar commands

List available grammars

vorto grammar list
Prints every built-in recipe along with its install status. For each language, you see 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).

Install grammars

Build and install one or more grammars by name, or install all built-in grammars at once:
# Install specific grammars
vorto grammar install rust python

# Install all built-in grammars
vorto grammar install --all
Vorto fetches the grammar source, compiles it with the tree-sitter CLI, and places the resulting library in ~/.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.
install also accepts the alias add: vorto grammar add rust.

Refresh query files only

# Refresh queries for specific grammars
vorto grammar install-queries python

# Refresh queries for all built-in grammars
vorto grammar install-queries --all
This command overwrites the .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.
install-queries also accepts the alias refresh-queries.

Remove a grammar

vorto grammar remove rust
Deletes the installed shared library for the named grammar from ~/.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.

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:
FilePurpose
highlights.scmSyntax highlighting colours
indents.scmIndentation rules
textobjects.scmText-object motions (if present)
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.

Installing grammars manually

For languages without a built-in recipe, you can install a grammar manually by dropping its compiled shared library directly into ~/.config/vorto/grammars/ and placing your query files in ~/.config/vorto/queries/<lang>/. The filename stem must match the language name in your config.toml.