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> |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 4 | " Former Maintainers: Gerfried Fuchs <alfie@ist.org> |
| 5 | " Wichert Akkerman <wakkerma@debian.org> |
Bram Moolenaar | 07d8779 | 2014-07-19 14:04:47 +0200 | [diff] [blame] | 6 | " Last Change: 2014 Jul 11 |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 7 | " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debchangelog.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
| 9 | " Standard syntax initialization |
| 10 | if version < 600 |
| 11 | syntax clear |
| 12 | elseif exists("b:current_syntax") |
| 13 | finish |
| 14 | endif |
| 15 | |
| 16 | " Case doesn't matter for us |
| 17 | syn case ignore |
| 18 | |
| 19 | " Define some common expressions we can use later on |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 20 | syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 21 | syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\=" |
Bram Moolenaar | 07d8779 | 2014-07-19 14:04:47 +0200 | [diff] [blame] | 22 | syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(devel|lucid|precise|trusty|utopic)%(-%(security|proposed|updates|backports|commercial|partner))=)+" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | syn match debchangelogVersion contained "(.\{-})" |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 24 | syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" |
| 25 | syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 26 | syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" |
| 27 | syn match debchangelogEmail contained "<.\{-}>" |
| 28 | |
| 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 |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 32 | syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 33 | |
| 34 | " Associate our matches and regions with pretty colours |
| 35 | if 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 Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 47 | HiLink debchangelogLP Statement |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 48 | HiLink debchangelogUrgency Identifier |
| 49 | HiLink debchangelogName Comment |
| 50 | HiLink debchangelogVersion Identifier |
| 51 | HiLink debchangelogTarget Identifier |
| 52 | HiLink debchangelogEmail Special |
| 53 | |
| 54 | delcommand HiLink |
| 55 | endif |
| 56 | |
| 57 | let b:current_syntax = "debchangelog" |
| 58 | |
| 59 | " vim: ts=8 sw=2 |