blob: d0c658c75efb8afb9bda1c7ad5a6a482ebb5a7e0 [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
3" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00004" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
5" Wichert Akkerman <wakkerma@debian.org>
Bram Moolenaar06d2d382016-05-20 17:24:11 +02006" Last Change: 2016 Apr 24
Bram Moolenaar256972a2015-12-29 19:10:25 +01007" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9" Standard syntax initialization
10if version < 600
11 syntax clear
12elseif exists("b:current_syntax")
13 finish
14endif
15
16" Case doesn't matter for us
17syn case ignore
18
Bram Moolenaarf2571c62015-06-09 19:44:55 +020019let urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\='
20let binNMU='binary-only=yes'
21
Bram Moolenaar071d4272004-06-13 20:20:40 +000022" Define some common expressions we can use later on
Bram Moolenaar5c736222010-01-06 20:54:52 +010023syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
Bram Moolenaarf2571c62015-06-09 19:44:55 +020024exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"'
25exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"'
Bram Moolenaar06d2d382016-05-20 17:24:11 +020026syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial|yakkety)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
Bram Moolenaar071d4272004-06-13 20:20:40 +000027syn match debchangelogVersion contained "(.\{-})"
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000028syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
29syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000030syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
31syn match debchangelogEmail contained "<.\{-}>"
32
33" Define the entries that make up the changelog
Bram Moolenaarf2571c62015-06-09 19:44:55 +020034syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000035syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000036syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
38" Associate our matches and regions with pretty colours
39if version >= 508 || !exists("did_debchangelog_syn_inits")
40 if version < 508
41 let did_debchangelog_syn_inits = 1
42 command -nargs=+ HiLink hi link <args>
43 else
44 command -nargs=+ HiLink hi def link <args>
45 endif
46
47 HiLink debchangelogHeader Error
48 HiLink debchangelogFooter Identifier
49 HiLink debchangelogEntry Normal
50 HiLink debchangelogCloses Statement
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000051 HiLink debchangelogLP Statement
Bram Moolenaarf2571c62015-06-09 19:44:55 +020052 HiLink debchangelogFirstKV Identifier
53 HiLink debchangelogOtherKV Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +000054 HiLink debchangelogName Comment
55 HiLink debchangelogVersion Identifier
56 HiLink debchangelogTarget Identifier
57 HiLink debchangelogEmail Special
58
59 delcommand HiLink
60endif
61
62let b:current_syntax = "debchangelog"
63
64" vim: ts=8 sw=2