blob: 4f7e97daf97a414aa9ef5ceed1ea70af3f979b8e [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: html
3" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
Bram Moolenaar8299df92004-07-10 09:47:34 +00004" Last Changed: 2004 Jul 08
Bram Moolenaar071d4272004-06-13 20:20:40 +00005" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
6
7if exists("b:did_ftplugin") | finish | endif
8let b:did_ftplugin = 1
9
10" Make sure the continuation lines below do not cause problems in
11" compatibility mode.
12let s:save_cpo = &cpo
13set cpo-=C
14
15setlocal commentstring=<!--%s-->
16
Bram Moolenaarf75a9632005-09-13 21:20:47 +000017setlocal omnifunc=htmlcomplete#CompleteTags
18
Bram Moolenaar071d4272004-06-13 20:20:40 +000019" HTML: thanks to Johannes Zellner and Benji Fisher.
20if exists("loaded_matchit")
21 let b:match_ignorecase = 1
22 let b:match_skip = 's:Comment'
23 let b:match_words = '<:>,' .
24 \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
25 \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
26 \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
27endif
28
29" Change the :browse e filter to primarily show HTML-related files.
30if has("gui_win32")
Bram Moolenaar8299df92004-07-10 09:47:34 +000031 let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" .
Bram Moolenaar071d4272004-06-13 20:20:40 +000032 \ "JavaScript Files (*.js)\t*.js\n" .
33 \ "Cascading StyleSheets (*.css)\t*.css\n" .
34 \ "All Files (*.*)\t*.*\n"
35endif
36
37" Undo the stuff we changed.
38let b:undo_ftplugin = "setlocal commentstring<"
39 \ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter"
40
41" Restore the saved compatibility options.
42let &cpo = s:save_cpo