Runtime files update
[MacVim.git] / runtime / syntax / gitcommit.vim
blobb7a871ecd447de91e2de4fb03b8c18a32229be3c
1 " Vim syntax file
2 " Language:     git commit file
3 " Maintainer:   Tim Pope <vimNOSPAM@tpope.info>
4 " Filenames:    *.git/COMMIT_EDITMSG
5 " Last Change:  2007 Dec 20
7 if exists("b:current_syntax")
8     finish
9 endif
11 syn case match
13 if has("spell")
14     syn spell toplevel
15 endif
17 syn match   gitcommitFirstLine  "\%^[^#].*"  nextgroup=gitcommitBlank skipnl
18 syn match   gitcommitSummary    "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
19 syn match   gitcommitOverflow   ".*" contained contains=@Spell
20 syn match   gitcommitBlank      "^[^#].*" contained contains=@Spell
21 syn match   gitcommitComment    "^#.*"
22 syn region  gitcommitHead       start=/^#   / end=/^#$/ contained transparent
23 syn match   gitcommitOnBranch   "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
24 syn match   gitcommitBranch     "\S\+" contained
25 syn match   gitcommitHeader     "\%(^# \)\@<=.*:$"      contained containedin=gitcommitComment
27 syn region  gitcommitUntracked  start=/^# Untracked files:/ end=/^#$/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold
28 syn match   gitcommitUntrackedFile  "\t\@<=.*"  contained
30 syn region  gitcommitDiscarded  start=/^# Changed but not updated:/ end=/^#$/ contains=gitcommitHeader,gitcommitHead,gitcommitType fold
31 syn region  gitcommitSelected   start=/^# Changes to be committed:/ end=/^#$/ contains=gitcommitHeader,gitcommitHead,gitcommitType fold
33 syn match   gitcommitType       "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2       contained containedin=gitcommitComment nextgroup=gitcommitFile skipwhite
34 syn match   gitcommitFile       ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitArrow
35 syn match   gitcommitArrow      " -> " contained nextgroup=gitcommitFile transparent
37 hi def link gitcommitSummary            Keyword
38 hi def link gitcommitComment            Comment
39 hi def link gitcommitUntracked          gitcommitComment
40 hi def link gitcommitDiscarded          gitcommitComment
41 hi def link gitcommitSelected           gitcommitComment
42 hi def link gitcommitOnBranch           Comment
43 hi def link gitcommitBranch             Special
44 hi def link gitcommitType               Type
45 hi def link gitcommitHeader             PreProc
46 hi def link gitcommitFile               Constant
47 hi def link gitcommitUntrackedFile      gitcommitFile
48 "hi def link gitcommitOverflow          Error
49 hi def link gitcommitBlank              Error
51 let b:current_syntax = "gitcommit"
53 " vim:set ft=vim sts=4 sw=4: