18c8de839SBram Moolenaar" Vim syntax file 28c8de839SBram Moolenaar" Language: git commit file 35c73622aSBram Moolenaar" Maintainer: Tim Pope <[email protected]> 48c8de839SBram Moolenaar" Filenames: *.git/COMMIT_EDITMSG 5*89bcfda6SBram Moolenaar" Last Change: 2016 Aug 29 68c8de839SBram Moolenaar 78c8de839SBram Moolenaarif exists("b:current_syntax") 88c8de839SBram Moolenaar finish 98c8de839SBram Moolenaarendif 108c8de839SBram Moolenaar 118c8de839SBram Moolenaarsyn case match 128c8de839SBram Moolenaarsyn sync minlines=50 138c8de839SBram Moolenaar 148c8de839SBram Moolenaarif has("spell") 158c8de839SBram Moolenaar syn spell toplevel 168c8de839SBram Moolenaarendif 178c8de839SBram Moolenaar 188c8de839SBram Moolenaarsyn include @gitcommitDiff syntax/diff.vim 1953bfca22SBram Moolenaarsyn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff 208c8de839SBram Moolenaar 218c8de839SBram Moolenaarsyn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl 228c8de839SBram Moolenaarsyn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell 238c8de839SBram Moolenaarsyn match gitcommitOverflow ".*" contained contains=@Spell 248c8de839SBram Moolenaarsyn match gitcommitBlank "^[^#].*" contained contains=@Spell 258c8de839SBram Moolenaarsyn match gitcommitComment "^#.*" 265c73622aSBram Moolenaarsyn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent 278c8de839SBram Moolenaarsyn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite 285c73622aSBram Moolenaarsyn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite 2953bfca22SBram Moolenaarsyn match gitcommitBranch "[^ ']\+" contained 305c73622aSBram Moolenaarsyn match gitcommitNoBranch "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment 318c8de839SBram Moolenaarsyn match gitcommitHeader "\%(^# \)\@<=.*:$" contained containedin=gitcommitComment 327a329911SBram Moolenaarsyn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^# \)\@<=\%(Author\|Committer\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent 335c73622aSBram Moolenaarsyn match gitcommitNoChanges "\%(^# \)\@<=No changes$" contained containedin=gitcommitComment 348c8de839SBram Moolenaar 358c8de839SBram Moolenaarsyn region gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold 368c8de839SBram Moolenaarsyn match gitcommitUntrackedFile "\t\@<=.*" contained 378c8de839SBram Moolenaar 3853bfca22SBram Moolenaarsyn region gitcommitDiscarded start=/^# Change\%(s not staged for commit\|d but not updated\):/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold 398c8de839SBram Moolenaarsyn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold 405c73622aSBram Moolenaarsyn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold 418c8de839SBram Moolenaar 42*89bcfda6SBram Moolenaar 43*89bcfda6SBram Moolenaarsyn match gitcommitDiscardedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite 44*89bcfda6SBram Moolenaarsyn match gitcommitSelectedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite 45*89bcfda6SBram Moolenaarsyn match gitcommitUnmergedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite 468c8de839SBram Moolenaarsyn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow 478c8de839SBram Moolenaarsyn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow 485c73622aSBram Moolenaarsyn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow 498c8de839SBram Moolenaarsyn match gitcommitDiscardedArrow " -> " contained nextgroup=gitcommitDiscardedFile 508c8de839SBram Moolenaarsyn match gitcommitSelectedArrow " -> " contained nextgroup=gitcommitSelectedFile 515c73622aSBram Moolenaarsyn match gitcommitUnmergedArrow " -> " contained nextgroup=gitcommitSelectedFile 525c73622aSBram Moolenaar 535c73622aSBram Moolenaarsyn match gitcommitWarning "\%^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl 545c73622aSBram Moolenaarsyn match gitcommitWarning "^[^#].*: needs merge$" nextgroup=gitcommitWarning skipnl contained 555c73622aSBram Moolenaarsyn match gitcommitWarning "^\%(no changes added to commit\|nothing \%(added \)\=to commit\)\>.*\%$" 568c8de839SBram Moolenaar 578c8de839SBram Moolenaarhi def link gitcommitSummary Keyword 588c8de839SBram Moolenaarhi def link gitcommitComment Comment 598c8de839SBram Moolenaarhi def link gitcommitUntracked gitcommitComment 608c8de839SBram Moolenaarhi def link gitcommitDiscarded gitcommitComment 618c8de839SBram Moolenaarhi def link gitcommitSelected gitcommitComment 625c73622aSBram Moolenaarhi def link gitcommitUnmerged gitcommitComment 638c8de839SBram Moolenaarhi def link gitcommitOnBranch Comment 648c8de839SBram Moolenaarhi def link gitcommitBranch Special 655c73622aSBram Moolenaarhi def link gitcommitNoBranch gitCommitBranch 668c8de839SBram Moolenaarhi def link gitcommitDiscardedType gitcommitType 678c8de839SBram Moolenaarhi def link gitcommitSelectedType gitcommitType 685c73622aSBram Moolenaarhi def link gitcommitUnmergedType gitcommitType 698c8de839SBram Moolenaarhi def link gitcommitType Type 705c73622aSBram Moolenaarhi def link gitcommitNoChanges gitcommitHeader 718c8de839SBram Moolenaarhi def link gitcommitHeader PreProc 728c8de839SBram Moolenaarhi def link gitcommitUntrackedFile gitcommitFile 738c8de839SBram Moolenaarhi def link gitcommitDiscardedFile gitcommitFile 748c8de839SBram Moolenaarhi def link gitcommitSelectedFile gitcommitFile 755c73622aSBram Moolenaarhi def link gitcommitUnmergedFile gitcommitFile 768c8de839SBram Moolenaarhi def link gitcommitFile Constant 778c8de839SBram Moolenaarhi def link gitcommitDiscardedArrow gitcommitArrow 788c8de839SBram Moolenaarhi def link gitcommitSelectedArrow gitcommitArrow 795c73622aSBram Moolenaarhi def link gitcommitUnmergedArrow gitcommitArrow 808c8de839SBram Moolenaarhi def link gitcommitArrow gitcommitComment 818c8de839SBram Moolenaar"hi def link gitcommitOverflow Error 828c8de839SBram Moolenaarhi def link gitcommitBlank Error 838c8de839SBram Moolenaar 848c8de839SBram Moolenaarlet b:current_syntax = "gitcommit" 85