Last Updated: February 25, 2016
· jamesrampton

Vim diffs to webpages

You can export vim's diff windows as html.

The resulting webpage shows all the diff windows as tables next to each other, making for easy sharing of your changes to people who don't have access to the codebase or the tools to do their own diffs (management, for example).


Just add some files to vim's diff windows with :diffthis and then export them using :TOhtml. This will place Diff.html in the working directory. Subsequent exports will be named Diff1.html etc.

:help TOhtml for more options.

2 Responses
Add your response

Can you provide me the exact commad?

over 1 year ago ·

From :help TOhtml

:10,40TOhtml " convert lines 10-40 to html
:'<,'>TOhtml " convert current/last visual selection
:TOhtml      " convert entire buffer

This will open a new buffer with the result. You can then save that wherever you like.

over 1 year ago ·