blob: 8aa96fcb58dc2a4ddc5d3516a935370f19213304 [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 Moolenaar6aa57292021-08-14 21:25:52 +02005" Last Change: 2021 Aug 03
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 Moolenaar6aa57292021-08-14 21:25:52 +020029 \ 'trusty', 'xenial', 'bionic', 'focal', 'hirsute', 'impish', 'devel'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020030 \ ]
31let s:unsupported = [
32 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
Bram Moolenaar3132cdd2020-11-05 20:41:49 +010033 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
Bram Moolenaarf2571c62015-06-09 19:44:55 +020034 \
35 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
36 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020037 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
Bram Moolenaar560979e2020-02-04 22:53:05 +010038 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
Bram Moolenaar6aa57292021-08-14 21:25:52 +020039 \ 'disco', 'eoan', 'groovy'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020040 \ ]
41let &cpo=s:cpo
42
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000043" Match uri's
Bram Moolenaar85eee132018-05-06 17:57:30 +020044syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020045exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
46exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000047
48" Associate our matches and regions with pretty colours
Bram Moolenaarf2571c62015-06-09 19:44:55 +020049hi def link debsourcesLine Error
50hi def link debsourcesKeyword Statement
51hi def link debsourcesDistrKeyword Type
52hi def link debsourcesUnsupportedDistrKeyword WarningMsg
53hi def link debsourcesComment Comment
54hi def link debsourcesUri Constant
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000055
Bram Moolenaar85eee132018-05-06 17:57:30 +020056let b:current_syntax = 'debsources'