fix: treesitter-textobjects setup

This commit is contained in:
Sayantan Santra 2024-03-27 23:35:52 -05:00
parent 21dcb21444
commit c192a0fb29
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -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" },
}, },
}, },
}, }
}) })