blob: 8cff5377645d95c61e64b666d1b39103a600b203 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: xml
3" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
4" Last Changed: 2003 Sep 29
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
17" XML: thanks to Johannes Zellner and Akbar Ibrahim
18" - case sensitive
19" - don't match empty tags <fred/>
20" - match <!--, --> style comments (but not --, --)
21" - match <!, > inlined dtd's. This is not perfect, as it
22" gets confused for example by
23" <!ENTITY gt ">">
24if exists("loaded_matchit")
25 let b:match_ignorecase=0
26 let b:match_words =
27 \ '<:>,' .
28 \ '<\@<=!\[CDATA\[:]]>,'.
29 \ '<\@<=!--:-->,'.
30 \ '<\@<=?\k\+:?>,'.
31 \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'.
32 \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>'
33endif
34
Bram Moolenaara5792f52005-11-23 21:25:05 +000035"
36" For Omni completion, by Mikolaj Machowski.
37if exists('&ofu')
38 setlocal ofu=xmlcomplete#CompleteTags
39endif
40command! -nargs=+ XMLns call xmlcomplete#CreateConnection(<f-args>)
41command! -nargs=? XMLent call xmlcomplete#CreateEntConnection(<f-args>)
42
43
Bram Moolenaar071d4272004-06-13 20:20:40 +000044" Change the :browse e filter to primarily show xml-related files.
45if has("gui_win32")
46 let b:browsefilter="XML Files (*.xml)\t*.xml\n" .
47 \ "DTD Files (*.dtd)\t*.dtd\n" .
48 \ "All Files (*.*)\t*.*\n"
49endif
50
51" Undo the stuff we changed.
52let b:undo_ftplugin = "setlocal cms<" .
53 \ " | unlet! b:match_ignorecase b:match_words b:browsefilter"
54
55" Restore the saved compatibility options.
56let &cpo = s:save_cpo