neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

debsources.vim (2021B)


      1 " Vim syntax file
      2 " Language:     Debian sources.list
      3 " Maintainer:   Debian Vim Maintainers
      4 " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
      5 " Last Change: 2024 Jan 30
      6 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debsources.vim
      7 
      8 " Standard syntax initialization
      9 if exists('b:current_syntax')
     10  finish
     11 endif
     12 
     13 " case sensitive
     14 syn case match
     15 
     16 " A bunch of useful keywords
     17 syn match debsourcesType               /\<\(deb-src\|deb\)\>/ contained
     18 syn match debsourcesFreeComponent      /\<\(main\|universe\)\>/ contained
     19 syn match debsourcesNonFreeComponent   /\<\(contrib\|non-free-firmware\|non-free\|restricted\|multiverse\)\>/ contained
     20 
     21 " Match comments
     22 syn match debsourcesComment        /#.*/  contains=@Spell
     23 
     24 " Include Debian versioning information
     25 runtime! syntax/shared/debversions.vim
     26 
     27 exe 'syn match debsourcesDistrKeyword   +\([[:alnum:]_./]*\)\<\('. join(g:debSharedSupportedVersions, '\|'). '\)\>\([-[:alnum:]_./]*\)+'
     28 exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\<\('. join(g:debSharedUnsupportedVersions, '\|') .'\)\>\([-[:alnum:]_./]*\)+'
     29 
     30 unlet g:debSharedSupportedVersions
     31 unlet g:debSharedUnsupportedVersions
     32 
     33 " Match uri's
     34 syn match debsourcesUri            '\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' 	<>"]\+'
     35 syn region debsourcesLine start="^" end="$" contains=debsourcesType,debsourcesFreeComponent,debsourcesNonFreeComponent,debsourcesComment,debsourcesUri,debsourcesDistrKeyword,debsourcesUnsupportedDistrKeyword oneline
     36 
     37 " Associate our matches and regions with pretty colours
     38 hi def link debsourcesType                    Statement
     39 hi def link debsourcesFreeComponent           Statement
     40 hi def link debsourcesNonFreeComponent        Statement
     41 hi def link debsourcesComment                 Comment
     42 hi def link debsourcesUri                     Constant
     43 hi def link debsourcesDistrKeyword            Type
     44 hi def link debsourcesUnsupportedDistrKeyword WarningMsg
     45 
     46 let b:current_syntax = 'debsources'