
Vim commands that handle the detail work without friction
Most of the time Vim does what you expect. But there is a category of editing tasks where the obvious approach quietly fails you: numeric data that sorts wrong, a diff window you can only scroll through, a macro that breaks because of your own mappings, or a regex that swallows half the file instead of a small piece of it. None of these are exotic edge cases — they come up in ordinary work. These five commands are the ones I reach for when that category of problem shows up. 1) Jumping between diff hunks without scrolling Why it matters When you open two files side by side with vimdiff or :diffsplit , the changed sections are highlighted — but you still have to find them. Scrolling through a large file looking for the next colored block is slow and easy to miss. ]c and [c are motions that jump directly to diff hunks, skipping unchanged content entirely. ] c " jump forward to the next changed hunk [ c " jump backward to the previous changed hunk Real scenario You are reviewing a pull req
Continue reading on Dev.to
Opens in a new tab



