1 --- /usr/share/vim/vim72/syntax/2html.vim 2009-12-03 18:45:27.000000000 +0000
2 +++ /home/andy/.vim/syntax/2html.vim 2009-11-23 04:52:46.000000000 +0000
4 let s:htmlfont = "monospace"
9 + let s:whitespace = "white-space: pre-wrap; "
11 + let s:whitespace = ""
14 " When not in gui we can only guess the colors.
16 let s:whatterm = "gui"
18 let s:old_report = &report
24 " Split window to create a buffer with the HTML file.
26 " HTML header, with the title and generator ;-). Left free space for the CSS,
27 " to be filled at the end.
28 exe "normal! a<html>\n\e"
29 -exe "normal! a<head>\n<title>" . expand("%:p:~") . "</title>\n\e"
30 +exe "normal! a<head>\n<title>" . &titlestring . "</title>\n\e"
31 exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . s:tag_close . "\n\e"
32 if s:html_encoding != ""
33 exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
35 if exists("html_no_pre")
36 exe "normal! a</head>\n<body>\n\e"
38 - exe "normal! a</head>\n<body>\n<pre>\n\e"
39 + exe "normal! a</head>\n<body><pre>\n\e"
42 exe s:orgwin . "wincmd w"
46 let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
47 - let idx = stridx(s:expandedtab, "\t")
49 - let i = &ts - ((idx + s:startcol - 1) % &ts)
50 - let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', i), '')
51 - let idx = stridx(s:expandedtab, "\t")
54 + let idx = stridx(s:expandedtab, "\t")
56 + let i = &ts - ((idx + s:startcol - 1) % &ts)
57 + let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', i), '')
58 + let idx = stridx(s:expandedtab, "\t")
64 " Output the text with the same synID, with class set to {s:id_name}
65 let s:id = synIDtrans(s:id)
67 if exists("html_no_pre")
68 exe "normal! a</body>\n</html>\e"
70 - exe "normal! a</pre>\n</body>\n</html>\e"
71 + exe "normal! a</pre></body>\n</html>\e"
76 if exists("html_no_pre")
77 execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: ". s:htmlfont ."; }\e"
79 - execute "normal! A\npre { font-family: ". s:htmlfont ."; color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
80 + execute "normal! A\npre { " . s:whitespace . "font-family: ". s:htmlfont ."; color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
83 execute "normal! ^cwbody\e"