blob: 349b2ac547aaf7522c2417c93559c8bdd2852a08 [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 Moolenaar1ff14ba2019-11-02 14:09:23 +01005" Last Change: 2019 Oct 18
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 Moolenaara6c27c42019-05-09 19:16:22 +020026 \ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
27 \ 'sid', 'rc-buggy',
Bram Moolenaarf2571c62015-06-09 19:44:55 +020028 \
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +010029 \ 'trusty', 'xenial', 'bionic', 'disco', 'eoan', 'focal', 'devel'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020030 \ ]
31let s:unsupported = [
32 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
Bram Moolenaar7f2e9d72017-11-11 20:58:53 +010033 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
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 Moolenaar8fe10002019-09-11 22:56:44 +020038 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic'
Bram Moolenaarf2571c62015-06-09 19:44:55 +020039 \ ]
40let &cpo=s:cpo
41
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000042" Match uri's
Bram Moolenaar85eee132018-05-06 17:57:30 +020043syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
Bram Moolenaar3ec574f2017-06-13 18:12:01 +020044exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
45exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000046
47" Associate our matches and regions with pretty colours
Bram Moolenaarf2571c62015-06-09 19:44:55 +020048hi def link debsourcesLine Error
49hi def link debsourcesKeyword Statement
50hi def link debsourcesDistrKeyword Type
51hi def link debsourcesUnsupportedDistrKeyword WarningMsg
52hi def link debsourcesComment Comment
53hi def link debsourcesUri Constant
Bram Moolenaard2cec5b2006-03-28 21:08:56 +000054
Bram Moolenaar85eee132018-05-06 17:57:30 +020055let b:current_syntax = 'debsources'