1" Vim syntax file 2" Language: Debian changelog files 3" Maintainer: Debian Vim Maintainers <[email protected]> 4" Former Maintainers: Gerfried Fuchs <[email protected]> 5" Wichert Akkerman <[email protected]> 6" Last Change: 2015 Oct 24 7" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim 8 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 19let urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\=' 20let binNMU='binary-only=yes' 21 22" Define some common expressions we can use later on 23syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " 24exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"' 25exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"' 26syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|precise|trusty|vivid|wily|xenial)%(-%(security|proposed|updates|backports|commercial|partner))=)+" 27syn match debchangelogVersion contained "(.\{-})" 28syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" 29syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" 30syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" 31syn match debchangelogEmail contained "<.\{-}>" 32 33" Define the entries that make up the changelog 34syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline 35syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline 36syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline 37 38" Associate our matches and regions with pretty colours 39if version >= 508 || !exists("did_debchangelog_syn_inits") 40 if version < 508 41 let did_debchangelog_syn_inits = 1 42 command -nargs=+ HiLink hi link <args> 43 else 44 command -nargs=+ HiLink hi def link <args> 45 endif 46 47 HiLink debchangelogHeader Error 48 HiLink debchangelogFooter Identifier 49 HiLink debchangelogEntry Normal 50 HiLink debchangelogCloses Statement 51 HiLink debchangelogLP Statement 52 HiLink debchangelogFirstKV Identifier 53 HiLink debchangelogOtherKV Identifier 54 HiLink debchangelogName Comment 55 HiLink debchangelogVersion Identifier 56 HiLink debchangelogTarget Identifier 57 HiLink debchangelogEmail Special 58 59 delcommand HiLink 60endif 61 62let b:current_syntax = "debchangelog" 63 64" vim: ts=8 sw=2 65