Mercurial > vim
annotate runtime/ftplugin/xml.vim @ 35248:bc57ec2381d6 default tip
Added tag v9.1.0433 for changeset c635bbd6e671806bf768b81d16dab956ad9b50d1
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 May 2024 08:00:05 +0200 |
parents | 8ae680be2a51 |
children |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
15131 | 2 " Language: xml |
3 " Maintainer: Christian Brabandt <cb@256bit.org> | |
4 " Last Changed: Dec 07th, 2018 | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
5 " 2024 Jan 14 by Vim Project (browsefilter) |
15131 | 6 " Repository: https://github.com/chrisbra/vim-xml-ftplugin |
28010 | 7 " Previous Maintainer: Dan Sharp |
13912 | 8 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin |
7 | 9 |
10 if exists("b:did_ftplugin") | finish | endif | |
11 let b:did_ftplugin = 1 | |
12 | |
13 " Make sure the continuation lines below do not cause problems in | |
14 " compatibility mode. | |
15 let s:save_cpo = &cpo | |
13912 | 16 set cpo&vim |
7 | 17 |
18 setlocal commentstring=<!--%s--> | |
13912 | 19 " Remove the middlepart from the comments section, as this causes problems: |
20 " https://groups.google.com/d/msg/vim_dev/x4GT-nqa0Kg/jvtRnEbtAnMJ | |
21 setlocal comments=s:<!--,e:--> | |
1698 | 22 |
23 setlocal formatoptions-=t | |
13912 | 24 setlocal formatoptions+=croql |
25 setlocal formatexpr=xmlformat#Format() | |
7 | 26 |
27 " XML: thanks to Johannes Zellner and Akbar Ibrahim | |
28 " - case sensitive | |
29 " - don't match empty tags <fred/> | |
30 " - match <!--, --> style comments (but not --, --) | |
31 " - match <!, > inlined dtd's. This is not perfect, as it | |
32 " gets confused for example by | |
33 " <!ENTITY gt ">"> | |
34 if exists("loaded_matchit") | |
35 let b:match_ignorecase=0 | |
36 let b:match_words = | |
37 \ '<:>,' . | |
38 \ '<\@<=!\[CDATA\[:]]>,'. | |
39 \ '<\@<=!--:-->,'. | |
40 \ '<\@<=?\k\+:?>,'. | |
41 \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'. | |
42 \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' | |
43 endif | |
44 | |
557 | 45 " For Omni completion, by Mikolaj Machowski. |
46 if exists('&ofu') | |
47 setlocal ofu=xmlcomplete#CompleteTags | |
48 endif | |
49 command! -nargs=+ XMLns call xmlcomplete#CreateConnection(<f-args>) | |
50 command! -nargs=? XMLent call xmlcomplete#CreateEntConnection(<f-args>) | |
51 | |
7 | 52 " Change the :browse e filter to primarily show xml-related files. |
13912 | 53 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
7 | 54 let b:browsefilter="XML Files (*.xml)\t*.xml\n" . |
13912 | 55 \ "DTD Files (*.dtd)\t*.dtd\n" . |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
56 \ "XSD Files (*.xsd)\t*.xsd\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
57 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
58 let b:browsefilter .= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
59 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
60 let b:browsefilter .= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
28010
diff
changeset
|
61 endif |
7 | 62 endif |
63 | |
64 " Undo the stuff we changed. | |
13912 | 65 let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions< formatexpr< " . |
66 \ " | unlet! b:match_ignorecase b:match_words b:browsefilter" | |
7 | 67 |
68 " Restore the saved compatibility options. | |
69 let &cpo = s:save_cpo | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
70 unlet s:save_cpo |