Files
nvim/lua/plugins/default/treesitter.lua
Zelong Kuang 9d1536e5af Update
2025-05-13 19:37:28 +10:00

62 lines
1.5 KiB
Lua

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function()
return {
highlight = {
enable = true,
disable = { "latex" },
-- additional_vim_regex_highlighting = { "markdown" },
},
-- ignore_install = { "latex" },
indent = { enable = true, disable = { "python" } },
context_commentstring = { enable = true, enable_autocmd = false },
ensure_installed = {
"latex",
"bash",
"c",
"cpp",
"html",
"json",
"lua",
"luap",
"markdown",
"make",
"markdown_inline",
"scala",
"python",
"query",
"toml",
"regex",
"vim",
"yaml",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<cr>",
node_incremental = "<cr>",
scope_incremental = "\\",
node_decremental = "<bs>",
},
},
}
end,
rainbow = {
enable = true,
-- list of languages you want to disable the plugin for
disable = { "jsx", "cpp" },
-- Which query to use for finding delimiters
query = "rainbow-parens",
-- Highlight the entire buffer all at once
},
keys = function()
return {
{ "<cr>", desc = "Increment selection" },
{ "<bs>", desc = "Decrement selection", mode = "x" },
}
end,
},
}