comparison runtime/ftplugin/xml.vim @ 13912:a9fdf01085a8

Update runtime files. commit https://github.com/vim/vim/commit/7db25fed5de1be922b8cbb0328149469606a0424 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 13 00:02:36 2018 +0200 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Sun, 13 May 2018 00:15:05 +0200
parents 94601b379f38
children bc1a8d21c811
comparison
equal deleted inserted replaced
13911:c02f0e120b11 13912:a9fdf01085a8
1 " Vim filetype plugin file 1 " Vim filetype plugin file
2 " Language: xml 2 " Language: xml
3 " Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> 3 " Maintainer: Christian Brabandt <cb@256bit.org>
4 " Last Changed: 20 Jan 2009 4 " Last Changed: May 08th, 2018
5 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin 5 " Repository: https://github.com/chrisbra/vim-xml-ftplugin
6 " Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
7 " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
6 8
7 if exists("b:did_ftplugin") | finish | endif 9 if exists("b:did_ftplugin") | finish | endif
8 let b:did_ftplugin = 1 10 let b:did_ftplugin = 1
9 11
10 " Make sure the continuation lines below do not cause problems in 12 " Make sure the continuation lines below do not cause problems in
11 " compatibility mode. 13 " compatibility mode.
12 let s:save_cpo = &cpo 14 let s:save_cpo = &cpo
13 set cpo-=C 15 set cpo&vim
14 16
15 setlocal commentstring=<!--%s--> 17 setlocal commentstring=<!--%s-->
16 setlocal comments=s:<!--,m:\ \ \ \ \ ,e:--> 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:-->
17 21
18 setlocal formatoptions-=t 22 setlocal formatoptions-=t
19 if !exists("g:ft_xml_autocomment") || (g:ft_xml_autocomment == 1) 23 setlocal formatoptions+=croql
20 setlocal formatoptions+=croql 24 setlocal formatexpr=xmlformat#Format()
21 endif
22
23 25
24 " XML: thanks to Johannes Zellner and Akbar Ibrahim 26 " XML: thanks to Johannes Zellner and Akbar Ibrahim
25 " - case sensitive 27 " - case sensitive
26 " - don't match empty tags <fred/> 28 " - don't match empty tags <fred/>
27 " - match <!--, --> style comments (but not --, --) 29 " - match <!--, --> style comments (but not --, --)
37 \ '<\@<=?\k\+:?>,'. 39 \ '<\@<=?\k\+:?>,'.
38 \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'. 40 \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'.
39 \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' 41 \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>'
40 endif 42 endif
41 43
42 "
43 " For Omni completion, by Mikolaj Machowski. 44 " For Omni completion, by Mikolaj Machowski.
44 if exists('&ofu') 45 if exists('&ofu')
45 setlocal ofu=xmlcomplete#CompleteTags 46 setlocal ofu=xmlcomplete#CompleteTags
46 endif 47 endif
47 command! -nargs=+ XMLns call xmlcomplete#CreateConnection(<f-args>) 48 command! -nargs=+ XMLns call xmlcomplete#CreateConnection(<f-args>)
48 command! -nargs=? XMLent call xmlcomplete#CreateEntConnection(<f-args>) 49 command! -nargs=? XMLent call xmlcomplete#CreateEntConnection(<f-args>)
49 50
50
51 " Change the :browse e filter to primarily show xml-related files. 51 " Change the :browse e filter to primarily show xml-related files.
52 if has("gui_win32") 52 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
53 let b:browsefilter="XML Files (*.xml)\t*.xml\n" . 53 let b:browsefilter="XML Files (*.xml)\t*.xml\n" .
54 \ "DTD Files (*.dtd)\t*.dtd\n" . 54 \ "DTD Files (*.dtd)\t*.dtd\n" .
55 \ "All Files (*.*)\t*.*\n" 55 \ "XSD Files (*.xsd)\t*.xsd\n" .
56 \ "All Files (*.*)\t*.*\n"
56 endif 57 endif
57 58
58 " Undo the stuff we changed. 59 " Undo the stuff we changed.
59 let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" . 60 let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions< formatexpr< " .
60 \ " | unlet! b:match_ignorecase b:match_words b:browsefilter" 61 \ " | unlet! b:match_ignorecase b:match_words b:browsefilter"
61 62
62 " Restore the saved compatibility options. 63 " Restore the saved compatibility options.
63 let &cpo = s:save_cpo 64 let &cpo = s:save_cpo
64 unlet s:save_cpo 65 unlet s:save_cpo