What
lua/config/plugin_config.lua lines 222–226 bind ]c and [c to treesitter-textobjects class navigation:
vim.keymap.set({ "n", "x", "o" }, "]c", function()
move.goto_next_start("@class.outer", "textobjects")
end, { desc = "Next class start" })
vim.keymap.set({ "n", "x", "o" }, "[c", function()
move.goto_previous_start("@class.outer", "textobjects")
end, { desc = "Prev class start" })
Where
lua/config/plugin_config.lua, lines 222–226.
Why it matters
:help ]c — ]c / [c are Neovim/Vim built-in normal-mode keymaps for jumping to the next/previous diff hunk in a vimdiff or diff buffer. These mappings apply globally in normal mode, so after the textobjects plugin loads, pressing ]c / [c in a diff buffer navigates classes instead of diff hunks — making vimdiff navigation broken.
Important side-effect on the existing ]g workaround: plugin_config.lua lines 191–204 route ]g → normal! ]c when vim.wo.diff is true. That normal! bypasses user maps, so it still hits the built-in correctly. However, anyone pressing ]c directly (muscle-memory from years of vimdiff use) gets class navigation, not diff navigation — with no warning.
Recommended action
Rename the class-jump bindings to keys that don't conflict with diff navigation. Common alternatives:
| Current |
Suggested |
Meaning |
]c / [c |
]t / [t |
type/class |
]c / [c |
]k / [k |
arbitrary free keys |
Or guard the binding so it only activates outside diff mode:
vim.keymap.set("n", "]c", function()
if vim.wo.diff then
vim.cmd("normal! ]c")
else
move.goto_next_start("@class.outer", "textobjects")
end
end, { desc = "Next class start (or diff hunk in diff mode)" })
The guard approach keeps muscle memory for both workflows at the cost of a small runtime check.
What
lua/config/plugin_config.lualines 222–226 bind]cand[cto treesitter-textobjects class navigation:Where
lua/config/plugin_config.lua, lines 222–226.Why it matters
:help ]c—]c/[care Neovim/Vim built-in normal-mode keymaps for jumping to the next/previous diff hunk in a vimdiff or diff buffer. These mappings apply globally in normal mode, so after the textobjects plugin loads, pressing]c/[cin adiffbuffer navigates classes instead of diff hunks — making vimdiff navigation broken.Important side-effect on the existing
]gworkaround:plugin_config.lualines 191–204 route]g→normal! ]cwhenvim.wo.diffis true. Thatnormal!bypasses user maps, so it still hits the built-in correctly. However, anyone pressing]cdirectly (muscle-memory from years of vimdiff use) gets class navigation, not diff navigation — with no warning.Recommended action
Rename the class-jump bindings to keys that don't conflict with diff navigation. Common alternatives:
]c/[c]t/[t]c/[c]k/[kOr guard the binding so it only activates outside diff mode:
The guard approach keeps muscle memory for both workflows at the cost of a small runtime check.