mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Update documentation for new modules 'refactor'/'textobjects'
This commit is contained in:
parent
5e83307a43
commit
d351c9b342
3 changed files with 72 additions and 2 deletions
|
|
@ -47,6 +47,48 @@ By default, everything is disabled. To enable support for features, in your `ini
|
|||
node_decremental = "grm", -- decrement to the previous node
|
||||
}
|
||||
},
|
||||
refactor = {
|
||||
highlight_defintions = {
|
||||
enable = true
|
||||
},
|
||||
smart_rename = {
|
||||
enable = true,
|
||||
smart_rename = "grr" -- mapping to rename reference under cursor
|
||||
},
|
||||
navigation = {
|
||||
enable = true,
|
||||
goto_definition = "gnd", -- mapping to go to definition of symbol under cursor
|
||||
list_definitions = "gnD" -- mapping to list all definitions in current file
|
||||
}
|
||||
},
|
||||
textobjects = { -- syntax-aware textobjects
|
||||
enable = true,
|
||||
disable = {},
|
||||
keymaps = {
|
||||
["iL"] = { -- you can define your own textobjects directly here
|
||||
python = "(function_definition) @function",
|
||||
cpp = "(function_definition) @function",
|
||||
c = "(function_definition) @function",
|
||||
java = "(method_declaration) @function"
|
||||
},
|
||||
-- or you use the queries from supported languages with textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["aC"] = "@class.outer",
|
||||
["iC"] = "@class.inner",
|
||||
["ac"] = "@conditional.outer",
|
||||
["ic"] = "@conditional.inner",
|
||||
["ae"] = "@block.outer",
|
||||
["ie"] = "@block.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["is"] = "@statement.inner",
|
||||
["as"] = "@statement.outer",
|
||||
["ad"] = "@comment.outer",
|
||||
["am"] = "@call.outer",
|
||||
["im"] = "@call.inner"
|
||||
}
|
||||
},
|
||||
ensure_installed = 'all' -- one of 'all', 'language', or a list of languages
|
||||
}
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue