home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / diff.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  1.1 KB  |  44 lines

  1. " Vim syntax file
  2. " Language:    Diff (context or unified)
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last change:    1997 Nov 3
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. syn match diffOnly    "^Only in.*$"
  10.  
  11. syn match diffRemoved    "^-.*$"
  12. syn match diffAdded    "^+.*$"
  13. syn match diffChanged    "^! .*$"
  14.  
  15. syn match diffLine    "^@.*$"
  16. syn match diffLine    "^\<\d\+\>.*$"
  17. syn match diffLine    "^\*\*\*\*.*$"
  18.  
  19. "Some versions of diff have lines like "#c#" and "#d#" (where # is a number)
  20. syn match diffAdded    "^\<\d\+a\d\+\(,\d\+\)\=\>"
  21. syn match diffChanged    "^\<\d\+c\d\+\>"
  22. syn match diffRemoved    "^\<\d\+d\d\+\>"
  23.  
  24. syn match diffFile    "^diff.*$"
  25. syn match diffFile    "^+++ .*$"
  26. syn match diffOldFile    "^\*\*\* .*$"
  27. syn match diffNewFile    "^--- .*$"
  28.  
  29. if !exists("did_diff_syntax_inits")
  30.   let did_diff_syntax_inits = 1
  31.   hi link diffOldFile    diffFile
  32.   hi link diffNewFile    diffFile
  33.   hi link diffFile    Type
  34.   hi link diffOnly    Constant
  35.   hi link diffRemoved    Comment
  36.   hi link diffChanged    PreProc
  37.   hi link diffAdded    Identifier
  38.   hi link diffLine    Statement
  39. endif
  40.  
  41. let b:current_syntax = "diff"
  42.  
  43. " vim: ts=8
  44.