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