2 " Language: Debian changelog files
3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
4 " Former Maintainers: Gerfried Fuchs <alfie@ist.org>
5 " Wichert Akkerman <wakkerma@debian.org>
6 " Last Change: 2016 Nov 12
7 " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim
9 " Standard syntax initialization
10 if exists("b:current_syntax")
14 " Case doesn't matter for us
17 let urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\='
18 let binNMU='binary-only=yes'
20 " Define some common expressions we can use later on
21 syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
22 exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"'
23 exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"'
24 syn 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|zesty)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
25 syn match debchangelogVersion contained "(.\{-})"
26 syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
27 syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
28 syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
29 syn match debchangelogEmail contained "<.\{-}>"
31 " Define the entries that make up the changelog
32 syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline
33 syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
34 syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
36 " Associate our matches and regions with pretty colours
37 hi def link debchangelogHeader Error
38 hi def link debchangelogFooter Identifier
39 hi def link debchangelogEntry Normal
40 hi def link debchangelogCloses Statement
41 hi def link debchangelogLP Statement
42 hi def link debchangelogFirstKV Identifier
43 hi def link debchangelogOtherKV Identifier
44 hi def link debchangelogName Comment
45 hi def link debchangelogVersion Identifier
46 hi def link debchangelogTarget Identifier
47 hi def link debchangelogEmail Special
49 let b:current_syntax = "debchangelog"