Convert a Vim Window to HTML

Apr 11, 2012

By Jamison Dance

More blogging as remembering stuff. If you want to convert a Vim buffer to HTML, syntax highlighting and color theme and all, use this command:

:TOhtml

It opens a new buffer full of HTML that will look pretty much like your Vim window when opened in a browser. Warning, this will include line numbers and other weird things, so you might have to tweak Vim if you want to make copy-paste friendly code.

Jamison Dance enjoys kittens, making computers smarter and the magic of children's laughter. He tweets at @jergason and GitHubs as jergason. He also podcasts on JavaScript Jabber and Soft Skills Engineering.