summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/debsources.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
commitaed8ce9da277f5ecffe968b324f242c41c3b752a (patch)
treed2e538394cb7a8a7c42a4aac6ccf1a8e3256999b /runtime/syntax/debsources.vim
parentInitial commit. (diff)
downloadvim-aed8ce9da277f5ecffe968b324f242c41c3b752a.tar.xz
vim-aed8ce9da277f5ecffe968b324f242c41c3b752a.zip
Adding upstream version 2:9.0.1378.upstream/2%9.0.1378upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/debsources.vim')
-rw-r--r--runtime/syntax/debsources.vim61
1 files changed, 61 insertions, 0 deletions
diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim
new file mode 100644
index 0000000..cbb3b36
--- /dev/null
+++ b/runtime/syntax/debsources.vim
@@ -0,0 +1,61 @@
+" Vim syntax file
+" Language: Debian sources.list
+" Maintainer: Debian Vim Maintainers
+" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
+" Last Change: 2023 Feb 06
+" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
+
+" Standard syntax initialization
+if exists('b:current_syntax')
+ finish
+endif
+
+" case sensitive
+syn case match
+
+" A bunch of useful keywords
+syn match debsourcesType /\(deb-src\|deb\)/
+syn match debsourcesFreeComponent /\(main\|universe\)/
+syn match debsourcesNonFreeComponent /\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)/
+
+" Match comments
+syn match debsourcesComment /#.*/ contains=@Spell
+
+let s:cpo = &cpo
+set cpo-=C
+let s:supported = [
+ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
+ \ 'buster', 'bullseye', 'bookworm', 'trixie', 'forky',
+ \
+ \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'kinetic', 'lunar',
+ \ 'devel'
+ \ ]
+let s:unsupported = [
+ \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
+ \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze', 'wheezy',
+ \ 'jessie', 'stretch',
+ \
+ \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
+ \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
+ \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy',
+ \ 'utopic', 'vivid', 'wily', 'yakkety', 'zesty', 'artful', 'cosmic',
+ \ 'disco', 'eoan', 'hirsute', 'impish', 'groovy'
+ \ ]
+let &cpo=s:cpo
+
+" Match uri's
+syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
+exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:supported, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
+exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(s:unsupported, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
+
+" Associate our matches and regions with pretty colours
+hi def link debsourcesLine Error
+hi def link debsourcesType Statement
+hi def link debsourcesFreeComponent Statement
+hi def link debsourcesNonFreeComponent Statement
+hi def link debsourcesDistrKeyword Type
+hi def link debsourcesUnsupportedDistrKeyword WarningMsg
+hi def link debsourcesComment Comment
+hi def link debsourcesUri Constant
+
+let b:current_syntax = 'debsources'