Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Debian copyright file |
| 3 | " Maintainer: Debian Vim Maintainers |
josch | 4c45425 | 2024-07-28 17:05:06 +0200 | [diff] [blame] | 4 | " Last Change: 2024 Jul 28 |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 5 | " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcopyright.vim |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 6 | |
| 7 | " Standard syntax initialization |
| 8 | if exists('b:current_syntax') |
| 9 | finish |
| 10 | endif |
| 11 | |
| 12 | let s:cpo_save = &cpo |
| 13 | set cpo&vim |
| 14 | |
| 15 | syn case match |
| 16 | |
| 17 | syn match debcopyrightUrl "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$" |
josch | 4c45425 | 2024-07-28 17:05:06 +0200 | [diff] [blame] | 18 | syn match debcopyrightKey "^\%(Format\|Upstream-Name\|Upstream-Contact\|Disclaimer\|Source\|Comment\|Files\|Copyright\|License\|Files-\%(Excluded\|Included\)\%(-[-a-zA-Z0-9]\+\)\=\): *" |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 19 | syn match debcopyrightEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+" |
| 20 | syn match debcopyrightEmail "<.\{-}>" |
| 21 | syn match debcopyrightComment "^#.*$" contains=@Spell |
| 22 | |
| 23 | hi def link debcopyrightUrl Identifier |
| 24 | hi def link debcopyrightKey Keyword |
| 25 | hi def link debcopyrightEmail Identifier |
| 26 | hi def link debcopyrightComment Comment |
| 27 | |
| 28 | let b:current_syntax = 'debcopyright' |
| 29 | |
| 30 | let &cpo = s:cpo_save |
| 31 | unlet s:cpo_save |
| 32 | |
| 33 | " vim: ts=8 sw=2 |