2014-07-10 21:05:51 -07:00
|
|
|
" Vim syntax file
|
|
|
|
" Language: Debian sources.list
|
2018-10-28 06:05:39 -07:00
|
|
|
" Maintainer: Debian Vim Maintainers
|
2014-07-10 21:05:51 -07:00
|
|
|
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
2024-02-27 02:12:56 -07:00
|
|
|
" Last Change: 2024 Jan 30
|
2023-02-03 01:18:18 -07:00
|
|
|
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
" Standard syntax initialization
|
2018-10-29 00:43:13 -07:00
|
|
|
if exists('b:current_syntax')
|
2014-07-10 21:05:51 -07:00
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
" case sensitive
|
|
|
|
syn case match
|
|
|
|
|
|
|
|
" A bunch of useful keywords
|
2024-02-27 02:12:56 -07:00
|
|
|
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
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
" Match comments
|
|
|
|
syn match debsourcesComment /#.*/ contains=@Spell
|
|
|
|
|
2023-10-27 00:40:31 -07:00
|
|
|
" 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
|
2015-11-07 19:35:37 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
" Match uri's
|
2018-10-29 00:43:13 -07:00
|
|
|
syn match debsourcesUri '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\+'
|
2023-10-27 00:40:31 -07:00
|
|
|
syn region debsourcesLine start="^" end="$" contains=debsourcesType,debsourcesFreeComponent,debsourcesNonFreeComponent,debsourcesComment,debsourcesUri,debsourcesDistrKeyword,debsourcesUnsupportedDistrKeyword oneline
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
" Associate our matches and regions with pretty colours
|
2023-02-21 08:50:29 -07:00
|
|
|
hi def link debsourcesType Statement
|
|
|
|
hi def link debsourcesFreeComponent Statement
|
|
|
|
hi def link debsourcesNonFreeComponent Statement
|
2015-11-07 19:35:37 -07:00
|
|
|
hi def link debsourcesComment Comment
|
|
|
|
hi def link debsourcesUri Constant
|
2023-10-27 00:40:31 -07:00
|
|
|
hi def link debsourcesDistrKeyword Type
|
|
|
|
hi def link debsourcesUnsupportedDistrKeyword WarningMsg
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2018-10-29 00:43:13 -07:00
|
|
|
let b:current_syntax = 'debsources'
|