annotate runtime/syntax/diff.vim @ 27:a01d8d9b2a58 first-working-version

first working version.
author kono
date Mon, 27 Oct 2008 18:28:11 +0900
parents 76efa0be13f1
children c16898406ff2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
1 " Vim syntax file
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
2 " Language: Diff (context or unified)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
4 " Last Change: 2005 Jun 20
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
5
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
6 " Quit when a (custom) syntax file was already loaded
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
7 if exists("b:current_syntax")
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
8 finish
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
9 endif
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
10
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
11 syn match diffOnly "^Only in .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
12 syn match diffIdentical "^Files .* and .* are identical$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
13 syn match diffDiffer "^Files .* and .* differ$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
14 syn match diffBDiffer "^Binary files .* and .* differ$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
15 syn match diffIsA "^File .* is a .* while file .* is a .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
16 syn match diffNoEOL "^No newline at end of file .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
17 syn match diffCommon "^Common subdirectories: .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
18
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
19 syn match diffRemoved "^-.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
20 syn match diffRemoved "^<.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
21 syn match diffAdded "^+.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
22 syn match diffAdded "^>.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
23 syn match diffChanged "^! .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
24
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
25 syn match diffSubname " @@..*"ms=s+3 contained
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
26 syn match diffLine "^@.*" contains=diffSubname
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
27 syn match diffLine "^\<\d\+\>.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
28 syn match diffLine "^\*\*\*\*.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
29
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
30 "Some versions of diff have lines like "#c#" and "#d#" (where # is a number)
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
31 syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
32
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
33 syn match diffFile "^diff.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
34 syn match diffFile "^+++ .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
35 syn match diffFile "^Index: .*$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
36 syn match diffFile "^==== .*$"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
37 syn match diffOldFile "^\*\*\* .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
38 syn match diffNewFile "^--- .*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
39
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
40 syn match diffComment "^#.*"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
41
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
42 " Define the default highlighting.
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
43 " Only used when an item doesn't have highlighting yet
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
44 hi def link diffOldFile diffFile
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
45 hi def link diffNewFile diffFile
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
46 hi def link diffFile Type
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
47 hi def link diffOnly Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
48 hi def link diffIdentical Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
49 hi def link diffDiffer Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
50 hi def link diffBDiffer Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
51 hi def link diffIsA Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
52 hi def link diffNoEOL Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
53 hi def link diffCommon Constant
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
54 hi def link diffRemoved Special
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
55 hi def link diffChanged PreProc
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
56 hi def link diffAdded Identifier
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
57 hi def link diffLine Statement
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
58 hi def link diffSubname PreProc
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
59 hi def link diffComment Comment
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
60
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
61 let b:current_syntax = "diff"
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
62
76efa0be13f1 Initial revision
atsuki
parents:
diff changeset
63 " vim: ts=8 sw=2