blob: fc55fb528f454312ba81ee92b77d42887b9cbb86 [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
42command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000043
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020044HiLink changelogText Normal
45HiLink changelogBullet Type
46HiLink changelogColon Type
47HiLink changelogFiles Comment
48HiLink changelogFuncs Comment
49HiLink changelogHeader Statement
50HiLink changelogMail Special
51HiLink changelogNumber Number
52HiLink changelogMonth Number
53HiLink changelogDay Number
54HiLink changelogError Folded
Bram Moolenaar071d4272004-06-13 20:20:40 +000055
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020056delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +000057
58let b:current_syntax = "changelog"
59
60" vim: ts=8