Mercurial > vim
annotate runtime/ftplugin/html.vim @ 35198:8cb8025670aa default tip
Added tag v9.1.0418 for changeset ffa6ed03a9f2718c1c898c53de7dfe0860986ae3
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 17 May 2024 19:00:05 +0200 |
parents | 8ae680be2a51 |
children |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
29450 | 2 " Language: HTML |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Dan Sharp | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
5 " Last Change: 2024 Jan 14 |
7 | 6 |
29450 | 7 if exists("b:did_ftplugin") |
8 finish | |
9 endif | |
7 | 10 let b:did_ftplugin = 1 |
11 | |
12 let s:save_cpo = &cpo | |
13 set cpo-=C | |
14 | |
1698 | 15 setlocal matchpairs+=<:> |
7 | 16 setlocal commentstring=<!--%s--> |
1698 | 17 setlocal comments=s:<!--,m:\ \ \ \ ,e:--> |
18 | |
29450 | 19 let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<" |
20 | |
21 if get(g:, "ft_html_autocomment", 0) | |
22 setlocal formatoptions-=t formatoptions+=croql | |
23 let b:undo_ftplugin ..= " | setlocal formatoptions<" | |
1698 | 24 endif |
25 | |
844 | 26 if exists('&omnifunc') |
6009 | 27 setlocal omnifunc=htmlcomplete#CompleteTags |
28 call htmlcomplete#DetectOmniFlavor() | |
29450 | 29 let b:undo_ftplugin ..= " | setlocal omnifunc<" |
844 | 30 endif |
841 | 31 |
29450 | 32 " HTML: thanks to Johannes Zellner and Benji Fisher. |
33 if exists("loaded_matchit") && !exists("b:match_words") | |
34 let b:match_ignorecase = 1 | |
35 let b:match_words = '<!--:-->,' .. | |
36 \ '<:>,' .. | |
37 \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .. | |
38 \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .. | |
39 \ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' | |
40 let b:html_set_match_words = 1 | |
41 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words" | |
7 | 42 endif |
43 | |
44 " Change the :browse e filter to primarily show HTML-related files. | |
29450 | 45 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
46 let b:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.htm\n" .. |
29450 | 47 \ "JavaScript Files (*.js)\t*.js\n" .. |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
48 \ "Cascading StyleSheets (*.css)\t*.css\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
49 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
50 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
51 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
52 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
29450
diff
changeset
|
53 endif |
29450 | 54 let b:html_set_browsefilter = 1 |
55 let b:undo_ftplugin ..= " | unlet! b:browsefilter b:html_set_browsefilter" | |
7 | 56 endif |
57 | |
58 let &cpo = s:save_cpo | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
59 unlet s:save_cpo |