summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/debsources.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:44:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 02:44:24 +0000
commit8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8 (patch)
tree3537e168b860f2742f6029d70501b5ed7d15d345 /runtime/syntax/debsources.vim
parentInitial commit. (diff)
downloadvim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.tar.xz
vim-8baab3c8d7a6f22888bd581cd5c6098fd2e4b5a8.zip
Adding upstream version 2:8.1.0875.upstream/2%8.1.0875upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--runtime/syntax/debsources.vim54
1 files changed, 54 insertions, 0 deletions
diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim
new file mode 100644
index 0000000..4b21941
--- /dev/null
+++ b/runtime/syntax/debsources.vim
@@ -0,0 +1,54 @@
+" Vim syntax file
+" Language: Debian sources.list
+" Maintainer: Debian Vim Maintainers
+" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
+" Last Change: 2018 Oct 30
+" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/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 debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
+
+" Match comments
+syn match debsourcesComment /#.*/ contains=@Spell
+
+let s:cpo = &cpo
+set cpo-=C
+let s:supported = [
+ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
+ \ 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
+ \
+ \ 'trusty', 'xenial', 'bionic', 'cosmic', 'disco', 'devel'
+ \ ]
+let s:unsupported = [
+ \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
+ \ 'woody', 'sarge', 'etch', 'lenny', 'squeeze',
+ \
+ \ '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'
+ \ ]
+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 debsourcesKeyword 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'