Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 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> |
Bram Moolenaar | 06d2d38 | 2016-05-20 17:24:11 +0200 | [diff] [blame] | 5 | " Last Change: 2016 Apr 24 |
Bram Moolenaar | 256972a | 2015-12-29 19:10:25 +0100 | [diff] [blame] | 6 | " URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 19 | syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/ |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 20 | |
| 21 | " Match comments |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 22 | syn match debsourcesComment /#.*/ contains=@Spell |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 23 | |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 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 | \ |
Bram Moolenaar | 06d2d38 | 2016-05-20 17:24:11 +0200 | [diff] [blame] | 30 | \ 'precise', 'trusty', 'wily', 'xenial', 'yakkety', 'devel' |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 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', |
Bram Moolenaar | 256972a | 2015-12-29 19:10:25 +0100 | [diff] [blame] | 38 | \ 'maverick', 'natty', 'oneiric', 'quantal', 'raring', 'saucy', |
Bram Moolenaar | 06d2d38 | 2016-05-20 17:24:11 +0200 | [diff] [blame] | 39 | \ 'utopic', 'vivid' |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 40 | \ ] |
| 41 | let &cpo=s:cpo |
| 42 | |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 43 | " Match uri's |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 44 | syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++ |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 45 | exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:supported, '\|'). '\)\([-[:alnum:]_./]*\)+' |
| 46 | exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:unsupported, '\|') .'\)\([-[:alnum:]_./]*\)+' |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 47 | |
| 48 | " Associate our matches and regions with pretty colours |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 49 | hi def link debsourcesLine Error |
| 50 | hi def link debsourcesKeyword Statement |
| 51 | hi def link debsourcesDistrKeyword Type |
| 52 | hi def link debsourcesUnsupportedDistrKeyword WarningMsg |
| 53 | hi def link debsourcesComment Comment |
| 54 | hi def link debsourcesUri Constant |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 55 | |
| 56 | let b:current_syntax = "debsources" |