From eacd98c7ff55808c3714737f852500bd4c8bd89b Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Fri, 10 Apr 2026 16:00:26 -0700 Subject: [PATCH] update readme with proper install instructions --- README.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f504d26..fa50166 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,35 @@ mise exec -- tree-sitter test ## Neovim Integration -Register the parser and configure highlighting in your Neovim config: +Add to your Neovim config: ```lua -local parser_config = require("nvim-treesitter.parsers").get_parser_configs() -parser_config.srf = { - install_info = { - url = "https://git.lerch.org/lobo/srf-tree-sitter.git", - files = { "src/parser.c" }, - branch = "main", - }, - filetype = "srf", -} - vim.filetype.add({ extension = { srf = "srf", }, }) + +vim.api.nvim_create_autocmd("User", { + pattern = "TSUpdate", + callback = function() + require("nvim-treesitter.parsers").srf = { + install_info = { + url = "https://github.com/elerch/srf-tree-sitter", + branch = "master", + queries = "queries", + }, + } + vim.treesitter.language.register("srf", "srf") + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "srf", + callback = function(args) + pcall(vim.treesitter.start, args.buf) + end, +}) ``` Then install the parser: @@ -43,10 +54,3 @@ Then install the parser: ```vim :TSInstall srf ``` - -Copy `queries/highlights.scm` to your Neovim runtime queries directory: - -```sh -mkdir -p ~/.config/nvim/queries/srf -cp queries/highlights.scm ~/.config/nvim/queries/srf/highlights.scm -```