blob: f2a0820be923a62fc97cd380f40341d282cabdc7 [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>
4" Last Change: 2023 Aug 10
5" 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")
22 let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\nAll Files (*.*)\t*.*\n"
23 let b:undo_ftplugin ..= " | unlet! b:browsefilter"
24endif