Erik's Weblog 2.0

February 14, 2006

[@457]

Subversion diff with vim

Once in a while I have to use Subversion on a Linux box. Not a big deal, except for diffs. The standard svn diff output is not the most readable. Vim, or more exactly vimdiff, does a terrific job at displaying differences between files side-by-side. Here's a little Bourne shell script I wrote that uses vimdiff to view the differences between a local file and the latest revision in the repository:
Nothing too fancy. It uses svn cat to get the latest rev, saves it to a temporary file, and opens both files in vimdiff:
The temp file is deleted as soon as vimdiff is quit.
[@389]

I also just found svncommand.vim, a nifty Subversion integration plugin.