Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save vimdiff output?

Tags:

vim

vimdiff

I google'd this multiple times in the past but I've never found an answer. Is there a way to save vimdiff's output (preferably while maintaining colors, highlights, etc.)? I'd like to send this one output file to other people and tell them "just open this file, here are the differences, side by side and highlighted".

If there are better alternatives to vimdiff for this purpose, I'm open to suggestions - something that would work on both Windows and Linux platforms is ideal.

like image 679
danns87 Avatar asked Sep 19 '11 18:09

danns87


People also ask

How do I save Vimdiff output?

Open a terminal and run this command: vimdiff file1. txt file2. txt -c TOhtml -c 'w!

What is Vimdiff in Linux?

DESCRIPTION. Vimdiff starts Vim on two (or three) files. Each file gets its own window. The differences between the files are highlighted. This is a nice way to inspect changes and to move changes from one version to another version of the same file.


1 Answers

Vim can export to HTML, see:

:help :TOhtml 
like image 129
Raimondi Avatar answered Oct 11 '22 18:10

Raimondi