Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using gvim to print diffs?

Tags:

vim

vimdiff

Is there a way to print out the diffs like they show when you open them with "gvim -d", with all the common code folded away and only the diffs showing in context? I tried the print menu option, but it printed the entire file that I was currently "in", rather than printing the folded diffs.

like image 767
Paul Tomblin Avatar asked Nov 17 '08 15:11

Paul Tomblin


1 Answers

I dont think theres a way to get a side by side printout of the two files being diffed. But, you could use Vim's "Convert to HTML" tool on each of the two files being diffed and print those out separately. You could then stack them side by side to get the same effect.

Convert to HTML is kind of "pretty printing" - it saves all of the visual colour/syntax/fold information.

:he convert-to-HTML
like image 64
Gowri Avatar answered Sep 20 '22 10:09

Gowri