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>
|
18053
|
5 " Last Change: 2019 Sep 07
|
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 = [
|
|
25 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
|
16610
|
26 \ 'wheezy', 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm',
|
|
27 \ 'sid', 'rc-buggy',
|
6823
|
28 \
|
18053
|
29 \ 'trusty', 'xenial', 'bionic', 'disco', 'eoan', 'devel'
|
6823
|
30 \ ]
|
|
31 let s:unsupported = [
|
|
32 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
12826
|
33 \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
|
6823
|
34 \
|
|
35 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
|
|
36 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
11518
|
37 \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
|
18053
|
38 \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic'
|
6823
|
39 \ ]
|
|
40 let &cpo=s:cpo
|
|
41
|
816
|
42 " Match uri's
|
13857
|
43 syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
|
11518
|
44 exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
|
|
45 exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
|
816
|
46
|
|
47 " Associate our matches and regions with pretty colours
|
6823
|
48 hi def link debsourcesLine Error
|
|
49 hi def link debsourcesKeyword Statement
|
|
50 hi def link debsourcesDistrKeyword Type
|
|
51 hi def link debsourcesUnsupportedDistrKeyword WarningMsg
|
|
52 hi def link debsourcesComment Comment
|
|
53 hi def link debsourcesUri Constant
|
816
|
54
|
13857
|
55 let b:current_syntax = 'debsources'
|