blob: f97014814bf624abac7d50a1ebef016fd82a03db [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
Doug Kearns93197fd2024-01-14 20:59:02 +01002" Language: dtd
Bram Moolenaar1588bc82022-03-08 21:35:07 +00003"
4" This runtime file is looking for a new maintainer.
5"
6" Former maintainer: Dan Sharp
Doug Kearns93197fd2024-01-14 20:59:02 +01007" Last Change: 2009 Jan 20
8" 2024 Jan 14 by Vim Project (browsefilter)
Riley Bruins0a083062024-06-03 20:40:45 +02009" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
Bram Moolenaar071d4272004-06-13 20:20:40 +000010
11if exists("b:did_ftplugin") | finish | endif
12let b:did_ftplugin = 1
13
14" Make sure the continuation lines below do not cause problems in
15" compatibility mode.
16let s:save_cpo = &cpo
17set cpo-=C
18
Riley Bruins0a083062024-06-03 20:40:45 +020019setlocal commentstring=<!--\ %s\ -->
Bram Moolenaare37d50a2008-08-06 17:06:04 +000020setlocal comments=s:<!--,m:\ \ \ \ \ ,e:-->
21
22setlocal formatoptions-=t
23if !exists("g:ft_dtd_autocomment") || (g:ft_dtd_autocomment == 1)
24 setlocal formatoptions+=croql
25endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000026
27if exists("loaded_matchit")
28 let b:match_words = '<!--:-->,<!:>'
29endif
30
31" Change the :browse e filter to primarily show Java-related files.
Doug Kearns93197fd2024-01-14 20:59:02 +010032if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Bram Moolenaar071d4272004-06-13 20:20:40 +000033 let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" .
Doug Kearns93197fd2024-01-14 20:59:02 +010034 \ "XML Files (*.xml)\t*.xml\n"
35 if has("win32")
36 let b:browsefilter .= "All Files (*.*)\t*\n"
37 else
38 let b:browsefilter .= "All Files (*)\t*\n"
39 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000040endif
41
42" Undo the stuff we changed.
Bram Moolenaare37d50a2008-08-06 17:06:04 +000043let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" .
Bram Moolenaar071d4272004-06-13 20:20:40 +000044 \ " | unlet! b:matchwords b:browsefilter"
45
46" Restore the saved compatibility options.
47let &cpo = s:save_cpo
Bram Moolenaar84f72352012-03-11 15:57:40 +010048unlet s:save_cpo