neovim tree-sitter grammar, parser and queries for nv
language support.
If you are installing tree-sitter-nv locally there are a few steps.
-
Install tree-sitter-cli
npm i -g tree-sitter-cli # or cargo install tree-sitter-cli
-
Create a local parsers dir
tree-sitter init-config mkdir ~/.tree-sitter-parsers nvim [config-path] # [config-path] is printed by init-config # Add the path of your new .tree-sitter-parsers dir to the parser-directories array and save
-
Configure
nvim-treesitter
luaIn
~/.config/nvim/lua/config/treesitter.lua
or wherever you configure treesitter...local parser_config = require "nvim-treesitter.parsers".get_parser_configs() parser_config.nv = { install_info = { url = "~/.tree-sitter-parsers/tree-sitter-nv", files = {"src/parser.c"}, }, filetype = "nv", }
-
Configure
nvim
luaIn
~/.config/nvim/lua/config/pre_deps.lua
or wherever you configure neovim...vim.filetype.add("nv") vim.cmd [[ au BufRead,BufNewFile *.nv set filetype=nv ]]
-
Build
In this repo, run
npm run build
.You can also run
npm run test
to build and test. -
Link parser
ln -s [tree_sitter_envy_source_absolute_path] [user_dir_absolute_path]/.tree-sitter-parsers/tree-sitter-envy
-
Link queries
ln -s [tree_sitter_envy_source_absolute_path]/queries [tree_sitter_install_dir_absolute_path]/queries/envy