summaryrefslogtreecommitdiff
path: root/mnv/runtime/syntax/debsources.mnv
diff options
context:
space:
mode:
Diffstat (limited to 'mnv/runtime/syntax/debsources.mnv')
-rw-r--r--mnv/runtime/syntax/debsources.mnv46
1 files changed, 46 insertions, 0 deletions
diff --git a/mnv/runtime/syntax/debsources.mnv b/mnv/runtime/syntax/debsources.mnv
new file mode 100644
index 0000000000..bc819e12d7
--- /dev/null
+++ b/mnv/runtime/syntax/debsources.mnv
@@ -0,0 +1,46 @@
+" MNV syntax file
+" Language: Debian sources.list
+" Maintainer: Debian MNV Maintainers
+" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
+" Last Change: 2024 Jan 30
+" URL: https://salsa.debian.org/mnv-team/mnv-debian/blob/main/syntax/debsources.mnv
+
+" 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\)\>/ contained
+syn match debsourcesFreeComponent /\<\(main\|universe\)\>/ contained
+syn match debsourcesNonFreeComponent /\<\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)\>/ contained
+
+" Match comments
+syn match debsourcesComment /#.*/ contains=@Spell
+
+" Include Debian versioning information
+runtime! syntax/shared/debversions.mnv
+
+exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedSupportedVersions, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
+exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedUnsupportedVersions, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
+
+unlet g:debSharedSupportedVersions
+unlet g:debSharedUnsupportedVersions
+
+" Match uri's
+syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
+syn region debsourcesLine start="^" end="$" contains=debsourcesType,debsourcesFreeComponent,debsourcesNonFreeComponent,debsourcesComment,debsourcesUri,debsourcesDistrKeyword,debsourcesUnsupportedDistrKeyword oneline
+
+" Associate our matches and regions with pretty colours
+hi def link debsourcesType Statement
+hi def link debsourcesFreeComponent Statement
+hi def link debsourcesNonFreeComponent Statement
+hi def link debsourcesComment Comment
+hi def link debsourcesUri Constant
+hi def link debsourcesDistrKeyword Type
+hi def link debsourcesUnsupportedDistrKeyword WarningMsg
+
+let b:current_syntax = 'debsources'