blob: eb82613fefa5c120ac8fe77faf10b30bbf07f63e [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 Moolenaar1ff14ba2019-11-02 14:09:23 +01006" Last Change: 2019 Oct 20
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 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
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010020let s:cpo = &cpo
21set cpo-=C
22let s:supported = [
23 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
24 \ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
25 \ 'sid', 'rc-buggy',
26 \
27 \ 'trusty', 'xenial', 'bionic', 'disco', 'eoan', 'focal', 'devel'
28 \ ]
29let s:unsupported = [
30 \ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
31 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
32 \
33 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
34 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
35 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
36 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic'
37 \ ]
38let &cpo=s:cpo
39
Bram Moolenaar071d4272004-06-13 20:20:40 +000040" Define some common expressions we can use later on
Bram Moolenaar5c736222010-01-06 20:54:52 +010041syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020042exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"'
43exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"'
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010044exe 'syn match debchangelogTarget contained "\%( \%('.join(s:supported, '\|').'\)\>[-[:alnum:]]*\)\+"'
45exe 'syn match debchangelogUnsupportedTarget contained "\%( \%('.join(s:unsupported, '\|').'\)\>[-[:alnum:]]*\)\+"'
46syn keyword debchangelogUnreleased contained UNRELEASED
Bram Moolenaar071d4272004-06-13 20:20:40 +000047syn match debchangelogVersion contained "(.\{-})"
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000048syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
49syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000050syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
51syn match debchangelogEmail contained "<.\{-}>"
52
53" Define the entries that make up the changelog
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010054syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogUnsupportedTarget,debchangelogUnreleased,debchangelogVersion,debchangelogBinNMU oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000055syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000056syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000057
58" Associate our matches and regions with pretty colours
Bram Moolenaarf37506f2016-08-31 22:22:10 +020059hi def link debchangelogHeader Error
60hi def link debchangelogFooter Identifier
61hi def link debchangelogEntry Normal
62hi def link debchangelogCloses Statement
63hi def link debchangelogLP Statement
64hi def link debchangelogFirstKV Identifier
65hi def link debchangelogOtherKV Identifier
66hi def link debchangelogName Comment
67hi def link debchangelogVersion Identifier
68hi def link debchangelogTarget Identifier
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010069hi def link debchangelogUnsupportedTarget Identifier
70hi def link debchangelogUnreleased WarningMsg
Bram Moolenaarf37506f2016-08-31 22:22:10 +020071hi def link debchangelogEmail Special
Bram Moolenaar071d4272004-06-13 20:20:40 +000072
Bram Moolenaar85eee132018-05-06 17:57:30 +020073let b:current_syntax = 'debchangelog'
Bram Moolenaar071d4272004-06-13 20:20:40 +000074
75" vim: ts=8 sw=2