# Editor Installation Notes

These notes cover direct Tree-sitter consumers before a polished Zed extension
or language server is available.

## Neovim

For local development with `nvim-treesitter`, add the grammar to the parser
configuration and install it from this repository:

```lua
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()

parser_config.zuzu = {
	install_info = {
		url = "/path/to/tree-sitter-zuzu",
		files = { "src/parser.c", "src/scanner.c" },
		branch = "main",
	},
	filetype = "zuzu",
}

vim.filetype.add({
	extension = {
		zzs = "zuzu",
		zzm = "zuzu",
	},
	pattern = {
		[".*/bin/.*"] = {
			function(path, bufnr)
				local first = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1]
				if first and first:match("^#!.*%fzuzu%f[%W]") then
					return "zuzu"
				end
			end,
		},
	},
})
```

Copy or symlink `queries/*.scm` into Neovim's Tree-sitter query path as
`queries/zuzu/*.scm` while developing the grammar.

## Helix

Add the grammar to `languages.toml`:

```toml
[[grammar]]
name = "zuzu"
source = { git = "https://github.com/zuzulang/tree-sitter-zuzu", rev = "PINNED_REVISION" }

[[language]]
name = "zuzu"
scope = "source.zuzu"
file-types = ["zzs", "zzm"]
shebangs = ["zuzu"]
roots = []
comment-token = "//"
indent = { tab-width = 4, unit = "\t" }
grammar = "zuzu"
```

Then run:

```sh
hx --grammar fetch
hx --grammar build
```

Until the grammar has tagged releases, pin a commit revision rather than a
branch name.

## Zed

Zed should consume this grammar through a dedicated ZuzuScript extension that
pins a git revision in `extension.toml`. Keep Zed-specific query overrides small
and documented; shared captures should stay in `queries/*.scm`.

## Pulsar

The current Pulsar package is TextMate/CSON-based. Do not remove that grammar
until a package spike confirms current Pulsar can load this Tree-sitter parser,
use the shared query files or documented Pulsar-specific variants, and preserve
existing snippets and activation behaviour.
