You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB
Lua

return {
{
"nvim-treesitter/nvim-treesitter",
build = function()
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
ts_update()
end,
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = "all",
highlight = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<cr>",
scope_incremental = "<cr>",
node_incremental = "<tab>",
node_decremental = "<s-tab>",
},
},
indent = { enable = false },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
},
},
},
})
end,
dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" },
},
}