I have a vim open on code, and the code is highlighted. I would like to write this code to a file, including the color codes used to highlight the text. How can I achieve this ?

link|improve this question

59% accept rate
feedback

1 Answer

up vote 4 down vote accepted

Vim's TOHtml achieves this. It saves the active buffer with the syntax coloring as HTML. It might be included in your Vim installation, so try ahead issuing :TOhtml.

link|improve this answer
2  
This is the most badass thing I've ever seen. +1 million – Stefano Borini Nov 18 '10 at 10:26
Really awesome.. +1 billion – Sachin Shekhar Mar 4 at 7:07
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.