blob: da35a6a10b1f8b6a6f85fe50db565c577f8a1fac [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaara93fa7e2006-04-17 22:14:47 +00002" Language: Debian changelog files
Bram Moolenaar72540672018-02-09 22:00:53 +01003" Maintainer: Debian Vim Maintainers
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00004" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
5" Wichert Akkerman <wakkerma@debian.org>
James McCoy7b7cda62023-10-26 17:14:30 -04006" Last Change: 2023 Oct 11
Bram Moolenaarbe4e0162023-02-02 13:59:48 +00007" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debchangelog.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9" Standard syntax initialization
Bram Moolenaar85eee132018-05-06 17:57:30 +020010if exists('b:current_syntax')
Bram Moolenaar071d4272004-06-13 20:20:40 +000011 finish
12endif
13
14" Case doesn't matter for us
15syn case ignore
16
Bram Moolenaar314dd792019-02-03 15:27:20 +010017let s:urgency='urgency=\(low\|medium\|high\|emergency\|critical\)\( [^[:space:],][^,]*\)\='
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020018let s:binNMU='binary-only=yes'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020019
James McCoy7b7cda62023-10-26 17:14:30 -040020" Include Debian versioning information
21runtime! syntax/shared/debversions.vim
22
23exe 'syn match debchangelogTarget contained "\%( \%('.join(g:debSharedSupportedVersions, '\|').'\)\>[-[:alnum:]]*\)\+"'
24exe 'syn match debchangelogUnsupportedTarget contained "\%( \%('.join(g:debSharedUnsupportedVersions, '\|').'\)\>[-[:alnum:]]*\)\+"'
25
26unlet g:debSharedSupportedVersions
27unlet g:debSharedUnsupportedVersions
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010028
Bram Moolenaar071d4272004-06-13 20:20:40 +000029" Define some common expressions we can use later on
Bram Moolenaar5c736222010-01-06 20:54:52 +010030syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020031exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"'
32exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"'
Bram Moolenaar560979e2020-02-04 22:53:05 +010033syn match debchangelogUnreleased contained / UNRELEASED/
Bram Moolenaar071d4272004-06-13 20:20:40 +000034syn match debchangelogVersion contained "(.\{-})"
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000035syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
36syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000037syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
38syn match debchangelogEmail contained "<.\{-}>"
39
40" Define the entries that make up the changelog
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010041syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogUnsupportedTarget,debchangelogUnreleased,debchangelogVersion,debchangelogBinNMU oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000042syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000043syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000044
45" Associate our matches and regions with pretty colours
James McCoy7b7cda62023-10-26 17:14:30 -040046hi def link debchangelogHeader Error
47hi def link debchangelogFooter Identifier
48hi def link debchangelogEntry Normal
49hi def link debchangelogCloses Statement
50hi def link debchangelogLP Statement
51hi def link debchangelogFirstKV Identifier
52hi def link debchangelogOtherKV Identifier
53hi def link debchangelogName Comment
54hi def link debchangelogVersion Identifier
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010055hi def link debchangelogUnreleased WarningMsg
James McCoy7b7cda62023-10-26 17:14:30 -040056hi def link debchangelogEmail Special
57hi def link debchangelogTarget Identifier
58hi def link debchangelogUnsupportedTarget Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +000059
Bram Moolenaar85eee132018-05-06 17:57:30 +020060let b:current_syntax = 'debchangelog'
Bram Moolenaar071d4272004-06-13 20:20:40 +000061
62" vim: ts=8 sw=2