diff.vim 677 B

123456789101112131415161718192021222324
  1. " Vim filetype plugin file
  2. " Language: Diff
  3. " Maintainer: Bram Moolenaar <Bram@vim.org>
  4. " Last Change: 2021 Nov 14
  5. " Only do this when not done yet for this buffer
  6. if exists("b:did_ftplugin")
  7. finish
  8. endif
  9. let b:did_ftplugin = 1
  10. let b:undo_ftplugin = "setl modeline< commentstring<"
  11. " Don't use modelines in a diff, they apply to the diffed file
  12. setlocal nomodeline
  13. " If there are comments they start with #
  14. let &l:commentstring = "# %s"
  15. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  16. let b:browsefilter = "Diff Files (*.diff)\t*.diff\nPatch Files (*.patch)\t*.h\nAll Files (*.*)\t*.*\n"
  17. let b:undo_ftplugin ..= " | unlet! b:browsefilter"
  18. endif