Subversion diff with vim

1 min read

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.

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