Files
nvim/lua/plugins/default/treesitter.lua

66 lines
1.6 KiB
Lua
Raw Normal View History

2025-05-13 19:37:28 +10:00
return {
{
"nvim-treesitter/nvim-treesitter",
2025-09-21 20:43:38 +10:00
-- commit = "a1332a7925e5b3234a94480f77713d396ca895c1",
2025-05-13 19:37:28 +10:00
opts = function()
2025-09-21 20:43:38 +10:00
local parsers = {
"typst",
"bash",
"c",
"cpp",
"html",
"json",
"lua",
"luap",
"markdown",
"make",
"markdown_inline",
"scala",
"python",
"latex",
"query",
"toml",
"regex",
"vim",
"yaml",
}
table.insert(parsers, "latex")
2025-05-13 19:37:28 +10:00
return {
highlight = {
enable = true,
2025-09-21 20:43:38 +10:00
disable = { "tex, latex" },
2025-05-13 19:37:28 +10:00
-- additional_vim_regex_highlighting = { "markdown" },
},
-- ignore_install = { "latex" },
indent = { enable = true, disable = { "python" } },
context_commentstring = { enable = true, enable_autocmd = false },
2025-09-21 20:43:38 +10:00
ensure_installed = parsers,
2025-05-13 19:37:28 +10:00
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,
},
}