diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index f6d36519..753cfb7d 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -10,6 +10,18 @@ return { dependencies = { { "nvim-treesitter/nvim-treesitter-textobjects", + config = function() + -- Disable class keymaps in diff mode + vim.api.nvim_create_autocmd("BufReadPost", { + callback = function(event) + if vim.wo.diff then + for _, key in ipairs({ "[c", "]c", "[C", "]C" }) do + pcall(vim.keymap.del, "n", key, { buffer = event.buf }) + end + end + end, + }) + end, }, }, cmd = { "TSUpdateSync" },