blob: cbb3b36c101c65a398da03ece448d537eaadff76 [file] [log] [blame]
Bram Moolenaard2cec5b2006-03-28 21:08:56 +00001" Vim syntax file
Bram Moolenaarc236c162008-07-13 17:41:49 +00002" Language: Debian sources.list
Bram Moolenaar72540672018-02-09 22:00:53 +01003" Maintainer: Debian Vim Maintainers
Bram Moolenaarc236c162008-07-13 17:41:49 +00004" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
Bram Moolenaar938ae282023-02-20 20:44:55 +00005" Last Change: 2023 Feb 06
Bram Moolenaarbe4e0162023-02-02 13:59:48 +00006" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
Bram Moolenaard2cec5b2006-03-28 21:08:56 +00007
8" Standard syntax initialization
Bram Moolenaar85eee132018-05-06 17:57:30 +02009if exists('b:current_syntax')
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000010 finish
11endif
12
13" case sensitive
14syn case match
15
16" A bunch of useful keywords
Bram Moolenaar938ae282023-02-20 20:44:55 +000017syn match debsourcesType /\(deb-src\|deb\)/
18syn match debsourcesFreeComponent /\(main\|universe\)/
19syn match debsourcesNonFreeComponent /\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)/
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000020
21" Match comments
Bram Moolenaar5c736222010-01-06 20:54:52 +010022syn match debsourcesComment /#.*/ contains=@Spell
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000023
Bram Moolenaarf2571c62015-06-09 19:44:55 +020024let s:cpo = &cpo
25set cpo-=C
26let s:supported = [
Bram Moolenaar2ecbe532022-07-29 21:36:21 +010027 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
Bram Moolenaar76db9e02022-11-09 21:21:04 +000028 \ 'buster', 'bullseye', 'bookworm', 'trixie', 'forky',
Bram Moolenaarf2571c62015-06-09 19:44:55 +020029 \
Bram Moolenaar76db9e02022-11-09 21:21:04 +000030 \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic', 'lunar',
Bram Moolenaar079ba762021-10-23 12:08:41 +010031 \ 'devel'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020032 \ ]
33let s:unsupported = [
34 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
Bram Moolenaar3132cdd2020-11-05 20:41:49 +010035 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
Bram Moolenaar2ecbe532022-07-29 21:36:21 +010036 \ 'jessie', 'stretch',
Bram Moolenaarf2571c62015-06-09 19:44:55 +020037 \
38 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
39 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020040 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
Bram Moolenaar560979e2020-02-04 22:53:05 +010041 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
Bram Moolenaar2ecbe532022-07-29 21:36:21 +010042 \ 'disco', 'eoan', 'hirsute', 'impish', 'groovy'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020043 \ ]
44let &cpo=s:cpo
45
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000046" Match uri's
Bram Moolenaar85eee132018-05-06 17:57:30 +020047syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020048exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
49exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000050
51" Associate our matches and regions with pretty colours
Bram Moolenaarf2571c62015-06-09 19:44:55 +020052hi def link debsourcesLine Error
Bram Moolenaar938ae282023-02-20 20:44:55 +000053hi def link debsourcesType Statement
54hi def link debsourcesFreeComponent Statement
55hi def link debsourcesNonFreeComponent Statement
Bram Moolenaarf2571c62015-06-09 19:44:55 +020056hi def link debsourcesDistrKeyword Type
57hi def link debsourcesUnsupportedDistrKeyword WarningMsg
58hi def link debsourcesComment Comment
59hi def link debsourcesUri Constant
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000060
Bram Moolenaar85eee132018-05-06 17:57:30 +020061let b:current_syntax = 'debsources'