xref: /vim-8.2.3635/runtime/ftplugin/html.vim (revision a3227e2b)
1" Vim filetype plugin file
2" Language:	html
3" Maintainer:	Dan Sharp <dwsharp at hotmail dot com>
4" Last Changed: 2004 Jul 08
5" 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
17setlocal omnifunc=htmlcomplete#CompleteTags
18
19" 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")
31    let  b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" .
32		\	"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
43