Dotfiles/site-modules/core/files/vim/plugin/treesitter.lua

50 lines
1.2 KiB
Lua
Raw Normal View History

2023-11-24 08:01:34 +00:00
require("nvim-treesitter.configs").setup {
auto_install = true,
2023-11-24 08:01:34 +00:00
playground = { enable = true },
indent = { enable = true },
2023-11-24 08:01:34 +00:00
rainbow = { enable = true },
highlight = {
-- `false` will disable the whole extension
enable = true,
additional_vim_regex_highlighting = false,
},
textobjects = {
select = {
enable = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["aa"] = "@parameter.outer", -- this is also arguments
["ia"] = "@parameter.inner", -- this is also arguments
["ab"] = "@block.outer",
["ib"] = "@block.inner",
["ac"] = "@comment.outer",
["ic"] = "@comment.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]f"] = "@function.outer",
},
goto_previous_start = {
["[f"] = "@function.outer",
},
},
swap = {
enable = true,
swap_next = {
["L"] = "@parameter.inner",
},
swap_previous = {
["H"] = "@parameter.inner",
},
},
2023-11-24 08:01:34 +00:00
},
2022-06-12 19:25:17 +00:00
}
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldenable = false