blob: 24a9c96381bbd32b2c0b980bc5cef624f1324cf1 [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>
4" Former Maintainer: Wichert Akkerman <wakkerma@debian.org>
5" Last Change: $LastChangedDate: 2006-04-16 21:50:31 -0400 (dom, 16 apr 2006) $
6" URL: http://svn.debian.org/wsvn/pkg-vim/trunk/runtime/syntax/debchangelog.vim?op=file&rev=0&sc=0
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
8" Standard syntax initialization
9if version < 600
10 syntax clear
11elseif exists("b:current_syntax")
12 finish
13endif
14
15" Case doesn't matter for us
16syn case ignore
17
18" Define some common expressions we can use later on
19syn match debchangelogName contained "^[[:alpha:]][[:alnum:].+-]\+ "
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000020syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\="
21syn match debchangelogTarget contained "\( stable\| frozen\| unstable\| testing-proposed-updates\| experimental\| sarge-backports\| sarge-volatile\| stable-security\| testing-security\)\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +000022syn match debchangelogVersion contained "(.\{-})"
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000023syn match debchangelogCloses contained "closes:\s*\(bug\)\=#\=\s\=\d\+\(,\s*\(bug\)\=#\=\s\=\d\+\)*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000024syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
25syn match debchangelogEmail contained "<.\{-}>"
26
27" Define the entries that make up the changelog
28syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline
29syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
30syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses oneline
31
32" Associate our matches and regions with pretty colours
33if version >= 508 || !exists("did_debchangelog_syn_inits")
34 if version < 508
35 let did_debchangelog_syn_inits = 1
36 command -nargs=+ HiLink hi link <args>
37 else
38 command -nargs=+ HiLink hi def link <args>
39 endif
40
41 HiLink debchangelogHeader Error
42 HiLink debchangelogFooter Identifier
43 HiLink debchangelogEntry Normal
44 HiLink debchangelogCloses Statement
45 HiLink debchangelogUrgency Identifier
46 HiLink debchangelogName Comment
47 HiLink debchangelogVersion Identifier
48 HiLink debchangelogTarget Identifier
49 HiLink debchangelogEmail Special
50
51 delcommand HiLink
52endif
53
54let b:current_syntax = "debchangelog"
55
56" vim: ts=8 sw=2