Tree-sitter grammar for Bend.
This project isn't published to nvim-treesitter yet, in the meatime you can do a local install:
- Make sure you have
nvim-treesitterinstalled and working. - Clone this repository and run
tree-sitter generatefrom the root. - Add this to your nvim's
init.lua:
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.bend= {
install_info = {
url = "<tree-sitter-bend directory>", -- local path or git repo
files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
branch = "main", -- default branch in case of git repo if different from master
}
}- Create a
benddirectory innvim-treesitter'squeries/directory. If you installednvim-treesitterwithPlug.vim, it's likely~/.vim/plugged/nvim-treesitter/queries/. - Copy
queries/highlights.scminto the directory you just created. Alternatively, you can use a symlink:ln -s <this_repo>/queries/highlights.scm ~/.vim/plugged/nvim-treesitter/queries/bend/highlights.scm - Finally, open vim and run
TSInstall bend - That's it!
git pullin the repo- Run
tree-sitter generateat the root of this repo - Open vim and run
:TSUpdate - Copy
query/highlights.scmif you didn't set up a symlink.
If you haven't set up your nvim to recognize .bend files, you can put this in ~/.config/nvim/ftdetect/bend.vim:
au BufRead,BufNewFile *.bend set filetype=bend