blob: 4b3cbc7b343180a4c3dedb489b3fbfef6b6c7679 [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 Moolenaar92dff182014-02-11 19:15:50 +01006" Last Change: 2014 Jan 20
Bram Moolenaar251e1912011-06-19 05:09:16 +02007" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/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
19" Define some common expressions we can use later on
Bram Moolenaar5c736222010-01-06 20:54:52 +010020syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000021syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\="
Bram Moolenaar92dff182014-02-11 19:15:50 +010022syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(lucid|precise|quantal|saucy|trusty)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
Bram Moolenaar071d4272004-06-13 20:20:40 +000023syn match debchangelogVersion contained "(.\{-})"
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000024syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
25syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
Bram Moolenaar071d4272004-06-13 20:20:40 +000026syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
27syn match debchangelogEmail contained "<.\{-}>"
28
29" Define the entries that make up the changelog
30syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline
31syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000032syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
Bram Moolenaar071d4272004-06-13 20:20:40 +000033
34" Associate our matches and regions with pretty colours
35if version >= 508 || !exists("did_debchangelog_syn_inits")
36 if version < 508
37 let did_debchangelog_syn_inits = 1
38 command -nargs=+ HiLink hi link <args>
39 else
40 command -nargs=+ HiLink hi def link <args>
41 endif
42
43 HiLink debchangelogHeader Error
44 HiLink debchangelogFooter Identifier
45 HiLink debchangelogEntry Normal
46 HiLink debchangelogCloses Statement
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000047 HiLink debchangelogLP Statement
Bram Moolenaar071d4272004-06-13 20:20:40 +000048 HiLink debchangelogUrgency Identifier
49 HiLink debchangelogName Comment
50 HiLink debchangelogVersion Identifier
51 HiLink debchangelogTarget Identifier
52 HiLink debchangelogEmail Special
53
54 delcommand HiLink
55endif
56
57let b:current_syntax = "debchangelog"
58
59" vim: ts=8 sw=2