blob: 008221400d00b0986ac6b6408d3688f0642f7eaa [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax support file
2" Maintainer: Bram Moolenaar <Bram@vim.org>
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +00003" Last Change: 2004 Oct 15
Bram Moolenaar071d4272004-06-13 20:20:40 +00004" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
5" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
6
7" Transform a file into HTML, using the current syntax highlighting.
8
9" Number lines when explicitely requested or when `number' is set
10if exists("html_number_lines")
11 let s:numblines = html_number_lines
12else
13 let s:numblines = &number
14endif
15
16" When not in gui we can only guess the colors.
17if has("gui_running")
18 let s:whatterm = "gui"
19else
20 let s:whatterm = "cterm"
21 if &t_Co == 8
22 let s:cterm_color0 = "#808080"
23 let s:cterm_color1 = "#ff6060"
24 let s:cterm_color2 = "#00ff00"
25 let s:cterm_color3 = "#ffff00"
26 let s:cterm_color4 = "#8080ff"
27 let s:cterm_color5 = "#ff40ff"
28 let s:cterm_color6 = "#00ffff"
29 let s:cterm_color7 = "#ffffff"
30 else
31 let s:cterm_color0 = "#000000"
32 let s:cterm_color1 = "#c00000"
33 let s:cterm_color2 = "#008000"
34 let s:cterm_color3 = "#804000"
35 let s:cterm_color4 = "#0000c0"
36 let s:cterm_color5 = "#c000c0"
37 let s:cterm_color6 = "#008080"
38 let s:cterm_color7 = "#c0c0c0"
39 let s:cterm_color8 = "#808080"
40 let s:cterm_color9 = "#ff6060"
41 let s:cterm_color10 = "#00ff00"
42 let s:cterm_color11 = "#ffff00"
43 let s:cterm_color12 = "#8080ff"
44 let s:cterm_color13 = "#ff40ff"
45 let s:cterm_color14 = "#00ffff"
46 let s:cterm_color15 = "#ffffff"
47 endif
48endif
49
50" Return good color specification: in GUI no transformation is done, in
51" terminal return RGB values of known colors and empty string on unknown
52if s:whatterm == "gui"
53 function! s:HtmlColor(color)
54 return a:color
55 endfun
56else
57 function! s:HtmlColor(color)
58 if exists("s:cterm_color" . a:color)
59 execute "return s:cterm_color" . a:color
60 else
61 return ""
62 endif
63 endfun
64endif
65
66if !exists("html_use_css")
67 " Return opening HTML tag for given highlight id
68 function! s:HtmlOpening(id)
69 let a = ""
70 if synIDattr(a:id, "inverse")
71 " For inverse, we always must set both colors (and exchange them)
72 let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
73 let a = a . '<span style="background-color: ' . ( x != "" ? x : s:fgc ) . '">'
74 let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
75 let a = a . '<font color="' . ( x != "" ? x : s:bgc ) . '">'
76 else
77 let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
78 if x != "" | let a = a . '<span style="background-color: ' . x . '">' | endif
79 let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
80 if x != "" | let a = a . '<font color="' . x . '">' | endif
81 endif
82 if synIDattr(a:id, "bold") | let a = a . "<b>" | endif
83 if synIDattr(a:id, "italic") | let a = a . "<i>" | endif
84 if synIDattr(a:id, "underline") | let a = a . "<u>" | endif
85 return a
86 endfun
87
88 " Return closing HTML tag for given highlight id
89 function s:HtmlClosing(id)
90 let a = ""
91 if synIDattr(a:id, "underline") | let a = a . "</u>" | endif
92 if synIDattr(a:id, "italic") | let a = a . "</i>" | endif
93 if synIDattr(a:id, "bold") | let a = a . "</b>" | endif
94 if synIDattr(a:id, "inverse")
95 let a = a . '</font></span>'
96 else
97 let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
98 if x != "" | let a = a . '</font>' | endif
99 let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
100 if x != "" | let a = a . '</span>' | endif
101 endif
102 return a
103 endfun
104endif
105
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000106" Return HTML valid characters enclosed in a span of class style_name with
107" unprintable characters expanded and double spaces replaced as necessary.
108function! s:HtmlFormat(text, style_name)
109 " Replace unprintable characters
110 let formatted = strtrans(a:text)
111
112 " Replace the reserved html characters
113 let formatted = substitute(substitute(substitute(substitute(substitute(formatted, '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g')
114
115 " Replace double spaces
116 if ' ' != s:HtmlSpace
117 let formatted = substitute(formatted, ' ', s:HtmlSpace . s:HtmlSpace, 'g')
118 endif
119
120 " Enclose in a span of class style_name
121 let formatted = '<span class="' . a:style_name . '">' . formatted . '</span>'
122
123 " Add the class to class list if it's not there yet
124 let s:id = hlID(a:style_name)
125 if stridx(s:idlist, "," . s:id . ",") == -1
126 let s:idlist = s:idlist . s:id . ","
127 endif
128
129 return formatted
130endfun
131
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132" Return CSS style describing given highlight id (can be empty)
133function! s:CSS1(id)
134 let a = ""
135 if synIDattr(a:id, "inverse")
136 " For inverse, we always must set both colors (and exchange them)
137 let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
138 let a = a . "color: " . ( x != "" ? x : s:bgc ) . "; "
139 let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
140 let a = a . "background-color: " . ( x != "" ? x : s:fgc ) . "; "
141 else
142 let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
143 if x != "" | let a = a . "color: " . x . "; " | endif
144 let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
145 if x != "" | let a = a . "background-color: " . x . "; " | endif
146 endif
147 if synIDattr(a:id, "bold") | let a = a . "font-weight: bold; " | endif
148 if synIDattr(a:id, "italic") | let a = a . "font-style: italic; " | endif
149 if synIDattr(a:id, "underline") | let a = a . "text-decoration: underline; " | endif
150 return a
151endfun
152
153" Figure out proper MIME charset from the 'encoding' option.
154if exists("html_use_encoding")
155 let s:html_encoding = html_use_encoding
156else
157 let s:vim_encoding = &encoding
158 if s:vim_encoding =~ '^8bit\|^2byte'
159 let s:vim_encoding = substitute(s:vim_encoding, '^8bit-\|^2byte-', '', '')
160 endif
161 if s:vim_encoding == 'latin1'
162 let s:html_encoding = 'iso-8859-1'
163 elseif s:vim_encoding =~ "^cp12"
164 let s:html_encoding = substitute(s:vim_encoding, 'cp', 'windows-', '')
165 elseif s:vim_encoding == 'sjis'
166 let s:html_encoding = 'Shift_JIS'
167 elseif s:vim_encoding == 'euc-cn'
168 let s:html_encoding = 'GB_2312-80'
169 elseif s:vim_encoding == 'euc-tw'
170 let s:html_encoding = ""
171 elseif s:vim_encoding =~ '^euc\|^iso\|^koi'
172 let s:html_encoding = substitute(s:vim_encoding, '.*', '\U\0', '')
173 elseif s:vim_encoding == 'cp949'
174 let s:html_encoding = 'KS_C_5601-1987'
175 elseif s:vim_encoding == 'cp936'
176 let s:html_encoding = 'GBK'
177 elseif s:vim_encoding =~ '^ucs\|^utf'
178 let s:html_encoding = 'UTF-8'
179 else
180 let s:html_encoding = ""
181 endif
182endif
183
184
185" Set some options to make it work faster.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000186" Don't report changes for :substitute, there will be many of them.
187let s:old_title = &title
188let s:old_icon = &icon
189let s:old_et = &l:et
190let s:old_report = &report
191let s:old_search = @/
192set notitle noicon
193setlocal et
194set report=1000000
195
196" Split window to create a buffer with the HTML file.
197let s:orgbufnr = winbufnr(0)
198if expand("%") == ""
199 new Untitled.html
200else
201 new %.html
202endif
203let s:newwin = winnr()
204let s:orgwin = bufwinnr(s:orgbufnr)
205
206set modifiable
207%d
208let s:old_paste = &paste
209set paste
210let s:old_magic = &magic
211set magic
212
213if exists("use_xhtml")
214 exe "normal! a<?xml version=\"1.0\"?>\n\e"
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000215 let s:tag_close = '/>'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000216else
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000217 let s:tag_close = '>'
218endif
219
220let s:HtmlSpace = ' '
221let s:HtmlEndline = ''
222if exists("html_no_pre")
223 let s:HtmlEndline = '<br' . s:tag_close
224 if exists("use_xhtml")
225 let s:HtmlSpace = '\&#x20;'
226 else
227 let s:HtmlSpace = '\&nbsp;'
228 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229endif
230
231" HTML header, with the title and generator ;-). Left free space for the CSS,
232" to be filled at the end.
233exe "normal! a<html>\n<head>\n<title>\e"
234exe "normal! a" . expand("%:p:~") . "</title>\n\e"
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000235exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . s:tag_close . "\n\e"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000236if s:html_encoding != ""
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000237 exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000238endif
239if exists("html_use_css")
240 exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
241endif
242if exists("html_no_pre")
243 exe "normal! a</head>\n<body>\n\e"
244else
245 exe "normal! a</head>\n<body>\n<pre>\n\e"
246endif
247
248exe s:orgwin . "wincmd w"
249
250" List of all id's
251let s:idlist = ","
252
Bram Moolenaar071d4272004-06-13 20:20:40 +0000253" Loop over all lines in the original text.
254" Use html_start_line and html_end_line if they are set.
255if exists("html_start_line")
256 let s:lnum = html_start_line
257 if s:lnum < 1 || s:lnum > line("$")
258 let s:lnum = 1
259 endif
260else
261 let s:lnum = 1
262endif
263if exists("html_end_line")
264 let s:end = html_end_line
265 if s:end < s:lnum || s:end > line("$")
266 let s:end = line("$")
267 endif
268else
269 let s:end = line("$")
270endif
271
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000272if has('folding')
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000273 let s:foldfillchar = &fillchars[matchend(&fillchars, 'fold:')]
274 if s:foldfillchar == ''
275 let s:foldfillchar = '-'
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000276 endif
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000277endif
278let s:difffillchar = &fillchars[matchend(&fillchars, 'diff:')]
279if s:difffillchar == ''
280 let s:difffillchar = '-'
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000281endif
282
283
Bram Moolenaar071d4272004-06-13 20:20:40 +0000284while s:lnum <= s:end
285
Bram Moolenaar47136d72004-10-12 20:02:24 +0000286 " If there are filler lines for diff mode, show these above the line.
287 let s:filler = diff_filler(s:lnum)
288 if s:filler > 0
289 let s:n = s:filler
290 while s:n > 0
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000291 if s:numblines
292 " Indent if line numbering is on
293 let s:new = repeat(' ', strlen(s:end) + 1) . repeat(s:difffillchar, 3)
Bram Moolenaar47136d72004-10-12 20:02:24 +0000294 else
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000295 let s:new = repeat(s:difffillchar, 3)
Bram Moolenaar47136d72004-10-12 20:02:24 +0000296 endif
297
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000298 if s:n > 2 && s:n < s:filler && !exists("html_whole_filler")
299 let s:new = s:new . " " . s:filler . " inserted lines "
300 let s:n = 2
301 endif
302
303 if !exists("html_no_pre")
304 " HTML line wrapping is off--go ahead and fill to the margin
305 let s:new = s:new . repeat(s:difffillchar, &columns - strlen(s:new))
306 endif
307
308 let s:new = s:HtmlFormat(s:new, "DiffDelete")
Bram Moolenaar47136d72004-10-12 20:02:24 +0000309 exe s:newwin . "wincmd w"
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000310 exe "normal! a" . s:new . s:HtmlEndline . "\n\e"
Bram Moolenaar47136d72004-10-12 20:02:24 +0000311 exe s:orgwin . "wincmd w"
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000312
Bram Moolenaar47136d72004-10-12 20:02:24 +0000313 let s:n = s:n - 1
314 endwhile
315 unlet s:n
316 endif
317 unlet s:filler
318
319 " Start the line with the line number.
320 if s:numblines
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000321 let s:new = repeat(' ', strlen(s:end) - strlen(s:lnum)) . s:lnum . ' '
Bram Moolenaar47136d72004-10-12 20:02:24 +0000322 else
323 let s:new = ""
324 endif
325
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000326 if has('folding') && foldclosed(s:lnum) > -1
327 "
328 " This is the beginning of a folded block
329 "
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000330 let s:new = s:new . foldtextresult(s:lnum)
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000331 if !exists("html_no_pre")
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000332 " HTML line wrapping is off--go ahead and fill to the margin
333 let s:new = s:new . repeat(s:foldfillchar, &columns - strlen(s:new))
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000334 endif
335
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000336 let s:new = s:HtmlFormat(s:new, "Folded")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000337
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000338 " Skip to the end of the fold
339 let s:lnum = foldclosedend(s:lnum)
340
341 else
342 "
343 " A line that is not folded.
344 "
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000345 let s:line = getline(s:lnum)
346
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000347 let s:len = strlen(s:line)
348
349 if s:numblines
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000350 let s:new = '<span class="lnr">' . s:new . '</span>'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000351 endif
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000352
Bram Moolenaar47136d72004-10-12 20:02:24 +0000353 " Get the diff attribute, if any.
354 let s:diffattr = diff_hlID(s:lnum, 1)
355
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000356 " Loop over each character in the line
357 let s:col = 1
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000358 while s:col <= s:len || (s:col == 1 && s:diffattr)
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000359 let s:startcol = s:col " The start column for processing text
Bram Moolenaar47136d72004-10-12 20:02:24 +0000360 if s:diffattr
361 let s:id = diff_hlID(s:lnum, s:col)
362 let s:col = s:col + 1
363 " Speed loop (it's small - that's the trick)
364 " Go along till we find a change in hlID
365 while s:col <= s:len && s:id == diff_hlID(s:lnum, s:col) | let s:col = s:col + 1 | endwhile
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000366 if s:len < &columns && !exists("html_no_pre")
Bram Moolenaar47136d72004-10-12 20:02:24 +0000367 " Add spaces at the end to mark the changed line.
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000368 let s:line = s:line . repeat(' ', &columns - s:len)
369 let s:len = &columns
370 endif
Bram Moolenaar47136d72004-10-12 20:02:24 +0000371 else
372 let s:id = synID(s:lnum, s:col, 1)
373 let s:col = s:col + 1
374 " Speed loop (it's small - that's the trick)
375 " Go along till we find a change in synID
376 while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile
377 endif
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000378
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000379 " Expand tabs
380 let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
381 let idx = stridx(s:expandedtab, "\t")
382 while idx >= 0
383 let i = &ts - ((idx + s:startcol - 1) % &ts)
384 let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', i), '')
385 let idx = stridx(s:expandedtab, "\t")
386 endwhile
387
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000388 " Output the text with the same synID, with class set to {s:id_name}
389 let s:id = synIDtrans(s:id)
390 let s:id_name = synIDattr(s:id, "name", s:whatterm)
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000391 let s:new = s:new . s:HtmlFormat(s:expandedtab, s:id_name)
Bram Moolenaar7b0294c2004-10-11 10:16:09 +0000392 endwhile
393 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000394
Bram Moolenaar071d4272004-06-13 20:20:40 +0000395 exe s:newwin . "wincmd w"
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000396 exe "normal! a" . s:new . s:HtmlEndline . "\n\e"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000397 exe s:orgwin . "wincmd w"
398 let s:lnum = s:lnum + 1
399 +
400endwhile
401" Finish with the last line
402exe s:newwin . "wincmd w"
403if exists("html_no_pre")
404 exe "normal! a\n</body>\n</html>\e"
405else
406 exe "normal! a</pre>\n</body>\n</html>\e"
407endif
408
409
410" Now, when we finally know which, we define the colors and styles
411if exists("html_use_css")
412 1;/<style type="text/+1
413endif
414
415" Find out the background and foreground color.
416let s:fgc = s:HtmlColor(synIDattr(hlID("Normal"), "fg#", s:whatterm))
417let s:bgc = s:HtmlColor(synIDattr(hlID("Normal"), "bg#", s:whatterm))
418if s:fgc == ""
419 let s:fgc = ( &background == "dark" ? "#ffffff" : "#000000" )
420endif
421if s:bgc == ""
422 let s:bgc = ( &background == "dark" ? "#000000" : "#ffffff" )
423endif
424
425" Normal/global attributes
426" For Netscape 4, set <body> attributes too, though, strictly speaking, it's
427" incorrect.
428if exists("html_use_css")
429 if exists("html_no_pre")
430 execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e"
431 else
432 execute "normal! A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
433 yank
434 put
435 execute "normal! ^cwbody\e"
436 endif
437else
438 if exists("html_no_pre")
439 execute '%s:<body>:<body ' . 'bgcolor="' . s:bgc . '" text="' . s:fgc . '" style="font-family\: Courier, monospace;">'
440 else
441 execute '%s:<body>:<body ' . 'bgcolor="' . s:bgc . '" text="' . s:fgc . '">'
442 endif
443endif
444
445" Line numbering attributes
446if s:numblines
447 if exists("html_use_css")
448 execute "normal! A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
449 else
450 execute '%s+<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
451 endif
452endif
453
454" Gather attributes for all other classes
455let s:idlist = strpart(s:idlist, 1)
456while s:idlist != ""
457 let s:attr = ""
458 let s:col = stridx(s:idlist, ",")
459 let s:id = strpart(s:idlist, 0, s:col)
460 let s:idlist = strpart(s:idlist, s:col + 1)
461 let s:attr = s:CSS1(s:id)
462 let s:id_name = synIDattr(s:id, "name", s:whatterm)
463 " If the class has some attributes, export the style, otherwise DELETE all
464 " its occurences to make the HTML shorter
465 if s:attr != ""
466 if exists("html_use_css")
467 execute "normal! A\n." . s:id_name . " { " . s:attr . "}"
468 else
469 execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
470 endif
471 else
472 execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+\1+g'
473 if exists("html_use_css")
474 1;/<style type="text/+1
475 endif
476 endif
477endwhile
478
479" Add hyperlinks
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000480%s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\|&quot;\)+<A HREF="\1">\1</A>\2+ge
Bram Moolenaar071d4272004-06-13 20:20:40 +0000481
482" The DTD
483if exists("html_use_css")
484 exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
485endif
486
487" Cleanup
488%s:\s\+$::e
489
490" Restore old settings
491let &report = s:old_report
492let &title = s:old_title
493let &icon = s:old_icon
494let &paste = s:old_paste
495let &magic = s:old_magic
496let @/ = s:old_search
497exe s:orgwin . "wincmd w"
498let &l:et = s:old_et
499exe s:newwin . "wincmd w"
500
501" Save a little bit of memory (worth doing?)
502unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
503unlet s:whatterm s:idlist s:lnum s:end s:fgc s:bgc s:old_magic
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000504unlet! s:col s:id s:attr s:len s:line s:new s:expandedtab s:numblines
Bram Moolenaar071d4272004-06-13 20:20:40 +0000505unlet s:orgwin s:newwin s:orgbufnr
506delfunc s:HtmlColor
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000507delfunc s:HtmlFormat
Bram Moolenaar071d4272004-06-13 20:20:40 +0000508delfunc s:CSS1
509if !exists("html_use_css")
510 delfunc s:HtmlOpening
511 delfunc s:HtmlClosing
512endif
Bram Moolenaar35a9aaa2004-10-24 19:23:07 +0000513silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace s:HtmlEndline