nvim: ts text objects

This commit is contained in:
Daniel Lundin 2020-10-16 09:06:39 +02:00
parent bd13f4f51b
commit 35534e8c1c
No known key found for this signature in database
GPG key ID: 6AB527C9196ACDCC

View file

@ -382,6 +382,26 @@ require'nvim-treesitter.configs'.setup {
node_decremental = "grm",
},
},
textobjects = {
select = {
enable = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
-- Or you can define your own textobjects like this
["iF"] = {
python = "(function_definition) @function",
cpp = "(function_definition) @function",
c = "(function_definition) @function",
java = "(method_declaration) @function",
},
},
},
},
}
END