annotate runtime/syntax/git.vim @ 16526:8f85d2c73e7e

Added tag v8.1.1266 for changeset 1bf49cd87e6b9fa090f844b91d777efe04a81fc8
author Bram Moolenaar <Bram@vim.org>
date Sat, 04 May 2019 17:45:05 +0200
parents f7579a31705c
children 5c40013d45ee
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
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
4 " Last Change: 2010 May 21
1624
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")
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
7 finish
1624
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=/^$/
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
16 syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
1624
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
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
22 syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
23 syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
24
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
25 syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
26 syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
27 syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
28 syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
29
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
30 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
31 syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
32 syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
33 syn match gitMode /^\d\{6\}/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
34 syn match gitIdentityKeyword /^\%(author\|committer\|tagger\)\>/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
35 syn match gitIdentityHeader /^\%(Author\|Commit\|Tagger\):/ contained containedin=gitHead nextgroup=gitIdentity skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
36 syn match gitDateHeader /^\%(AuthorDate\|CommitDate\|Date\):/ contained containedin=gitHead nextgroup=gitDate skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
37
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
38 syn match gitReflogHeader /^Reflog:/ contained containedin=gitHead nextgroup=gitReflogMiddle skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
39 syn match gitReflogHeader /^Reflog message:/ contained containedin=gitHead skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
40 syn match gitReflogMiddle /\S\+@{\d\+} (/he=e-2 nextgroup=gitIdentity
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
41
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
42 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
43 syn match gitDate /-\=\d\+ [+-]\d\d\d\d\>/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
44 syn match gitDate /\<\d\+ \l\+ ago\>/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
45 syn match gitType /\<\%(tag\|commit\|tree\|blob\)\>/ contained nextgroup=gitHash skipwhite
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
46 syn match gitStage /\<\d\t\@=/ contained
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
47 syn match gitReference /\S\+\S\@!/ contained
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
48 syn match gitHash /\<\x\{40\}\>/ contained nextgroup=gitIdentity,gitStage,gitHash skipwhite
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
49 syn match gitHash /^\<\x\{40\}\>/ containedin=gitHead contained nextgroup=gitHash skipwhite
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
50 syn match gitHashAbbrev /\<\x\{4,40\}\>/ contained nextgroup=gitHashAbbrev skipwhite
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
51 syn match gitHashAbbrev /\<\x\{4,39\}\.\.\./he=e-3 contained nextgroup=gitHashAbbrev skipwhite
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
52
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
53 syn match gitIdentity /\S.\{-\} <[^>]*>/ contained nextgroup=gitDate skipwhite
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
54 syn region gitEmail matchgroup=gitEmailDelimiter start=/</ end=/>/ keepend oneline contained containedin=gitIdentity
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
55
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
56 syn match gitNotesHeader /^Notes:\ze\n /
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
57
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
58 hi def link gitDateHeader gitIdentityHeader
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
59 hi def link gitIdentityHeader gitIdentityKeyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
60 hi def link gitIdentityKeyword Label
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
61 hi def link gitNotesHeader gitKeyword
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
62 hi def link gitReflogHeader gitKeyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
63 hi def link gitKeyword Keyword
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
64 hi def link gitIdentity String
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
65 hi def link gitEmailDelimiter Delimiter
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
66 hi def link gitEmail Special
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
67 hi def link gitDate Number
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
68 hi def link gitMode Number
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
69 hi def link gitHashAbbrev gitHash
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
70 hi def link gitHash Identifier
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
71 hi def link gitReflogMiddle gitReference
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
72 hi def link gitReference Function
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
73 hi def link gitStage gitType
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
74 hi def link gitType Type
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
75 hi def link gitDiffAdded diffAdded
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1624
diff changeset
76 hi def link gitDiffRemoved diffRemoved
1624
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
77
18ee39301b82 updated for version 7.2a
vimboss
parents:
diff changeset
78 let b:current_syntax = "git"