Thursday, December 11, 2008

Export VIM syntax highlighting to HTML

You can export the colorscheme based syntax highlighting in used in your VIM instance to a HTML file.

Just set a colorscheme and enable syntax highligting in VIM"

colorscheme torte
syntax on

Then you can export the same color scheme to a HTML file:

:runtime! syntax/2html.vim

This works for any file type supported by VIM. Just make sure you save the file before using the right extention.


Unknown said...

Is it the same output as :TOhtml command?

cmihai said...

Looks like it, yeah. Thanks for the hint, looks much easier to type.