vim-patch:9.1.0311: filetype: Some config files are not recognized (#28311)

Problem:  Some config files are not recognized
Solution: Add some patterns for chktex, ripgreprc and ctags config
          files.

See: https://www.nongnu.org/chktex/
See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file
See: https://docs.ctags.io/en/latest/option-file.html#order-of-loading-option-files

closes: vim/vim#14506

a1dcd76ce7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
This commit is contained in:
zeertzjq 2024-04-13 09:59:53 +08:00 committed by GitHub
parent 66220d164a
commit 355c149ba0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -283,6 +283,7 @@ local extension = {
cbl = 'cobol', cbl = 'cobol',
atg = 'coco', atg = 'coco',
recipe = 'conaryrecipe', recipe = 'conaryrecipe',
ctags = 'conf',
hook = function(path, bufnr) hook = function(path, bufnr)
return M._getline(bufnr, 1) == '[Trigger]' and 'confini' or nil return M._getline(bufnr, 1) == '[Trigger]' and 'confini' or nil
end, end,
@ -1305,6 +1306,9 @@ local filename = {
['auto.master'] = 'conf', ['auto.master'] = 'conf',
['texdoc.cnf'] = 'conf', ['texdoc.cnf'] = 'conf',
['.x11vncrc'] = 'conf', ['.x11vncrc'] = 'conf',
['.chktexrc'] = 'conf',
['.ripgreprc'] = 'conf',
ripgreprc = 'conf',
['configure.in'] = 'config', ['configure.in'] = 'config',
['configure.ac'] = 'config', ['configure.ac'] = 'config',
crontab = 'crontab', crontab = 'crontab',

View File

@ -163,7 +163,7 @@ func s:GetFilenameChecks() abort
\ 'cobol': ['file.cbl', 'file.cob', 'file.lib'], \ 'cobol': ['file.cbl', 'file.cob', 'file.lib'],
\ 'coco': ['file.atg'], \ 'coco': ['file.atg'],
\ 'conaryrecipe': ['file.recipe'], \ 'conaryrecipe': ['file.recipe'],
\ 'conf': ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc'], \ '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'], \ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'],
\ 'confini': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], \ 'confini': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],