1" Vim syntax file 2" Language: Debian changelog files 3" Maintainer: Debian Vim Maintainers 4" Former Maintainers: Gerfried Fuchs <[email protected]> 5" Wichert Akkerman <[email protected]> 6" Last Change: 2020 Apr 27 7" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/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\|emergency\|critical\)\( [^[:space:],][^,]*\)\=' 18let s:binNMU='binary-only=yes' 19 20let s:cpo = &cpo 21set cpo-=C 22let s:supported = [ 23 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 24 \ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm', 25 \ 'sid', 'rc-buggy', 26 \ 27 \ 'trusty', 'xenial', 'bionic', 'eoan', 'focal', 'groovy', 'devel' 28 \ ] 29let s:unsupported = [ 30 \ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', 31 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 32 \ 33 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', 34 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', 35 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', 36 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic', 37 \ 'disco' 38 \ ] 39let &cpo=s:cpo 40 41" Define some common expressions we can use later on 42syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " 43exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"' 44exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"' 45exe 'syn match debchangelogTarget contained "\%( \%('.join(s:supported, '\|').'\)\>[-[:alnum:]]*\)\+"' 46exe 'syn match debchangelogUnsupportedTarget contained "\%( \%('.join(s:unsupported, '\|').'\)\>[-[:alnum:]]*\)\+"' 47syn match debchangelogUnreleased contained / UNRELEASED/ 48syn match debchangelogVersion contained "(.\{-})" 49syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" 50syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" 51syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" 52syn match debchangelogEmail contained "<.\{-}>" 53 54" Define the entries that make up the changelog 55syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogUnsupportedTarget,debchangelogUnreleased,debchangelogVersion,debchangelogBinNMU oneline 56syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline 57syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline 58 59" Associate our matches and regions with pretty colours 60hi def link debchangelogHeader Error 61hi def link debchangelogFooter Identifier 62hi def link debchangelogEntry Normal 63hi def link debchangelogCloses Statement 64hi def link debchangelogLP Statement 65hi def link debchangelogFirstKV Identifier 66hi def link debchangelogOtherKV Identifier 67hi def link debchangelogName Comment 68hi def link debchangelogVersion Identifier 69hi def link debchangelogTarget Identifier 70hi def link debchangelogUnsupportedTarget Identifier 71hi def link debchangelogUnreleased WarningMsg 72hi def link debchangelogEmail Special 73 74let b:current_syntax = 'debchangelog' 75 76" vim: ts=8 sw=2 77