Mercurial > vim
comparison runtime/ftplugin/html.vim @ 6009:7b83c190d370
Updated runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 25 Jun 2014 18:50:27 +0200 |
parents | 94601b379f38 |
children | c968191a8557 |
comparison
equal
deleted
inserted
replaced
6008:0d229e42670c | 6009:7b83c190d370 |
---|---|
18 | 18 |
19 if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) | 19 if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) |
20 setlocal formatoptions-=t formatoptions+=croql | 20 setlocal formatoptions-=t formatoptions+=croql |
21 endif | 21 endif |
22 | 22 |
23 | |
24 if exists('&omnifunc') | 23 if exists('&omnifunc') |
25 " Distinguish between HTML versions | 24 setlocal omnifunc=htmlcomplete#CompleteTags |
26 " To use with other HTML versions add another | 25 call htmlcomplete#DetectOmniFlavor() |
27 " elseif condition to match proper DOCTYPE | |
28 setlocal omnifunc=htmlcomplete#CompleteTags | |
29 | |
30 if &filetype == 'xhtml' | |
31 let b:html_omni_flavor = 'xhtml10s' | |
32 else | |
33 let b:html_omni_flavor = 'html401t' | |
34 endif | |
35 let i = 1 | |
36 let line = "" | |
37 while i < 10 && i < line("$") | |
38 let line = getline(i) | |
39 if line =~ '<!DOCTYPE.*\<DTD ' | |
40 break | |
41 endif | |
42 let i += 1 | |
43 endwhile | |
44 if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above | |
45 if line =~ ' HTML 3\.2' | |
46 let b:html_omni_flavor = 'html32' | |
47 elseif line =~ ' XHTML 1\.1' | |
48 let b:html_omni_flavor = 'xhtml11' | |
49 else " two-step detection with strict/frameset/transitional | |
50 if line =~ ' XHTML 1\.0' | |
51 let b:html_omni_flavor = 'xhtml10' | |
52 elseif line =~ ' HTML 4\.01' | |
53 let b:html_omni_flavor = 'html401' | |
54 elseif line =~ ' HTML 4.0\>' | |
55 let b:html_omni_flavor = 'html40' | |
56 endif | |
57 if line =~ '\<Transitional\>' | |
58 let b:html_omni_flavor .= 't' | |
59 elseif line =~ '\<Frameset\>' | |
60 let b:html_omni_flavor .= 'f' | |
61 else | |
62 let b:html_omni_flavor .= 's' | |
63 endif | |
64 endif | |
65 endif | |
66 endif | 26 endif |
67 | 27 |
68 " HTML: thanks to Johannes Zellner and Benji Fisher. | 28 " HTML: thanks to Johannes Zellner and Benji Fisher. |
69 if exists("loaded_matchit") | 29 if exists("loaded_matchit") |
70 let b:match_ignorecase = 1 | 30 let b:match_ignorecase = 1 |