Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 2 | " 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 Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7 | |
| 8 | " Standard syntax initialization |
| 9 | if version < 600 |
| 10 | syntax clear |
| 11 | elseif exists("b:current_syntax") |
| 12 | finish |
| 13 | endif |
| 14 | |
| 15 | " Case doesn't matter for us |
| 16 | syn case ignore |
| 17 | |
| 18 | " Define some common expressions we can use later on |
| 19 | syn match debchangelogName contained "^[[:alpha:]][[:alnum:].+-]\+ " |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 20 | syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\=" |
| 21 | syn match debchangelogTarget contained "\( stable\| frozen\| unstable\| testing-proposed-updates\| experimental\| sarge-backports\| sarge-volatile\| stable-security\| testing-security\)\+" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 22 | syn match debchangelogVersion contained "(.\{-})" |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 23 | syn match debchangelogCloses contained "closes:\s*\(bug\)\=#\=\s\=\d\+\(,\s*\(bug\)\=#\=\s\=\d\+\)*" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" |
| 25 | syn match debchangelogEmail contained "<.\{-}>" |
| 26 | |
| 27 | " Define the entries that make up the changelog |
| 28 | syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline |
| 29 | syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline |
| 30 | syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses oneline |
| 31 | |
| 32 | " Associate our matches and regions with pretty colours |
| 33 | if 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 |
| 52 | endif |
| 53 | |
| 54 | let b:current_syntax = "debchangelog" |
| 55 | |
| 56 | " vim: ts=8 sw=2 |