diff.vim (852B)
1 " Vim filetype plugin file 2 " Language: Diff 3 " Maintainer: The Vim Project <https://github.com/vim/vim> 4 " Last Change: 2023 Aug 22 5 " Former Maintainer: Bram Moolenaar <Bram@vim.org> 6 7 " Only do this when not done yet for this buffer 8 if exists("b:did_ftplugin") 9 finish 10 endif 11 let b:did_ftplugin = 1 12 13 let b:undo_ftplugin = "setl modeline< commentstring<" 14 15 " Don't use modelines in a diff, they apply to the diffed file 16 setlocal nomodeline 17 18 " If there are comments they start with # 19 let &l:commentstring = "# %s" 20 21 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 22 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 28 let b:undo_ftplugin ..= " | unlet! b:browsefilter" 29 endif