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.

2 comments:

  1. Is it the same output as :TOhtml command?

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

    ReplyDelete