codekingpro/portable-devtools
115k
1" Vim syntax file2" Language: Debian DEP3 Patch headers3" Maintainer: Gabriel Filion <gabster@lelutin.ca>4" Last Change: 2023 Jan 165" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/dep3patch.vim6"7" Specification of the DEP3 patch header format is available at:8" https://dep-team.pages.debian.net/deps/dep3/9 10" Standard syntax initialization11if exists('b:current_syntax')12 finish13endif14 15runtime! syntax/diff.vim16unlet! b:current_syntax17 18let s:cpo_save = &cpo19set cpo&vim20 21syn region dep3patchHeaders start="\%^" end="^\%(---\)\@=" contains=dep3patchKey,dep3patchMultiField22 23syn case ignore24 25syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Description\|Subject\)\ze: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contained contains=@Spell26syn region dep3patchMultiField matchgroup=dep3patchKey start="^Origin\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID,dep3patchOriginCategory oneline keepend27syn region dep3patchMultiField matchgroup=dep3patchKey start="^Bug\%(-[[:graph:]]\+\)\?\ze: *" end="$" contained contains=dep3patchHTTPUrl oneline keepend28syn region dep3patchMultiField matchgroup=dep3patchKey start="^Forwarded\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchForwardedShort oneline keepend29syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Author\|From\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend30syn region dep3patchMultiField matchgroup=dep3patchKey start="^\%(Reviewed-by\|Acked-by\)\ze: *" end="$" contained contains=dep3patchEmail oneline keepend31syn region dep3patchMultiField matchgroup=dep3patchKey start="^Last-Update\ze: *" end="$" contained contains=dep3patchISODate oneline keepend32syn region dep3patchMultiField matchgroup=dep3patchKey start="^Applied-Upstream\ze: *" end="$" contained contains=dep3patchHTTPUrl,dep3patchCommitID oneline keepend33 34syn match dep3patchHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"35syn match dep3patchCommitID contained "commit:[[:alnum:]]\+"36syn match dep3patchOriginCategory contained "\%(upstream\|backport\|vendor\|other\), "37syn match dep3patchForwardedShort contained "\%(yes\|no\|not-needed\), "38syn match dep3patchEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"39syn match dep3patchEmail "<.\{-}>"40syn match dep3patchISODate "[[:digit:]]\{4}-[[:digit:]]\{2}-[[:digit:]]\{2}"41 42" Associate our matches and regions with pretty colours43hi def link dep3patchKey Keyword44hi def link dep3patchOriginCategory Keyword45hi def link dep3patchForwardedShort Keyword46hi def link dep3patchMultiField Normal47hi def link dep3patchHTTPUrl Identifier48hi def link dep3patchCommitID Identifier49hi def link dep3patchEmail Identifier50hi def link dep3patchISODate Identifier51 52let b:current_syntax = 'dep3patch'53 54let &cpo = s:cpo_save55unlet s:cpo_save56 57" vim: ts=8 sw=258 