La Vita è Bella
Wednesday, December 14, 2005
3 problems in vim's ":TOhtml" feature
":TOhtml" is a great feature in vim. With it, we can generate syntax highlighted html for our code.
Set the following settings will make the generated html code more standard:
let html_use_css = 1
let html_no_pre = 1
But there're still 3 problems:
- The "body" tag begins with a "span" tag, which isn't allowed in xhtml. The whole body should be surrounded by a "p" tag.
- At the end of every line, there's a "<br>", which should be replaced by "<br />"
- Line number was filled with space to be aligned, which should be
Hope the 3 problems will be solved in vim 7.
tags: vim, html
10:26:06 by fishy - w3c - Permanent Link
Revision: 1.2/1.2, last modified on 2007-01-27 @ 04:24.
Karma: -12 (44.92% out of 118 were positive) [+/-]
You can subscribe to RSS 2.0 feed for comments and trackbacks
Trackbacks:La Vita è Bellavim 7 is out, and a patch for 2html: Updated Again: with this patch, if you let use_xhtml=1, then you must let html_use_css=1, or otherwise the file generated is not a valid xml file. It won't generate a invalid file now. Finally,...2006-05- 9 @ 00:50Use this TrackBack url to ping this item (right-click, copy link target). If your blog does not support Trackbacks you can manually add your trackback by using this form.
![]()
Ok, I tried this but like the pre style better. How to I turn in back on.
unlet html_no_pre = 1
doesn't seem to do anything.
Sunday, February 24, 2008 16:23:02
![]()
let html_no_pre = 0
or simply delete the 2 lines from your vimrc will work
Sunday, February 24, 2008 18:44:44
![]()
Thanks alot fishy, didnt' work but it led me to this. Turning off pre disables css and it needs to be turned back on:
let html_use_css =1
Monday, February 25, 2008 04:18:10





