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: 2008-01-16
7 " URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/debchangelog.vim;hb=debian
9 " Standard syntax initialization
12 elseif exists("b:current_syntax")
16 " Case doesn't matter for us
19 " Define some common expressions we can use later on
20 syn match debchangelogName contained "^[[:alpha:]][[:alnum:].+-]\+ "
21 syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\="
22 syn match debchangelogTarget contained "\v %(%(old)=stable|frozen|unstable|%(testing-|%(old)=stable-)=proposed-updates|experimental|%(sarge|etch|lenny)-%(backports|volatile)|%(testing|%(old)=stable)-security|%(dapper|feisty|gutsy|hardy|intrepid)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
23 syn match debchangelogVersion contained "(.\{-})"
24 syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
25 syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
26 syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
27 syn match debchangelogEmail contained "<.\{-}>"
29 " Define the entries that make up the changelog
30 syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline
31 syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
32 syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
34 " Associate our matches and regions with pretty colours
35 if version >= 508 || !exists("did_debchangelog_syn_inits")
37 let did_debchangelog_syn_inits = 1
38 command -nargs=+ HiLink hi link <args>
40 command -nargs=+ HiLink hi def link <args>
43 HiLink debchangelogHeader Error
44 HiLink debchangelogFooter Identifier
45 HiLink debchangelogEntry Normal
46 HiLink debchangelogCloses Statement
47 HiLink debchangelogLP Statement
48 HiLink debchangelogUrgency Identifier
49 HiLink debchangelogName Comment
50 HiLink debchangelogVersion Identifier
51 HiLink debchangelogTarget Identifier
52 HiLink debchangelogEmail Special
57 let b:current_syntax = "debchangelog"