nvim_config/lua/config/treesitter.lua

43 lines
1.6 KiB
Lua
Raw Normal View History

2021-09-06 23:34:51 +02:00
require('nvim-treesitter.configs').setup {
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
2024-03-10 22:34:22 +01:00
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
2022-10-02 00:46:25 +02:00
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
},
2024-03-10 22:34:22 +01:00
filetype = "ha", -- if filetype does not match the parser name
2022-10-02 00:46:25 +02:00
}
2024-03-10 22:34:22 +01:00
vim.treesitter.language.register('hare', 'hare')