blob: 2daa48aeb45bb32221b2e178d853442bee334f30 [file] [log] [blame]
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001" Vim filetype plugin file
2" Language: Diff
Christian Brabandte978b452023-08-13 10:33:05 +02003" Maintainer: The Vim Project <https://github.com/vim/vim>
Doug Kearns93197fd2024-01-14 20:59:02 +01004" Last Change: 2023 Aug 22
Christian Brabandte978b452023-08-13 10:33:05 +02005" Former Maintainer: Bram Moolenaar <Bram@vim.org>
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00006
7" Only do this when not done yet for this buffer
8if exists("b:did_ftplugin")
9 finish
10endif
11let b:did_ftplugin = 1
12
Bram Moolenaar519cc552021-11-16 19:18:26 +000013let b:undo_ftplugin = "setl modeline< commentstring<"
Bram Moolenaar87e25fd2005-07-27 21:13:01 +000014
15" Don't use modelines in a diff, they apply to the diffed file
16setlocal nomodeline
Bram Moolenaar2547aa92020-07-26 17:00:44 +020017
18" If there are comments they start with #
Bram Moolenaar519cc552021-11-16 19:18:26 +000019let &l:commentstring = "# %s"
20
21if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Doug Kearns93197fd2024-01-14 20:59:02 +010022 let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\n"
23 if has("win32")
24 let b:browsefilter ..= "All Files (*.*)\t*\n"
25 else
26 let b:browsefilter ..= "All Files (*)\t*\n"
27 endif
Bram Moolenaar519cc552021-11-16 19:18:26 +000028 let b:undo_ftplugin ..= " | unlet! b:browsefilter"
29endif