Skip to content

KvGeijer/tree-sitter-zote

Repository files navigation

A tree-sitter grammar for Zote

This repo contains a tree-sitter for Zote, including queries for syntax highlighting. After 25 days of Advent of Code in Zote I started missing the highlighting and syntax errors from other languages. It would be ideal to implement a language server as well to cover syntax errors as well.

Here is an example of how it looks in Helix when using the theme vim_dark_high_contrast

Example Highlighting

Installation

This repo contains the generated C code, in line with what is expected from tree-sitter. This can then be compiled and integrated with most modern editors.

The folder queries contains the queries for syntax highlighting, and should be used when integrating with your chosen editor.

Using in Helix

Add this to your languages.toml

[[language]]
name = "zote"
auto-format = false
scope = "source.zote"
injection-regex = "zote"
file-types = ["zote"]
comment-token = "//"
indent = { tab-width = 4, unit = "    " }
roots = []

[[grammar]]
name = "zote"
source = {git = "https://github.com/KvGeijer/tree-sitter-zote", rev = "main"}

This will add Zote as a language, detect it automatically, and connect it with this tree-sitter. Then, to get syntax highlighting, add the queries from this repository to your helix runtime config.

cp -r tree-sitter-zote/queries ~/.config/helix/runtime/queries/zote

Finally, fetch and build the grammar.

hx -g fetch
hx -g build

About

A tree sitter grammar for Zote

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages