dtd.vim (1354B)
1 " Vim filetype plugin file 2 " Language: dtd 3 " 4 " This runtime file is looking for a new maintainer. 5 " 6 " Former maintainer: Dan Sharp 7 " Last Change: 2009 Jan 20 8 " 2024 Jan 14 by Vim Project (browsefilter) 9 " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') 10 11 if exists("b:did_ftplugin") | finish | endif 12 let b:did_ftplugin = 1 13 14 " Make sure the continuation lines below do not cause problems in 15 " compatibility mode. 16 let s:save_cpo = &cpo 17 set cpo-=C 18 19 setlocal commentstring=<!--\ %s\ --> 20 setlocal comments=s:<!--,m:\ \ \ \ \ ,e:--> 21 22 setlocal formatoptions-=t 23 if !exists("g:ft_dtd_autocomment") || (g:ft_dtd_autocomment == 1) 24 setlocal formatoptions+=croql 25 endif 26 27 if exists("loaded_matchit") 28 let b:match_words = '<!--:-->,<!:>' 29 endif 30 31 " Change the :browse e filter to primarily show Java-related files. 32 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 33 let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" . 34 \ "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 40 endif 41 42 " Undo the stuff we changed. 43 let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" . 44 \ " | unlet! b:matchwords b:browsefilter" 45 46 " Restore the saved compatibility options. 47 let &cpo = s:save_cpo 48 unlet s:save_cpo