blob: 33d31ba466658eb764438bbe604c0481d0dc9e73 [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
7" For version 5.x: Clear all syntax items
8" For version 6.x: Quit when a syntax file was already loaded
9if version < 600
10 syntax clear
11elseif exists("b:current_syntax")
12 finish
13endif
14
15syn case ignore
16
17if exists('b:changelog_spacing_errors')
18 let s:spacing_errors = b:changelog_spacing_errors
19elseif exists('g:changelog_spacing_errors')
20 let s:spacing_errors = g:changelog_spacing_errors
21else
22 let s:spacing_errors = 1
23endif
24
25if s:spacing_errors
26 syn match changelogError "^ \+"
27endif
28
29syn match changelogText "^\s.*$" contains=changelogMail,changelogNumber,changelogMonth,changelogDay,changelogError
30syn match changelogHeader "^\S.*$" contains=changelogNumber,changelogMonth,changelogDay,changelogMail
31if version < 600
32 syn region changelogFiles start="^\s\+[+*]\s" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
33 syn region changelogFiles start="^\s\+[([]" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
34 syn match changelogColon contained ":\s"
35else
Bram Moolenaara5fb28b2005-10-10 21:00:54 +000036 syn region changelogFiles start="^\s\+[+*]\s" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
37 syn region changelogFiles start="^\s\+[([]" end=":" end="^$" contains=changelogBullet,changelogColon,changelogFuncs,changelogError keepend
38 syn match changelogFuncs contained "(.\{-})" extend
39 syn match changelogFuncs contained "\[.\{-}]" extend
Bram Moolenaar071d4272004-06-13 20:20:40 +000040 syn match changelogColon contained ":"
41endif
42syn match changelogBullet contained "^\s\+[+*]\s" contains=changelogError
43syn match changelogMail contained "<[A-Za-z0-9\._:+-]\+@[A-Za-z0-9\._-]\+>"
44syn keyword changelogMonth contained jan feb mar apr may jun jul aug sep oct nov dec
45syn keyword changelogDay contained mon tue wed thu fri sat sun
46syn match changelogNumber contained "[.-]*[0-9]\+"
47
48" Define the default highlighting.
49" For version 5.7 and earlier: only when not done already
50" For version 5.8 and later: only when an item doesn't have highlighting yet
51if version >= 508 || !exists("did_changelog_syntax_inits")
52 if version < 508
53 let did_changelog_syntax_inits = 1
54 command -nargs=+ HiLink hi link <args>
55 else
56 command -nargs=+ HiLink hi def link <args>
57 endif
58
59 HiLink changelogText Normal
60 HiLink changelogBullet Type
61 HiLink changelogColon Type
62 HiLink changelogFiles Comment
63 if version >= 600
64 HiLink changelogFuncs Comment
65 endif
66 HiLink changelogHeader Statement
67 HiLink changelogMail Special
68 HiLink changelogNumber Number
69 HiLink changelogMonth Number
70 HiLink changelogDay Number
71 HiLink changelogError Folded
72
73 delcommand HiLink
74endif
75
76let b:current_syntax = "changelog"
77
78" vim: ts=8