816
|
1 " Vim syntax file
|
1668
|
2 " Language: Debian sources.list
|
13231
|
3 " Maintainer: Debian Vim Maintainers
|
1668
|
4 " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
29533
|
5 " Last Change: 2022 Jul 25
|
13231
|
6 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim
|
816
|
7
|
|
8 " Standard syntax initialization
|
13857
|
9 if exists('b:current_syntax')
|
816
|
10 finish
|
|
11 endif
|
|
12
|
|
13 " case sensitive
|
|
14 syn case match
|
|
15
|
|
16 " A bunch of useful keywords
|
1668
|
17 syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
|
816
|
18
|
|
19 " Match comments
|
2034
|
20 syn match debsourcesComment /#.*/ contains=@Spell
|
816
|
21
|
6823
|
22 let s:cpo = &cpo
|
|
23 set cpo-=C
|
|
24 let s:supported = [
|
29533
|
25 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
|
|
26 \ 'buster', 'bullseye', 'bookworm', 'trixie',
|
6823
|
27 \
|
29533
|
28 \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic',
|
26050
|
29 \ 'devel'
|
6823
|
30 \ ]
|
|
31 let s:unsupported = [
|
|
32 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
22824
|
33 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
|
29533
|
34 \ 'jessie', 'stretch',
|
6823
|
35 \
|
|
36 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
|
|
37 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
11518
|
38 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
|
19303
|
39 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
|
29533
|
40 \ 'disco', 'eoan', 'hirsute', 'impish', 'groovy'
|
6823
|
41 \ ]
|
|
42 let &cpo=s:cpo
|
|
43
|
816
|
44 " Match uri's
|
13857
|
45 syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
|
11518
|
46 exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
|
|
47 exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
|
816
|
48
|
|
49 " Associate our matches and regions with pretty colours
|
6823
|
50 hi def link debsourcesLine Error
|
|
51 hi def link debsourcesKeyword Statement
|
|
52 hi def link debsourcesDistrKeyword Type
|
|
53 hi def link debsourcesUnsupportedDistrKeyword WarningMsg
|
|
54 hi def link debsourcesComment Comment
|
|
55 hi def link debsourcesUri Constant
|
816
|
56
|
13857
|
57 let b:current_syntax = 'debsources'
|