1" Vim syntax file
2" Language:     Debian sources.list
3" Maintainer:   Debian Vim Maintainers <[email protected]>
4" Former Maintainer: Matthijs Mohlmann <[email protected]>
5" Last Change: 2015 Oct 24
6" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
7
8" Standard syntax initialization
9if version < 600
10  syntax clear
11elseif exists("b:current_syntax")
12  finish
13endif
14
15" case sensitive
16syn case match
17
18" A bunch of useful keywords
19syn match debsourcesKeyword        /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
20
21" Match comments
22syn match debsourcesComment        /#.*/  contains=@Spell
23
24let s:cpo = &cpo
25set cpo-=C
26let s:supported = [
27      \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
28      \ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
29      \
30      \ 'precise', 'trusty', 'vivid', 'wily', 'xenial', 'devel'
31      \ ]
32let 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      \ 'utopic'
40      \ ]
41let &cpo=s:cpo
42
43" Match uri's
44syn match debsourcesUri            +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' 	<>"]\++
45exe 'syn match debsourcesDistrKeyword   +\([[:alnum:]_./]*\)\('. join(s:supported, '\|'). '\)\([-[:alnum:]_./]*\)+'
46exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:unsupported, '\|') .'\)\([-[:alnum:]_./]*\)+'
47
48" Associate our matches and regions with pretty colours
49hi def link debsourcesLine                    Error
50hi def link debsourcesKeyword                 Statement
51hi def link debsourcesDistrKeyword            Type
52hi def link debsourcesUnsupportedDistrKeyword WarningMsg
53hi def link debsourcesComment                 Comment
54hi def link debsourcesUri                     Constant
55
56let b:current_syntax = "debsources"
57