blob: e3ec6e65989a90eed65d00ed9c900b43ccda04ac [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 Moolenaar3f32a5f2022-05-12 20:34:15 +01005" Last Change: 2022 May 01
Bram Moolenaar72540672018-02-09 22:00:53 +01006" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/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 Moolenaarc236c162008-07-13 17:41:49 +000017syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000018
19" Match comments
Bram Moolenaar5c736222010-01-06 20:54:52 +010020syn match debsourcesComment /#.*/ contains=@Spell
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000021
Bram Moolenaarf2571c62015-06-09 19:44:55 +020022let s:cpo = &cpo
23set cpo-=C
24let s:supported = [
25 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
Bram Moolenaar3132cdd2020-11-05 20:41:49 +010026 \ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
Bram Moolenaar23515b42020-11-29 14:36:24 +010027 \ 'trixie', 'sid', 'rc-buggy',
Bram Moolenaarf2571c62015-06-09 19:44:55 +020028 \
Bram Moolenaar3f32a5f2022-05-12 20:34:15 +010029 \ 'trusty', 'xenial', 'bionic', 'focal', 'impish', 'jammy', 'kinetic',
Bram Moolenaar079ba762021-10-23 12:08:41 +010030 \ 'devel'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020031 \ ]
32let s:unsupported = [
33 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
Bram Moolenaar3132cdd2020-11-05 20:41:49 +010034 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
Bram Moolenaarf2571c62015-06-09 19:44:55 +020035 \
36 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
37 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020038 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
Bram Moolenaar560979e2020-02-04 22:53:05 +010039 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
Bram Moolenaar46eea442022-03-30 10:51:39 +010040 \ 'disco', 'eoan', 'hirsute', 'groovy'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020041 \ ]
42let &cpo=s:cpo
43
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000044" Match uri's
Bram Moolenaar85eee132018-05-06 17:57:30 +020045syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020046exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
47exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000048
49" Associate our matches and regions with pretty colours
Bram Moolenaarf2571c62015-06-09 19:44:55 +020050hi def link debsourcesLine Error
51hi def link debsourcesKeyword Statement
52hi def link debsourcesDistrKeyword Type
53hi def link debsourcesUnsupportedDistrKeyword WarningMsg
54hi def link debsourcesComment Comment
55hi def link debsourcesUri Constant
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000056
Bram Moolenaar85eee132018-05-06 17:57:30 +020057let b:current_syntax = 'debsources'