Categories
Uncategorized

VimDiff: How Have I Not Used This Before?

Ok, I have been using Vim for about 15 years now, and even did a whole presentation on vim at my SD PHP Meetup, and had a reference to vimdiff in one of my slides. But honestly I have never used it.

WOW, what a great tool. Here are a couple of links that I found useful.

http://www.debianadmin.com/vimdiff-edit-two-or-three-versions-of-a-file-with-vim-and-show-differences.html

The video shows you how to use vimdiff as your git diffing tool.
http://www.youtube.com/watch?v=hb5RVnOda2o

One thing to add. If you follow the steps for using vimdiff as your git diff external tool, make sure to add this to your .gitconfig
[pager]
diff =

Otherwise you will get errors.

Also, when editting more than 2 files at once, those shortcuts won’t work.
Instead of :dp, use :diffput b#
Instead of :do, use :diffget b#

b# is just a number of the window pane starting at 1, counting left to right.
Shorthand :diffpu or :diffg

Leave a Reply

Your email address will not be published. Required fields are marked *