Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: html |
| 3 | " Maintainer: Dan Sharp <dwsharp at hotmail dot com> |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 4 | " Last Changed: 2004 Jul 08 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 5 | " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin |
| 6 | |
| 7 | if exists("b:did_ftplugin") | finish | endif |
| 8 | let b:did_ftplugin = 1 |
| 9 | |
| 10 | " Make sure the continuation lines below do not cause problems in |
| 11 | " compatibility mode. |
| 12 | let s:save_cpo = &cpo |
| 13 | set cpo-=C |
| 14 | |
| 15 | setlocal commentstring=<!--%s--> |
| 16 | |
Bram Moolenaar | f75a963 | 2005-09-13 21:20:47 +0000 | [diff] [blame] | 17 | setlocal omnifunc=htmlcomplete#CompleteTags |
| 18 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 19 | " HTML: thanks to Johannes Zellner and Benji Fisher. |
| 20 | if 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>' |
| 27 | endif |
| 28 | |
| 29 | " Change the :browse e filter to primarily show HTML-related files. |
| 30 | if has("gui_win32") |
Bram Moolenaar | 8299df9 | 2004-07-10 09:47:34 +0000 | [diff] [blame] | 31 | let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" . |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 32 | \ "JavaScript Files (*.js)\t*.js\n" . |
| 33 | \ "Cascading StyleSheets (*.css)\t*.css\n" . |
| 34 | \ "All Files (*.*)\t*.*\n" |
| 35 | endif |
| 36 | |
| 37 | " Undo the stuff we changed. |
| 38 | let 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. |
| 42 | let &cpo = s:save_cpo |