Mercurial > vim
annotate runtime/syntax/gitcommit.vim @ 14655:f2d77602d8e2
Added tag v8.1.0340 for changeset 5a384b3806ec18f3f093892c795909571b11b40f
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 31 Aug 2018 22:30:06 +0200 |
parents | 43efa4f5a8ea |
children | 5c40013d45ee |
rev | line source |
---|---|
1624 | 1 " Vim syntax file |
2 " Language: git commit file | |
2034 | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
1624 | 4 " Filenames: *.git/COMMIT_EDITMSG |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
5 " Last Change: 2016 Aug 29 |
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 | |
3465 | 19 syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold 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 |
3465 | 29 syn match gitcommitBranch "[^ ']\+" contained |
2034 | 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 | |
3465 | 38 syn region gitcommitDiscarded start=/^# Change\%(s not staged for commit\|d but not updated\):/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold |
1624 | 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 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
42 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
43 syn match gitcommitDiscardedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
44 syn match gitcommitSelectedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
45 syn match gitcommitUnmergedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite |
1624 | 46 syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow |
47 syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow | |
2034 | 48 syn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow |
1624 | 49 syn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile |
50 syn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile | |
2034 | 51 syn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitSelectedFile |
52 | |
53 syn match gitcommitWarning "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl | |
54 syn match gitcommitWarning "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained | |
55 syn match gitcommitWarning "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$" | |
1624 | 56 |
57 hi def link gitcommitSummary Keyword | |
58 hi def link gitcommitComment Comment | |
59 hi def link gitcommitUntracked gitcommitComment | |
60 hi def link gitcommitDiscarded gitcommitComment | |
61 hi def link gitcommitSelected gitcommitComment | |
2034 | 62 hi def link gitcommitUnmerged gitcommitComment |
1624 | 63 hi def link gitcommitOnBranch Comment |
64 hi def link gitcommitBranch Special | |
2034 | 65 hi def link gitcommitNoBranch gitCommitBranch |
1624 | 66 hi def link gitcommitDiscardedType gitcommitType |
67 hi def link gitcommitSelectedType gitcommitType | |
2034 | 68 hi def link gitcommitUnmergedType gitcommitType |
1624 | 69 hi def link gitcommitType Type |
2034 | 70 hi def link gitcommitNoChanges gitcommitHeader |
1624 | 71 hi def link gitcommitHeader PreProc |
72 hi def link gitcommitUntrackedFile gitcommitFile | |
73 hi def link gitcommitDiscardedFile gitcommitFile | |
74 hi def link gitcommitSelectedFile gitcommitFile | |
2034 | 75 hi def link gitcommitUnmergedFile gitcommitFile |
1624 | 76 hi def link gitcommitFile Constant |
77 hi def link gitcommitDiscardedArrow gitcommitArrow | |
78 hi def link gitcommitSelectedArrow gitcommitArrow | |
2034 | 79 hi def link gitcommitUnmergedArrow gitcommitArrow |
1624 | 80 hi def link gitcommitArrow gitcommitComment |
81 "hi def link gitcommitOverflow Error | |
82 hi def link gitcommitBlank Error | |
83 | |
84 let b:current_syntax = "gitcommit" |