Programmer's Weblog

GVim to convert code into html

Sunday, April 6, 2008

Few are aware of the fact that gvim can generate html for the code inside the buffer. The command is :TOhtml; just type it in, and the html will promptly appear in a split window.

In the browser, the generated html should look exactly as you see it in gvim. By default it generates html that should work in old browsers too, but can be told to generate CSS stylesheets or even xhtml. Type :help TOhtml for more details.

It works only in gvim, though; not in vim. It is handy for posting snippets of code on the web.

Labels:

3 comments

Comments

Blogger Scrooloose
September 5, 2008 at 12:52 AM

Howdy chum

This command does work in vim. I use it on my blog to format code snippets.

Blogger Erick Fleming
November 16, 2008 at 6:53 PM

Just found this. Love the fact that I learn something new in vim every other day.

Anonymous Anonymous
November 4, 2009 at 7:19 AM

студентки из курска посмотреть онлайн http://free-3x.com/ как научить женщину получать полный и множественный оргазм скачать free-3x.com/ порно школьники онлайн [url=http://free-3x.com/]free-3x.com[/url]

leave feedback