Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: html |
Bram Moolenaar | 1588bc8 | 2022-03-08 21:35:07 +0000 | [diff] [blame] | 3 | " |
| 4 | " This runtime file is looking for a new maintainer. |
| 5 | " |
| 6 | " Former maintainer: Dan Sharp |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 7 | " Last Changed: 20 Jan 2009 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
| 9 | if exists("b:did_ftplugin") | finish | endif |
| 10 | let b:did_ftplugin = 1 |
| 11 | |
| 12 | " Make sure the continuation lines below do not cause problems in |
| 13 | " compatibility mode. |
| 14 | let s:save_cpo = &cpo |
| 15 | set cpo-=C |
| 16 | |
Bram Moolenaar | a7241f5 | 2008-06-24 20:39:31 +0000 | [diff] [blame] | 17 | setlocal matchpairs+=<:> |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 18 | setlocal commentstring=<!--%s--> |
| 19 | setlocal comments=s:<!--,m:\ \ \ \ ,e:--> |
| 20 | |
| 21 | if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) |
| 22 | setlocal formatoptions-=t formatoptions+=croql |
| 23 | endif |
| 24 | |
Bram Moolenaar | f193fff | 2006-04-27 00:02:13 +0000 | [diff] [blame] | 25 | if exists('&omnifunc') |
Bram Moolenaar | 946e27a | 2014-06-25 18:50:27 +0200 | [diff] [blame] | 26 | setlocal omnifunc=htmlcomplete#CompleteTags |
| 27 | call htmlcomplete#DetectOmniFlavor() |
Bram Moolenaar | f193fff | 2006-04-27 00:02:13 +0000 | [diff] [blame] | 28 | endif |
Bram Moolenaar | 4a85b41 | 2006-04-23 22:40:29 +0000 | [diff] [blame] | 29 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 30 | " HTML: thanks to Johannes Zellner and Benji Fisher. |
| 31 | if exists("loaded_matchit") |
| 32 | let b:match_ignorecase = 1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 33 | let b:match_words = '<:>,' . |
| 34 | \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . |
| 35 | \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . |
| 36 | \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' |
| 37 | endif |
| 38 | |
| 39 | " Change the :browse e filter to primarily show HTML-related files. |
| 40 | if has("gui_win32") |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 41 | let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" . |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 42 | \ "JavaScript Files (*.js)\t*.js\n" . |
| 43 | \ "Cascading StyleSheets (*.css)\t*.css\n" . |
| 44 | \ "All Files (*.*)\t*.*\n" |
| 45 | endif |
| 46 | |
| 47 | " Undo the stuff we changed. |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 48 | let b:undo_ftplugin = "setlocal commentstring< matchpairs< omnifunc< comments< formatoptions<" . |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 49 | \ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter" |
| 50 | |
| 51 | " Restore the saved compatibility options. |
| 52 | let &cpo = s:save_cpo |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 53 | unlet s:save_cpo |