2 " Language: Diff (context or unified)
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2005 Jun 20
6 " Quit when a (custom) syntax file was already loaded
7 if exists("b:current_syntax")
11 syn match diffOnly "^Only in .*"
12 syn match diffIdentical "^Files .* and .* are identical$"
13 syn match diffDiffer "^Files .* and .* differ$"
14 syn match diffBDiffer "^Binary files .* and .* differ$"
15 syn match diffIsA "^File .* is a .* while file .* is a .*"
16 syn match diffNoEOL "^No newline at end of file .*"
17 syn match diffCommon "^Common subdirectories: .*"
19 syn match diffRemoved "^-.*"
20 syn match diffRemoved "^<.*"
21 syn match diffAdded "^+.*"
22 syn match diffAdded "^>.*"
23 syn match diffChanged "^! .*"
25 syn match diffSubname " @@..*"ms=s+3 contained
26 syn match diffLine "^@.*" contains=diffSubname
27 syn match diffLine "^\<\d\+\>.*"
28 syn match diffLine "^\*\*\*\*.*"
30 "Some versions of diff have lines like "#c#" and "#d#" (where # is a number)
31 syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*"
33 syn match diffFile "^diff.*"
34 syn match diffFile "^+++ .*"
35 syn match diffFile "^Index: .*$"
36 syn match diffFile "^==== .*$"
37 syn match diffOldFile "^\*\*\* .*"
38 syn match diffNewFile "^--- .*"
40 syn match diffComment "^#.*"
42 " Define the default highlighting.
43 " Only used when an item doesn't have highlighting yet
44 hi def link diffOldFile diffFile
45 hi def link diffNewFile diffFile
46 hi def link diffFile Type
47 hi def link diffOnly Constant
48 hi def link diffIdentical Constant
49 hi def link diffDiffer Constant
50 hi def link diffBDiffer Constant
51 hi def link diffIsA Constant
52 hi def link diffNoEOL Constant
53 hi def link diffCommon Constant
54 hi def link diffRemoved Special
55 hi def link diffChanged PreProc
56 hi def link diffAdded Identifier
57 hi def link diffLine Statement
58 hi def link diffSubname PreProc
59 hi def link diffComment Comment
61 let b:current_syntax = "diff"