Mercurial > vim
annotate runtime/ftplugin/xml.vim @ 19231:b8fd7364befd v8.2.0174
patch 8.2.0174: various commands not completely tested
Commit: https://github.com/vim/vim/commit/5d98dc2a48156d44139b75c689bd3137ff7fe8bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 29 21:57:34 2020 +0100
patch 8.2.0174: various commands not completely tested
Problem: Various commands not completely tested.
Solution: Add more test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5551)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Jan 2020 22:00:04 +0100 |
parents | bc1a8d21c811 |
children | c968191a8557 |
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 | |
5 " Repository: https://github.com/chrisbra/vim-xml-ftplugin | |
13912 | 6 " Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> |
7 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin | |
7 | 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 | |
13912 | 15 set cpo&vim |
7 | 16 |
17 setlocal commentstring=<!--%s--> | |
13912 | 18 " Remove the middlepart from the comments section, as this causes problems: |
19 " https://groups.google.com/d/msg/vim_dev/x4GT-nqa0Kg/jvtRnEbtAnMJ | |
20 setlocal comments=s:<!--,e:--> | |
1698 | 21 |
22 setlocal formatoptions-=t | |
13912 | 23 setlocal formatoptions+=croql |
24 setlocal formatexpr=xmlformat#Format() | |
7 | 25 |
26 " XML: thanks to Johannes Zellner and Akbar Ibrahim | |
27 " - case sensitive | |
28 " - don't match empty tags <fred/> | |
29 " - match <!--, --> style comments (but not --, --) | |
30 " - match <!, > inlined dtd's. This is not perfect, as it | |
31 " gets confused for example by | |
32 " <!ENTITY gt ">"> | |
33 if exists("loaded_matchit") | |
34 let b:match_ignorecase=0 | |
35 let b:match_words = | |
36 \ '<:>,' . | |
37 \ '<\@<=!\[CDATA\[:]]>,'. | |
38 \ '<\@<=!--:-->,'. | |
39 \ '<\@<=?\k\+:?>,'. | |
40 \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'. | |
41 \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' | |
42 endif | |
43 | |
557 | 44 " For Omni completion, by Mikolaj Machowski. |
45 if exists('&ofu') | |
46 setlocal ofu=xmlcomplete#CompleteTags | |
47 endif | |
48 command! -nargs=+ XMLns call xmlcomplete#CreateConnection(<f-args>) | |
49 command! -nargs=? XMLent call xmlcomplete#CreateEntConnection(<f-args>) | |
50 | |
7 | 51 " Change the :browse e filter to primarily show xml-related files. |
13912 | 52 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
7 | 53 let b:browsefilter="XML Files (*.xml)\t*.xml\n" . |
13912 | 54 \ "DTD Files (*.dtd)\t*.dtd\n" . |
55 \ "XSD Files (*.xsd)\t*.xsd\n" . | |
56 \ "All Files (*.*)\t*.*\n" | |
7 | 57 endif |
58 | |
59 " Undo the stuff we changed. | |
13912 | 60 let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions< formatexpr< " . |
61 \ " | unlet! b:match_ignorecase b:match_words b:browsefilter" | |
7 | 62 |
63 " Restore the saved compatibility options. | |
64 let &cpo = s:save_cpo | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
2034
diff
changeset
|
65 unlet s:save_cpo |