816
|
1 " Vim syntax file
|
1668
|
2 " Language: Debian sources.list
|
|
3 " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
|
4 " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
6823
|
5 " Last Change: 2015 May 25
|
2908
|
6 " URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debsources.vim
|
816
|
7
|
|
8 " Standard syntax initialization
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 " case sensitive
|
|
16 syn case match
|
|
17
|
|
18 " A bunch of useful keywords
|
1668
|
19 syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
|
816
|
20
|
|
21 " Match comments
|
2034
|
22 syn match debsourcesComment /#.*/ contains=@Spell
|
816
|
23
|
6823
|
24 let s:cpo = &cpo
|
|
25 set cpo-=C
|
|
26 let s:supported = [
|
|
27 \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
|
|
28 \ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
|
|
29 \
|
|
30 \ 'precise', 'trusty', 'utopic', 'vivid', 'wily', 'devel'
|
|
31 \ ]
|
|
32 let s:unsupported = [
|
|
33 \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
|
|
34 \ 'woody', 'sarge', 'etch', 'lenny',
|
|
35 \
|
|
36 \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
|
|
37 \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
|
|
38 \ 'maverick', 'natty', 'oneiric', 'quantal', 'raring', 'saucy'
|
|
39 \ ]
|
|
40 let &cpo=s:cpo
|
|
41
|
816
|
42 " Match uri's
|
1668
|
43 syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++
|
6823
|
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
|
|
55 let b:current_syntax = "debsources"
|