Nvim: enable text objects for functions and classes

This commit is contained in:
Marko Korhonen 2023-12-27 10:02:55 +02:00
parent 59cac76657
commit be0452583c
No known key found for this signature in database
GPG Key ID: A7F78BCB859CD890

View File

@ -69,6 +69,33 @@ return {
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" }, goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" }, goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
}, },
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = {
query = "@function.outer",
desc = "Select outer part of a function",
},
["if"] = {
query = "@function.inner",
desc = "Select inner part of a function",
},
["ac"] = {
query = "@class.outer",
desc = "Select outer part of a class",
},
["ic"] = {
query = "@class.inner",
desc = "Select inner part of a class",
},
["as"] = {
query = "@scope",
query_group = "locals",
desc = "Select language scope",
},
},
},
}, },
}, },
--- @param opts TSConfig --- @param opts TSConfig