2021-09-06 23:34:51 +02:00
|
|
|
require('nvim-treesitter.configs').setup {
|
2022-05-09 17:54:16 +02:00
|
|
|
autotag = {
|
|
|
|
enable = true,
|
|
|
|
},
|
|
|
|
highlight = {
|
|
|
|
enable = true,
|
|
|
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
|
|
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
|
|
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
|
|
|
-- Instead of true it can also be a list of languages
|
|
|
|
additional_vim_regex_highlighting = false,
|
|
|
|
},
|
|
|
|
incremental_selection = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
init_selection = "gnn",
|
|
|
|
node_incremental = "grn",
|
|
|
|
scope_incremental = "grc",
|
|
|
|
node_decremental = "grm",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
indent = {
|
|
|
|
enable = true
|
2021-09-06 23:34:51 +02:00
|
|
|
},
|
|
|
|
}
|
2022-10-02 00:46:25 +02:00
|
|
|
|
|
|
|
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
|
|
|
|
|
|
|
|
parser_config.hare = {
|
|
|
|
install_info = {
|
|
|
|
-- url = 'https://git.sr.ht/~ecmma/tree-sitter-hare', -- local path or git repo
|
|
|
|
url = '/home/leo/.config/nvim/deps/tree-sitter-hare',
|
|
|
|
files = { "src/parser.c" },
|
|
|
|
-- optional entries:
|
|
|
|
-- branch = "main", -- default branch in case of git repo if different from master
|
|
|
|
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
|
|
|
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
|
|
|
},
|
|
|
|
filetype = "ha", -- if filetype does not match the parser name
|
|
|
|
}
|
|
|
|
|
|
|
|
local ft_to_parser = require "nvim-treesitter.parsers".filetype_to_parsername
|
|
|
|
ft_to_parser.hare = "hare"
|