Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 2 | " Language: dtd |
Bram Moolenaar | 1588bc8 | 2022-03-08 21:35:07 +0000 | [diff] [blame] | 3 | " |
| 4 | " This runtime file is looking for a new maintainer. |
| 5 | " |
| 6 | " Former maintainer: Dan Sharp |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 7 | " Last Change: 2009 Jan 20 |
| 8 | " 2024 Jan 14 by Vim Project (browsefilter) |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 9 | " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 | |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 19 | setlocal commentstring=<!--\ %s\ --> |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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. |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 32 | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 33 | let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" . |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 40 | endif |
| 41 | |
| 42 | " Undo the stuff we changed. |
Bram Moolenaar | e37d50a | 2008-08-06 17:06:04 +0000 | [diff] [blame] | 43 | let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" . |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 44 | \ " | unlet! b:matchwords b:browsefilter" |
| 45 | |
| 46 | " Restore the saved compatibility options. |
| 47 | let &cpo = s:save_cpo |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 48 | unlet s:save_cpo |