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: 2021 Oct 19 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 \ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm', 25 \ 'trixie', 'sid', 'rc-buggy', 26 \ 27 \ 'trusty', 'xenial', 'bionic', 'focal', 'hirsute', 'impish', 'jammy', 28 \ 'devel' 29 \ ] 30let s:unsupported = [ 31 \ 'frozen', 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', 32 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy', 33 \ 34 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', 35 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', 36 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', 37 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic', 38 \ 'disco', 'eoan', 'groovy' 39 \ ] 40let &cpo=s:cpo 41 42" Define some common expressions we can use later on 43syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " 44exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"' 45exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"' 46exe 'syn match debchangelogTarget contained "\%( \%('.join(s:supported, '\|').'\)\>[-[:alnum:]]*\)\+"' 47exe 'syn match debchangelogUnsupportedTarget contained "\%( \%('.join(s:unsupported, '\|').'\)\>[-[:alnum:]]*\)\+"' 48syn match debchangelogUnreleased contained / UNRELEASED/ 49syn match debchangelogVersion contained "(.\{-})" 50syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" 51syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" 52syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+" 53syn match debchangelogEmail contained "<.\{-}>" 54 55" Define the entries that make up the changelog 56syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogUnsupportedTarget,debchangelogUnreleased,debchangelogVersion,debchangelogBinNMU oneline 57syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline 58syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline 59 60" Associate our matches and regions with pretty colours 61hi def link debchangelogHeader Error 62hi def link debchangelogFooter Identifier 63hi def link debchangelogEntry Normal 64hi def link debchangelogCloses Statement 65hi def link debchangelogLP Statement 66hi def link debchangelogFirstKV Identifier 67hi def link debchangelogOtherKV Identifier 68hi def link debchangelogName Comment 69hi def link debchangelogVersion Identifier 70hi def link debchangelogTarget Identifier 71hi def link debchangelogUnsupportedTarget Identifier 72hi def link debchangelogUnreleased WarningMsg 73hi def link debchangelogEmail Special 74 75let b:current_syntax = 'debchangelog' 76 77" vim: ts=8 sw=2 78