Skip to main content
Vorto ships with built-in definitions for common languages. You can override any field on a built-in language or add an entirely new one using [languages.<name>] blocks in config.toml. Fields you omit fall through to the built-in defaults, so you only need to specify what you’re changing.

Table fields

extensions

Type: list of strings File extensions (without the leading dot) that Vorto maps to this language. Replacing this list entirely replaces the built-in extension set for the language — if you want to add extensions you must re-state the existing ones alongside the new ones.

grammar

Type: string
Default: the language name
The filename stem of the tree-sitter grammar library to load from the grammar directory. For example, grammar = "fish-shell" loads grammars/fish-shell.so (or .dylib / .dll on macOS / Windows). When unset, Vorto uses the language name as the stem.

grammar_dir

Type: path string Override the grammar directory for this language only. When set, Vorto looks for the grammar shared library here instead of the global grammar_dir. Useful when you want to keep a patched grammar separate from your main grammar directory.

query_dir

Type: path string Override the query directory for this language only. When set, Vorto looks for highlights.scm, indents.scm, and other query files here instead of the global query_dir/<lang>/.

comment_token

Type: string The single-line comment prefix used by the <space>c toggle. For example, "//" for Rust or "#" for Python. Leave this unset to disable comment toggling for the language entirely (JSON has no single-line comment syntax, so its built-in leaves this unset).

Editor setting overrides

The editor fields from [editor] can be overridden per language by placing them directly in the [languages.<name>] table. There is no nested [editor] sub-table here — the keys are flattened: Any field not set here falls through to the global [editor] setting.

lsp

Type: list of strings Names of LSP servers (keys from the [lsp] table) to attach to buffers of this language. This list is replaced whole — it is not merged with the built-in default. To keep the default servers and add one more, re-state all the names you want:
To disable all LSP for a language, set it to an empty list:

formatter

Type: list of strings, or a table with command and args Controls what formats the buffer on save. The field is polymorphic — it takes either of two shapes:
  • A list of LSP server names formats with those servers’ textDocument/formatting, tried in priority order. The first server that is attached and returns a successful result wins.
  • A command / args table defines an external formatter. Vorto pipes the buffer’s text on stdin and replaces the buffer with stdout.
When unset, Vorto falls back to textDocument/formatting against the first attached LSP on save. The formatter value is replaced whole on override — for the command table, command and args always go together.

Adding a new language

To add a language Vorto doesn’t know about, define it from scratch. The extensions field is required for Vorto to associate files with the language:
If the grammar stem matches a different name from the language name, set grammar explicitly:

Overriding built-in languages

To tweak only specific settings on a built-in language, just include the fields you want to change. Everything else survives from the built-in:

Using an external formatter

Formatting with an LSP server

To format with a language server instead of an external command, set formatter to a list of server names. Vorto requests textDocument/formatting from each in order and stops at the first one that is attached and succeeds:

Referencing an LSP server

Once you define a server in [lsp.<name>], reference it by name from any language: