I switched to using Vim full-time about nine months ago, but I haven’t yet cracked the nut that is
vimdiff. As a result, I’ve been jumping around between various crummy GUIs for
git mergetool. Until a few days ago, when I found the excellent Splice.vim (formerly Threesome.vim). Now I’m back in Vim wonderland.
I’ve found Splice to be pretty great for my (albeit limited) mergetool needs – once you figure out how to use it. Splice has pretty good vimdocs, but they’re more of a reference than a tutorial; and getting the necessary information out of the developer’s screencast walkthrough is a needle-haystack exercise. So here’s a quick guide to getting started.
- Install Splice – Instructions can be found here.
- Find yourself a conflict and invoke
git mergetool– If you never have to manage merge conflicts, you are a better soul than me. I’ve set up a dopey example in the screenshot below.
- Cycle through the layouts – I’ve got a widescreen monitor, so I like the side-by-side layout. Use
-[space]to cycle. (
[space]is a space character.)
- Jump to your first conflict – Use
-nto get to your first conflict.
- Choose your side, or resolve manually – If you need to resolve manually, do so on the middle screen. On the other hand, if you want to take either the left-hand change (
1) or the right-hand change (
2), you can do so using
2, as the case may be).
- Repeat – Go to the next conflict using
-n. When you’re done with the file,
-qsaves all changes and quits all windows. Hit Enter to resolve conflicts in the next file, or if you’ve reached the end of your conflicts, go ahead and commit your changes.
Huge thanks to Steve Losh for developing and sharing such an awesome tool.