1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-26 03:35:11 +01:00
vim/runtime/syntax/debsources.vim
James McCoy 7b7cda67a1
runtime(debian): update debian related runtime files ()
* Update Debian runtime files

Add mantic as a supported Ubuntu release and move buster/kinetic to
unsupported.

Add syntax highlighting for deb822sources filetype.

Add debsources ftplugin to set relevant comment options.

Move common version information to shared/debversions.vim

Closes 

Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Signed-off-by: James McCoy <jamessan@jamessan.com>

* Add myself as codeowner for Debian-related runtime files

Signed-off-by: James McCoy <jamessan@jamessan.com>

---------

Signed-off-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-26 23:14:30 +02:00

47 lines
1.9 KiB
VimL

" Vim syntax file
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
" Last Change: 2023 Oct 11
" 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
" Include Debian versioning information
runtime! syntax/shared/debversions.vim
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'