annotate runtime/syntax/git.vim @ 1971:11c6bda3b53a v7.2.268

updated for version 7.2-268
author vimboss
date Tue, 03 Nov 2009 10:43:27 +0000
parents 18ee39301b82
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim syntax file
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: generic git output
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.info>
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
4 " Last Change: 2008 Mar 21
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
5
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
6 if exists("b:current_syntax")
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
7 finish
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
8 endif
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
9
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
10 syn case match
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
11 syn sync minlines=50
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
12
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
13 syn include @gitDiff syntax/diff.vim
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
14
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
15 syn region gitHead start=/\%^/ end=/^$/
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
16 syn region gitHead start=/\%(^commit \x\{40\}$\)\@=/ end=/^$/
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
17
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
18 " For git reflog and git show ...^{tree}, avoid sync issues
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
19 syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
20 syn match gitHead /^\x\{40\} \x\{40}\t.*/
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
21
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
22 syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --git \|$\)\@=/ contains=@gitDiff fold
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
23 syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --git \|$\)\@=/ contains=@gitDiff
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
24
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
25 syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
26 syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
27 syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
28 syn match gitMode /^\d\{6\}/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
29 syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
30 syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
31 syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
32 syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
33 syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
34
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
35 syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
36 syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
37 syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
38
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
39 syn match gitDate /\<\u\l\l \u\l\l \d\=\d \d\d:\d\d:\d\d \d\d\d\d [+-]\d\d\d\d/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
40 syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
41 syn match gitDate /\<\d\+ \l\+ ago\>/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
42 syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHash skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
43 syn match gitStage /\<\d\t\@=/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
44 syn match gitReference /\S\+\S\@!/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
45 syn match gitHash /\<\x\{40\}\>/ contained nextgroup=gitIdentity,gitStage skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
46 syn match gitHash /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
47 syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
48 syn match gitHashAbbrev /\<\x\{40\}\>/ contained nextgroup=gitHashAbbrev skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
49
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
50 hi def link gitDateHeader gitIdentityHeader
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
51 hi def link gitIdentityHeader gitIdentityKeyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
52 hi def link gitIdentityKeyword Label
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
53 hi def link gitReflogHeader gitKeyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
54 hi def link gitKeyword Keyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
55 hi def link gitIdentity String
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
56 hi def link gitEmailDelimiter Delimiter
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
57 hi def link gitEmail Special
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
58 hi def link gitDate Number
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
59 hi def link gitMode Number
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
60 hi def link gitHashAbbrev gitHash
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
61 hi def link gitHash Identifier
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
62 hi def link gitReflogMiddle gitReference
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
63 hi def link gitReference Function
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
64 hi def link gitStage gitType
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
65 hi def link gitType Type
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
66
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
67 let b:current_syntax = "git"