Update stgedit.vim for Patch header
[stgit.git] / contrib / vim / syntax / stgedit.vim
blob2ae3b3124ba6e3bb23df69303e87a1a9ddce379f
1 " Vim syntax file
2 " Language:     StGit 'stg edit' commit message file
3 " Author:       Zane Bitter <zane.bitter@alliedtelesis.co.nz>
5 if exists("b:current_syntax")
6   finish
7 endif
9 syn include @stgDiff syntax/diff.vim
12 syn case match
13 syn sync minlines=50
16 if has("spell")
17   syn spell toplevel
18 endif
21 syn region   stgeditHeaders     start="\%^\S\+:" end="^$" nextgroup=stgeditFirstLine skipempty contains=stgeditHeaderKey,stgeditEmailAddr
22 syn match    stgeditHeaderKey   "^\S\+:" contained
23 syn match    stgeditEmailAddr   "<.\{-}>" contained contains=@NoSpell
24 syn match    stgeditFirstLine   "^.\+" contained nextgroup=stgeditDiffs,stgeditComment,stgeditBlank skipnl
25 syn match    stgeditSummary     "^.\{0,50\}" contained containedin=stgeditFirstLine nextgroup=stgeditOverflow contains=@Spell
26 syn match    stgeditOverflow    ".*" contained contains=@Spell
27 syn match    stgeditBlank       "^.\+" contained contains=@Spell
28 syn match    stgeditComment     "^#.*"
29 syn region   stgeditDiffs       start="^---" end="%$" contains=@stgDiff fold
30 syn region   stgeditDiff        start="^\%(diff --git \)\@=" end="^\%(diff --git \|$\)\@=" contained containedin=stgeditDiffs contains=@stgDiff fold
32 hi def link  stgeditHeaderKey   Type
33 hi def link  stgeditEmailAddr   Special
34 hi def link  stgeditSummary     Keyword
35 hi def link  stgeditComment     Comment
36 hi def link  stgeditBlank       Error
39 let b:current_syntax = "stgedit"