From 74ac890530deba71c1e272f36c6dede7949a9722 Mon Sep 17 00:00:00 2001 From: patrickcchenn Date: Tue, 25 Aug 2026 03:14:24 +1000 Subject: [PATCH] fix: manually bind textobject select keymaps --- lua/theprimeagen/lazy/treesitter.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lua/theprimeagen/lazy/treesitter.lua b/lua/theprimeagen/lazy/treesitter.lua index 103fe07f..1c6bfba1 100644 --- a/lua/theprimeagen/lazy/treesitter.lua +++ b/lua/theprimeagen/lazy/treesitter.lua @@ -47,14 +47,18 @@ return { config = function() require("nvim-treesitter-textobjects").setup({ select = { - enable = true, lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - }, }, }) + + local select = require("nvim-treesitter-textobjects.select") + + vim.keymap.set({ "x", "o" }, "af", function() + select.select_textobject("@function.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "if", function() + select.select_textobject("@function.inner", "textobjects") + end) end, }, }