vim-patch:9.1.1359: filetype: GNU Radio config files are not recognized

Problem:  filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype.  Only
          allow '#' as start of comment in confini syntax (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/Configuration_Files

closes: vim/vim#17242

9c9200d1ea
This commit is contained in:
zeertzjq
2025-05-02 21:45:57 +08:00
parent 0741d2520d
commit 074a6abd55
4 changed files with 11 additions and 2 deletions

View File

@ -2280,6 +2280,8 @@ local pattern = {
['asterisk/.*%.conf'] = starsetf('asterisk'),
['asterisk.*/.*voicemail%.conf'] = starsetf('asteriskvm'),
['^dictd.*%.conf$'] = 'dictdconf',
['/%.?gnuradio/.*%.conf$'] = 'confini',
['/gnuradio/conf%.d/.*%.conf$'] = 'confini',
['/lxqt/.*%.conf$'] = 'dosini',
['/screengrab/.*%.conf$'] = 'dosini',
['/%.config/fd/ignore$'] = 'gitignore',

View File

@ -1,7 +1,7 @@
" Vim syntax file
" Language: Good old CFG files
" Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
" Last change: 2012 Aug 11
" Last Change: 2012 Aug 11
" 2024 Nov 14 by Vim project: // only denotes a comment when starting a line (#16051)
" quit when a syntax file was already loaded

View File

@ -1,5 +1,7 @@
" Vim syntax file
" Language: confini
" Last Change:
" 2025 May 02 by Vim project commented line starts with # only
" Quit if a syntax file was already loaded
if exists("b:current_syntax")
@ -9,4 +11,8 @@ endif
" Use the cfg syntax for now, it's similar.
runtime! syntax/cfg.vim
" Only accept '#' as the start of a comment.
syn clear CfgComment
syn match CfgComment "#.*" contains=@Spell
let b:current_syntax = 'confini'

View File

@ -183,7 +183,8 @@ func s:GetFilenameChecks() abort
\ 'conaryrecipe': ['file.recipe'],
\ 'conf': ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags'],
\ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'],
\ 'confini': ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
\ 'confini': ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection',
\ 'any/.gnuradio/grc.conf', 'any/gnuradio/config.conf', 'any/gnuradio/conf.d/modtool.conf'],
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
\ 'cook': ['file.cook'],
\ 'corn': ['file.corn'],