diff --git a/home/.config/nvim/lua/plugins/treesitter.lua b/home/.config/nvim/lua/plugins/treesitter.lua index 9ce270d6..1c8d78c9 100644 --- a/home/.config/nvim/lua/plugins/treesitter.lua +++ b/home/.config/nvim/lua/plugins/treesitter.lua @@ -69,6 +69,33 @@ return { goto_previous_start = { ["[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