Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 2 | " Language: Debian sources.list |
Bram Moolenaar | 7254067 | 2018-02-09 22:00:53 +0100 | [diff] [blame] | 3 | " Maintainer: Debian Vim Maintainers |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 4 | " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> |
James McCoy | c7ddc9b | 2024-02-27 01:34:45 -0500 | [diff] [blame] | 5 | " Last Change: 2024 Jan 30 |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 6 | " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 7 | |
| 8 | " Standard syntax initialization |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 9 | if exists('b:current_syntax') |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 10 | finish |
| 11 | endif |
| 12 | |
| 13 | " case sensitive |
| 14 | syn case match |
| 15 | |
| 16 | " A bunch of useful keywords |
James McCoy | c7ddc9b | 2024-02-27 01:34:45 -0500 | [diff] [blame] | 17 | syn match debsourcesType /\<\(deb-src\|deb\)\>/ contained |
| 18 | syn match debsourcesFreeComponent /\<\(main\|universe\)\>/ contained |
| 19 | syn match debsourcesNonFreeComponent /\<\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)\>/ contained |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 20 | |
| 21 | " Match comments |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 22 | syn match debsourcesComment /#.*/ contains=@Spell |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 23 | |
James McCoy | 7b7cda6 | 2023-10-26 17:14:30 -0400 | [diff] [blame] | 24 | " Include Debian versioning information |
| 25 | runtime! syntax/shared/debversions.vim |
| 26 | |
| 27 | exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedSupportedVersions, '\|'). '\)\>\([-[:alnum:]_./]*\)+' |
| 28 | exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedUnsupportedVersions, '\|') .'\)\>\([-[:alnum:]_./]*\)+' |
| 29 | |
| 30 | unlet g:debSharedSupportedVersions |
| 31 | unlet g:debSharedUnsupportedVersions |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 32 | |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 33 | " Match uri's |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 34 | syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+' |
James McCoy | 7b7cda6 | 2023-10-26 17:14:30 -0400 | [diff] [blame] | 35 | syn region debsourcesLine start="^" end="$" contains=debsourcesType,debsourcesFreeComponent,debsourcesNonFreeComponent,debsourcesComment,debsourcesUri,debsourcesDistrKeyword,debsourcesUnsupportedDistrKeyword oneline |
| 36 | |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 37 | " Associate our matches and regions with pretty colours |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 38 | hi def link debsourcesType Statement |
| 39 | hi def link debsourcesFreeComponent Statement |
| 40 | hi def link debsourcesNonFreeComponent Statement |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 41 | hi def link debsourcesComment Comment |
| 42 | hi def link debsourcesUri Constant |
James McCoy | 7b7cda6 | 2023-10-26 17:14:30 -0400 | [diff] [blame] | 43 | hi def link debsourcesDistrKeyword Type |
| 44 | hi def link debsourcesUnsupportedDistrKeyword WarningMsg |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 45 | |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 46 | let b:current_syntax = 'debsources' |