1 if exists("b:current_syntax")
8 syn include @fugitiveDiff syntax/diff.vim
10 syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
12 syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/
13 syn cluster fugitiveSection contains=fugitiveSection
14 syn match fugitiveHeading /^[A-Z][a-z][^:]*\ze (\d\+)$/ contains=fugitivePreposition contained nextgroup=fugitiveCount skipwhite
15 syn match fugitiveCount /(\d\+)/hs=s+1,he=e-1 contained
16 syn match fugitivePreposition /\<\%([io]nto\|from\|to\|Rebasing\%( detached\)\=\)\>/ transparent contained nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
18 syn match fugitiveInstruction /^\l\l\+\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
19 syn match fugitiveDone /^done\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
20 syn match fugitiveStop /^stop\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
21 syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSection
22 syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@<!/ contained
23 syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=@fugitiveSection
24 syn match fugitiveHash /\<\x\{4,\}\>/ contained
26 syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=@fugitiveSection fold
28 for s:section in ['Untracked', 'Unstaged', 'Staged']
29 exe 'syn region fugitive' . s:section . 'Section start=/^\%(' . s:section . ' .*(\d\+)$\)\@=/ contains=fugitive' . s:section . 'Heading end=/^$/'
30 exe 'syn match fugitive' . s:section . 'Modifier /^[MADRCU?] / contained containedin=fugitive' . s:section . 'Section'
31 exe 'syn cluster fugitiveSection add=fugitive' . s:section . 'Section'
32 exe 'syn match fugitive' . s:section . 'Heading /^[A-Z][a-z][^:]*\ze (\d\+)$/ contains=fugitivePreposition contained nextgroup=fugitiveCount skipwhite'
36 hi def link fugitiveHeader Label
37 hi def link fugitiveHeading PreProc
38 hi def link fugitiveUntrackedHeading PreCondit
39 hi def link fugitiveUnstagedHeading Macro
40 hi def link fugitiveStagedHeading Include
41 hi def link fugitiveModifier Type
42 hi def link fugitiveUntrackedModifier StorageClass
43 hi def link fugitiveUnstagedModifier Structure
44 hi def link fugitiveStagedModifier Typedef
45 hi def link fugitiveInstruction Type
46 hi def link fugitiveStop Function
47 hi def link fugitiveHash Identifier
48 hi def link fugitiveSymbolicRef Function
49 hi def link fugitiveCount Number
51 let b:current_syntax = "fugitive"