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 |
Bram Moolenaar | 7254067 | 2018-02-09 22:00:53 +0100 | [diff] [blame] | 3 | " Maintainer: Debian Vim Maintainers |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 4 | " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> |
Bram Moolenaar | 6aa5729 | 2021-08-14 21:25:52 +0200 | [diff] [blame] | 5 | " Last Change: 2021 Aug 03 |
Bram Moolenaar | 7254067 | 2018-02-09 22:00:53 +0100 | [diff] [blame] | 6 | " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 7 | |
| 8 | " Standard syntax initialization |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 9 | if exists('b:current_syntax') |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 10 | finish |
| 11 | endif |
| 12 | |
| 13 | " case sensitive |
| 14 | syn case match |
| 15 | |
| 16 | " A bunch of useful keywords |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 17 | 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] | 18 | |
| 19 | " Match comments |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 20 | syn match debsourcesComment /#.*/ contains=@Spell |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 21 | |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 22 | let s:cpo = &cpo |
| 23 | set cpo-=C |
| 24 | let s:supported = [ |
| 25 | \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', |
Bram Moolenaar | 3132cdd | 2020-11-05 20:41:49 +0100 | [diff] [blame] | 26 | \ 'jessie', 'stretch', 'buster', 'bullseye', 'bookworm', |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 27 | \ 'trixie', 'sid', 'rc-buggy', |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 28 | \ |
Bram Moolenaar | 6aa5729 | 2021-08-14 21:25:52 +0200 | [diff] [blame] | 29 | \ 'trusty', 'xenial', 'bionic', 'focal', 'hirsute', 'impish', 'devel' |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 30 | \ ] |
| 31 | let s:unsupported = [ |
| 32 | \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', |
Bram Moolenaar | 3132cdd | 2020-11-05 20:41:49 +0100 | [diff] [blame] | 33 | \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy', |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 34 | \ |
| 35 | \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', |
| 36 | \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', |
Bram Moolenaar | 3ec574f | 2017-06-13 18:12:01 +0200 | [diff] [blame] | 37 | \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', |
Bram Moolenaar | 560979e | 2020-02-04 22:53:05 +0100 | [diff] [blame] | 38 | \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic', |
Bram Moolenaar | 6aa5729 | 2021-08-14 21:25:52 +0200 | [diff] [blame] | 39 | \ 'disco', 'eoan', 'groovy' |
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 | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 44 | syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+' |
Bram Moolenaar | 3ec574f | 2017-06-13 18:12:01 +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 | |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 56 | let b:current_syntax = 'debsources' |