Files
yadm/.config/nvim/lua/plugins/treesitter.lua
2024-02-26 12:51:21 +01:00

86 lines
1.8 KiB
Lua

return {
'nvim-treesitter/nvim-treesitter',
dependencies = {
'mizlan/iswap.nvim',
'romgrk/nvim-treesitter-context',
--"nvim-treesitter/nvim-treesitter-textobjects",
--"nvim-treesitter/playground",
},
build = ':TSUpdate',
config = function()
-- Tree-sitter configuration
ts = require'nvim-treesitter.configs'
ts.setup {
highlight = {
enable = true,
disable = function(lang, buf)
return vim.api.nvim_buf_line_count(buf) > 5000
end,
additional_vim_regex_highlighting = false,
},
ensure_installed = {
"arduino",
"awk",
"bash",
"bibtex",
"bitbake",
"c",
"cmake",
--"comment",
"cpp",
"csv",
"devicetree",
"diff",
"fish",
"gitattributes",
"gitcommit",
"gitignore",
"git_config",
"git_rebase",
"html",
"vimdoc",
"http",
"ini",
"jq",
"json",
"latex",
"lua",
"make",
"markdown",
"markdown_inline",
"matlab",
"ninja",
"proto",
"python",
"regex",
"rust",
"toml",
"vim",
"yaml",
},
-- disabled, since it mostly shifts to four characters
--indent = {
-- enable = true,
--},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "ti",
node_incremental = "ti",
scope_incremental = "ts",
node_decremental = "td",
},
},
matchup = {
enable = true,
-- disable = { "c", "ruby" },
include_match_words
},
}
-- vim.opt.foldmethod = "expr"
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
end
}