for f in *.tmpl; do gvim -f +"syn on" +"let html_use_css = 1" +"run! syntax/2html.vim" +"wq" +"q" $f; doneTo learn more, type ":help convert-to-HTML" in Vim. What's especially cool is that Vim's syntax highlighting is one of the best and most comprehensive out there.
Wednesday, January 25, 2006
Vim: Output Colorized Source Code
You can use Vim to output colorized source code in HTML. The following command translates all the .tmpl files into .tmpl.html files: