dotfiles/nvim/.config/nvim/lua/treesitter.lua
Sanchayan Maity 384eed0b5c
nvim: treesitter: Add parsers for C, lua, vim & vimdoc
We were getting errors on trying to open vim help files. As per
nvim-treesitter, parsers for C, lua, query, vim & vimdoc should
always be installed.
2024-01-09 12:45:54 +05:30

22 lines
896 B
Lua

local ts_langs = { "bash", "c", "cpp", "diff", "fennel", "fish", "go", "haskell", "html", "java", "javascript", "jsdoc", "json", "lua", "markdown", "nix", "python", "query", "racket", "rust", "scheme", "toml", "tsx", "typescript", "verilog", "vim", "vimdoc" }
require'nvim-treesitter.install'.compilers = { "gcc" }
require'nvim-treesitter.configs'.setup {
ensure_installed = ts_langs,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { "BufWrite", "CursorHold" },
},
matchup = {
enable = true,
},
}
vim.keymap.set('o', '<Leader>m', ':<C-U>lua require(\'tsht\').nodes()<CR>', { noremap=false, unique=true, silent=true })
vim.keymap.set('x', '<Leader>m', ':lua require(\'tsht\').nodes()<CR>' , { noremap=true , unique=true, silent=true })