blob: ce0339522b5e29711c743a6f2100346815620e82 [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>
Bram Moolenaarba3ff532018-11-04 14:45:49 +01006" Last Change: 2018 Oct 30
Bram Moolenaar72540672018-02-09 22:00:53 +01007" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/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 Moolenaar3ec574f2017-06-13 18:12:01 +020017let s:urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\='
18let s:binNMU='binary-only=yes'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020019
Bram Moolenaar071d4272004-06-13 20:20:40 +000020" Define some common expressions we can use later on
Bram Moolenaar5c736222010-01-06 20:54:52 +010021syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020022exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"'
23exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"'
Bram Moolenaarba3ff532018-11-04 14:45:49 +010024syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|%(wheezy|jessie)%(-backports%(-sloppy)=|-security)=|stretch%(-backports|-security)=|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
Bram Moolenaar071d4272004-06-13 20:20:40 +000025syn match debchangelogVersion contained "(.\{-})"
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000026syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
27syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000028syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
29syn match debchangelogEmail contained "<.\{-}>"
30
31" Define the entries that make up the changelog
Bram Moolenaarf2571c62015-06-09 19:44:55 +020032syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000033syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000034syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000035
36" Associate our matches and regions with pretty colours
Bram Moolenaarf37506f2016-08-31 22:22:10 +020037hi def link debchangelogHeader Error
38hi def link debchangelogFooter Identifier
39hi def link debchangelogEntry Normal
40hi def link debchangelogCloses Statement
41hi def link debchangelogLP Statement
42hi def link debchangelogFirstKV Identifier
43hi def link debchangelogOtherKV Identifier
44hi def link debchangelogName Comment
45hi def link debchangelogVersion Identifier
46hi def link debchangelogTarget Identifier
47hi def link debchangelogEmail Special
Bram Moolenaar071d4272004-06-13 20:20:40 +000048
Bram Moolenaar85eee132018-05-06 17:57:30 +020049let b:current_syntax = 'debchangelog'
Bram Moolenaar071d4272004-06-13 20:20:40 +000050
51" vim: ts=8 sw=2