Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Upgrading from 2.x

Configurations written for 2.x keep working, and each deprecated setting prints a warning naming its replacement. The deprecated settings will be removed in the next major release.

  • library and symbol. For a language from the built-in list, remove them along with the highlights path: the grammar and its queries are fetched instead. Any other grammar is named by git, its repository URL or a path to a local checkout.
  • A copy of the bundled stylesheet in additional-css. The stylesheet is now embedded, so remove the copy, or keep only your own changes in it. A copy that replaces the bundled theme moves to theme/highlight_ts.css.

A 2.x configuration such as

[preprocessor.tsitter.languages.rust]
library = "parsers/rust.so"
highlights = "queries/rust/highlights.scm"

[preprocessor.tsitter.languages.mylang]
library = "parsers/mylang.so"
highlights = "queries/mylang/highlights.scm"

[output.html]
additional-css = ["theme/treesitter.css"]

becomes

[preprocessor.tsitter.languages]
rust = {}

[preprocessor.tsitter.languages.mylang]
git = "https://github.com/someone/tree-sitter-mylang"
rev = "v1.0.0"

and the committed parsers, queries, and stylesheet can be deleted.

Highlighting from nvim-treesitter style queries is also more faithful in 3.0: #contains? and Vim’s \c regex flag are evaluated, and spell-checking and helper captures no longer strip the colour from the nodes they mark.