Vim is able to highlight syntax of a very large number of languages. It also has a nice feature, allowing you to save the highlighted source to a HTML file.
:runtime! syntax/2html.vim
After typing this command, you’ll get a split window with your source in HTML. You can now save it to a file.
2007-07-10 at 22:07 |
Vim is cool
2007-07-11 at 00:36 |
this sounds very intresting, and i’m going to have a go with it tomorrow.
2008-05-10 at 20:43 |
Perfect, thank you.
2008-11-20 at 12:43 |
Great, thanks! A programmer’s day without vim is just unconceivable
2008-12-02 at 11:45 |
[...] standard yet appreciable feature. So after some googling around I came across a solution posted by Maciej Bliziński which saves the syntax highlighted source code you would view inside vim as good old HTML. The [...]
2008-12-04 at 20:47 |
[...] on his blog talks about an interesting feature in [...]
2009-06-30 at 19:49 |
Nice tip!
Yet another way to do it:
http://codesnippets.joyent.com/posts/show/2073
2011-06-23 at 14:46 |
It’s funny how some “senior developers” insist that you need to install the entire Visual Basic development suite to save syntax highlighting as HTML. Thank you for this tip.
(One thing I’ve always wondered. If there were no poor children in Uganda, would VIM exist?)
2012-05-12 at 20:08 |
Legen-dary command, i just added map to this in my virc. Thanks:)