dtd.vim 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. if exists("b:did_ftplugin") | finish | endif
  10. let b:did_ftplugin = 1
  11. " Make sure the continuation lines below do not cause problems in
  12. " compatibility mode.
  13. let s:save_cpo = &cpo
  14. set cpo-=C
  15. setlocal commentstring=<!--%s-->
  16. setlocal comments=s:<!--,m:\ \ \ \ \ ,e:-->
  17. setlocal formatoptions-=t
  18. if !exists("g:ft_dtd_autocomment") || (g:ft_dtd_autocomment == 1)
  19. setlocal formatoptions+=croql
  20. endif
  21. if exists("loaded_matchit")
  22. let b:match_words = '<!--:-->,<!:>'
  23. endif
  24. " Change the :browse e filter to primarily show Java-related files.
  25. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  26. let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" .
  27. \ "XML Files (*.xml)\t*.xml\n"
  28. if has("win32")
  29. let b:browsefilter .= "All Files (*.*)\t*\n"
  30. else
  31. let b:browsefilter .= "All Files (*)\t*\n"
  32. endif
  33. endif
  34. " Undo the stuff we changed.
  35. let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" .
  36. \ " | unlet! b:matchwords b:browsefilter"
  37. " Restore the saved compatibility options.
  38. let &cpo = s:save_cpo
  39. unlet s:save_cpo