1624
|
1 " Vim syntax file
|
|
2 " Language: git commit file
|
2034
|
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
1624
|
4 " Filenames: *.git/COMMIT_EDITMSG
|
2202
|
5 " Last Change: 2010 May 21
|
1624
|
6
|
|
7 if exists("b:current_syntax")
|
2202
|
8 finish
|
1624
|
9 endif
|
|
10
|
|
11 syn case match
|
|
12 syn sync minlines=50
|
|
13
|
|
14 if has("spell")
|
2202
|
15 syn spell toplevel
|
1624
|
16 endif
|
|
17
|
|
18 syn include @gitcommitDiff syntax/diff.vim
|
2034
|
19 syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^$\|^#\@=/ contains=@gitcommitDiff
|
1624
|
20
|
|
21 syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl
|
2034
|
22 syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
|
1624
|
23 syn match gitcommitOverflow ".*" contained contains=@Spell
|
|
24 syn match gitcommitBlank "^[^#].*" contained contains=@Spell
|
|
25 syn match gitcommitComment "^#.*"
|
2034
|
26 syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
|
1624
|
27 syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
|
2034
|
28 syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
|
|
29 syn match gitcommitBranch "[^ \t']\+" contained
|
|
30 syn match gitcommitNoBranch "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment
|
1624
|
31 syn match gitcommitHeader "\%(^# \)\@<=.*:$" contained containedin=gitcommitComment
|
2202
|
32 syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^# \)\@<=\%(Author\|Committer\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent
|
2034
|
33 syn match gitcommitNoChanges "\%(^# \)\@<=No changes$" contained containedin=gitcommitComment
|
1624
|
34
|
|
35 syn region gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold
|
|
36 syn match gitcommitUntrackedFile "\t\@<=.*" contained
|
|
37
|
|
38 syn region gitcommitDiscarded start=/^# Changed but not updated:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold
|
|
39 syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold
|
2034
|
40 syn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold
|
1624
|
41
|
|
42 syn match gitcommitDiscardedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite
|
|
43 syn match gitcommitSelectedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite
|
2034
|
44 syn match gitcommitUnmergedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite
|
1624
|
45 syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow
|
|
46 syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
|
2034
|
47 syn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
|
1624
|
48 syn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile
|
|
49 syn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile
|
2034
|
50 syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitSelectedFile
|
|
51
|
|
52 syn match gitcommitWarning "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl
|
|
53 syn match gitcommitWarning "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained
|
|
54 syn match gitcommitWarning "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$"
|
1624
|
55
|
|
56 hi def link gitcommitSummary Keyword
|
|
57 hi def link gitcommitComment Comment
|
|
58 hi def link gitcommitUntracked gitcommitComment
|
|
59 hi def link gitcommitDiscarded gitcommitComment
|
|
60 hi def link gitcommitSelected gitcommitComment
|
2034
|
61 hi def link gitcommitUnmerged gitcommitComment
|
1624
|
62 hi def link gitcommitOnBranch Comment
|
|
63 hi def link gitcommitBranch Special
|
2034
|
64 hi def link gitcommitNoBranch gitCommitBranch
|
1624
|
65 hi def link gitcommitDiscardedType gitcommitType
|
|
66 hi def link gitcommitSelectedType gitcommitType
|
2034
|
67 hi def link gitcommitUnmergedType gitcommitType
|
1624
|
68 hi def link gitcommitType Type
|
2034
|
69 hi def link gitcommitNoChanges gitcommitHeader
|
1624
|
70 hi def link gitcommitHeader PreProc
|
|
71 hi def link gitcommitUntrackedFile gitcommitFile
|
|
72 hi def link gitcommitDiscardedFile gitcommitFile
|
|
73 hi def link gitcommitSelectedFile gitcommitFile
|
2034
|
74 hi def link gitcommitUnmergedFile gitcommitFile
|
1624
|
75 hi def link gitcommitFile Constant
|
|
76 hi def link gitcommitDiscardedArrow gitcommitArrow
|
|
77 hi def link gitcommitSelectedArrow gitcommitArrow
|
2034
|
78 hi def link gitcommitUnmergedArrow gitcommitArrow
|
1624
|
79 hi def link gitcommitArrow gitcommitComment
|
|
80 "hi def link gitcommitOverflow Error
|
|
81 hi def link gitcommitBlank Error
|
|
82
|
|
83 let b:current_syntax = "gitcommit"
|