fix: treesitter-textobjects setup
This commit is contained in:
parent
21dcb21444
commit
c192a0fb29
1 changed files with 24 additions and 22 deletions
|
@ -20,33 +20,35 @@ configs.setup({
|
||||||
node_decremental = "<bs>",
|
node_decremental = "<bs>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
select = {
|
textobjects = {
|
||||||
enable = true,
|
select = {
|
||||||
lookahead = true,
|
enable = true,
|
||||||
keymaps = {
|
lookahead = true,
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
keymaps = {
|
||||||
["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" },
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" },
|
["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" },
|
||||||
["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" },
|
["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" },
|
||||||
["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" },
|
["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" },
|
||||||
|
["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" },
|
||||||
|
|
||||||
["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" },
|
["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" },
|
||||||
["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" },
|
["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" },
|
||||||
|
|
||||||
["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" },
|
["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" },
|
||||||
["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" },
|
["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" },
|
||||||
|
|
||||||
["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" },
|
["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" },
|
||||||
["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" },
|
["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" },
|
||||||
|
|
||||||
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
|
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
|
||||||
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
|
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
|
||||||
|
|
||||||
["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" },
|
["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" },
|
||||||
["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" },
|
["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" },
|
||||||
|
|
||||||
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
|
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
|
||||||
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
|
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
move = {
|
move = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
@ -85,5 +87,5 @@ configs.setup({
|
||||||
["[L"] = { query = "@loop.outer", desc = "Prev loop end" },
|
["[L"] = { query = "@loop.outer", desc = "Prev loop end" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue