If you’re using source control like Git, SVN, or Mercurial then you’re probably accustomed to resolving merge conflicts. There are a variety of tools available to you in Vim to make merge conflict resolution easier.
The tool that has become most essential to my workflow is a set of mappings provided by the Unimpaired plugin to jump to the next conflict marker:
]n goes to the next conflict marker
[n goes back to the previous conflict marker
You can also use these with
d to delete until the next marker or delete back to the previous marker. This makes quick work of picking which half of the conflict you wish to keep.
d]n delete till the next conflict marker
d[n delete back to the previous conflict marker
Here’s a short demo of these mappings in action. If you have large files or a lot of conflicts, use
]n to rip through them quickly.
With your feedback, we can improve VimTricks. Click a link to vote: