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: 2017 Apr 23 7" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debchangelog.vim 8 9" Standard syntax initialization 10if exists("b:current_syntax") 11 finish 12endif 13 14" Case doesn't matter for us 15syn case ignore 16 17let s:urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\=' 18let s:binNMU='binary-only=yes' 19 20" Define some common expressions we can use later on 21syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " 22exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"' 23exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"' 24syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|%(wheezy|jessie)%(-backports%(-sloppy)=|-security)=|stretch%(-backports|-security)=|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty|artful)%(-%(security|proposed|updates|backports|commercial|partner))=)+" 25syn match debchangelogVersion contained "(.\{-})" 26syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" 27syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" 28syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" 29syn match debchangelogEmail contained "<.\{-}>" 30 31" Define the entries that make up the changelog 32syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline 33syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline 34syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline 35 36" Associate our matches and regions with pretty colours 37hi def link debchangelogHeader Error 38hi def link debchangelogFooter Identifier 39hi def link debchangelogEntry Normal 40hi def link debchangelogCloses Statement 41hi def link debchangelogLP Statement 42hi def link debchangelogFirstKV Identifier 43hi def link debchangelogOtherKV Identifier 44hi def link debchangelogName Comment 45hi def link debchangelogVersion Identifier 46hi def link debchangelogTarget Identifier 47hi def link debchangelogEmail Special 48 49let b:current_syntax = "debchangelog" 50 51" vim: ts=8 sw=2 52