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 | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 5 | " Last Change: 2023 Feb 06 |
Bram Moolenaar | be4e016 | 2023-02-02 13:59:48 +0000 | [diff] [blame] | 6 | " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/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 | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 17 | syn match debsourcesType /\(deb-src\|deb\)/ |
| 18 | syn match debsourcesFreeComponent /\(main\|universe\)/ |
| 19 | syn match debsourcesNonFreeComponent /\(contrib\|non-free-firmware\|non-free\|restricted\|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 = [ |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 27 | \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy', |
Bram Moolenaar | 76db9e0 | 2022-11-09 21:21:04 +0000 | [diff] [blame] | 28 | \ 'buster', 'bullseye', 'bookworm', 'trixie', 'forky', |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 29 | \ |
Bram Moolenaar | 76db9e0 | 2022-11-09 21:21:04 +0000 | [diff] [blame] | 30 | \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic', 'lunar', |
Bram Moolenaar | 079ba76 | 2021-10-23 12:08:41 +0100 | [diff] [blame] | 31 | \ 'devel' |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 32 | \ ] |
| 33 | let s:unsupported = [ |
| 34 | \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', |
Bram Moolenaar | 3132cdd | 2020-11-05 20:41:49 +0100 | [diff] [blame] | 35 | \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy', |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 36 | \ 'jessie', 'stretch', |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 37 | \ |
| 38 | \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty', |
| 39 | \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', |
Bram Moolenaar | 3ec574f | 2017-06-13 18:12:01 +0200 | [diff] [blame] | 40 | \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', |
Bram Moolenaar | 560979e | 2020-02-04 22:53:05 +0100 | [diff] [blame] | 41 | \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic', |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 42 | \ 'disco', 'eoan', 'hirsute', 'impish', 'groovy' |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 43 | \ ] |
| 44 | let &cpo=s:cpo |
| 45 | |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 46 | " Match uri's |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 47 | syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+' |
Bram Moolenaar | 3ec574f | 2017-06-13 18:12:01 +0200 | [diff] [blame] | 48 | exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+' |
| 49 | exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+' |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 50 | |
| 51 | " Associate our matches and regions with pretty colours |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 52 | hi def link debsourcesLine Error |
Bram Moolenaar | 938ae28 | 2023-02-20 20:44:55 +0000 | [diff] [blame] | 53 | hi def link debsourcesType Statement |
| 54 | hi def link debsourcesFreeComponent Statement |
| 55 | hi def link debsourcesNonFreeComponent Statement |
Bram Moolenaar | f2571c6 | 2015-06-09 19:44:55 +0200 | [diff] [blame] | 56 | hi def link debsourcesDistrKeyword Type |
| 57 | hi def link debsourcesUnsupportedDistrKeyword WarningMsg |
| 58 | hi def link debsourcesComment Comment |
| 59 | hi def link debsourcesUri Constant |
Bram Moolenaar | d2cec5b | 2006-03-28 21:08:56 +0000 | [diff] [blame] | 60 | |
Bram Moolenaar | 85eee13 | 2018-05-06 17:57:30 +0200 | [diff] [blame] | 61 | let b:current_syntax = 'debsources' |