blob: cf9021ef059cff9f399c855d90b25ca357b60ecc [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: generic ChangeLog file
3" Written By: Gediminas Paulauskas <menesis@delfi.lt>
4" Maintainer: Corinna Vinschen <vinschen@redhat.com>
5" Last Change: June 1, 2003
6
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
11
12syn case ignore
13
14if exists('b:changelog_spacing_errors')
15 let s:spacing_errors = b:changelog_spacing_errors
16elseif exists('g:changelog_spacing_errors')
17 let s:spacing_errors = g:changelog_spacing_errors
18else
19 let s:spacing_errors = 1
20endif
21
22if s:spacing_errors
23 syn match changelogError "^ \+"
24endif
25
26syn match changelogText "^\s.*$" contains=changelogMail,changelogNumber,changelogMonth,changelogDay,changelogError
27syn match changelogHeader "^\S.*$" contains=changelogNumber,changelogMonth,changelogDay,changelogMail
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020028syn region changelogFiles start="^\s\+[+*]\s" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
29syn region changelogFiles start="^\s\+[([]" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
30syn match changelogFuncs contained "(.\{-})" extend
31syn match changelogFuncs contained "\[.\{-}]" extend
32syn match changelogColon contained ":"
33
Bram Moolenaar071d4272004-06-13 20:20:40 +000034syn match changelogBullet contained "^\s\+[+*]\s" contains=changelogError
35syn match changelogMail contained "<[A-Za-z0-9\._:+-]\+@[A-Za-z0-9\._-]\+>"
36syn keyword changelogMonth contained jan feb mar apr may jun jul aug sep oct nov dec
37syn keyword changelogDay contained mon tue wed thu fri sat sun
38syn match changelogNumber contained "[.-]*[0-9]\+"
39
40" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020041" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000042
Bram Moolenaarf37506f2016-08-31 22:22:10 +020043hi def link changelogText Normal
44hi def link changelogBullet Type
45hi def link changelogColon Type
46hi def link changelogFiles Comment
47hi def link changelogFuncs Comment
48hi def link changelogHeader Statement
49hi def link changelogMail Special
50hi def link changelogNumber Number
51hi def link changelogMonth Number
52hi def link changelogDay Number
53hi def link changelogError Folded
Bram Moolenaar071d4272004-06-13 20:20:40 +000054
Bram Moolenaar071d4272004-06-13 20:20:40 +000055
56let b:current_syntax = "changelog"
57
58" vim: ts=8