mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 18:30:06 -04:00
Textobjects: provide mappings for all swap/goto functions
This commit is contained in:
parent
1642e37499
commit
e629efafd8
4 changed files with 116 additions and 54 deletions
26
README.md
26
README.md
|
|
@ -147,7 +147,31 @@ require'nvim-treesitter.configs'.setup {
|
|||
["ad"] = "@comment.outer",
|
||||
["am"] = "@call.outer",
|
||||
["im"] = "@call.inner"
|
||||
}
|
||||
},
|
||||
-- swap parameters (keymap -> textobject query)
|
||||
swap_next = {
|
||||
["<a-p>"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<a-P>"] = "@parameter.inner",
|
||||
},
|
||||
-- set mappings to go to start/end of adjacent textobjects (keymap -> textobject query)
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
},
|
||||
ensure_installed = "all" -- one of "all", "language", or a list of languages
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue