Skip to content

Commit

Permalink
vim-patch:9.1.0110: filetype: add 'Config.in' filetype detection
Browse files Browse the repository at this point in the history
The 'Config.in' file type is for Buildroot configuration files.
Buildroot Config.in files use the same Kconfig backend as the Linux
kernel's Kconfig files.

Buildroot also has other filename variants that follow "Config.in.*",
they are used to distinguish multiple Config.in files in the same
directory.

See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file

closes: vim/vim#14038

vim/vim@5f20f05

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
  • Loading branch information
clason and blmaier committed Feb 15, 2024
1 parent 7ed75d4 commit d0599b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions runtime/lua/vim/filetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,7 @@ local filename = {
['.justfile'] = 'just',
Kconfig = 'kconfig',
['Kconfig.debug'] = 'kconfig',
['Config.in'] = 'kconfig',
['lftp.conf'] = 'lftp',
['.lftprc'] = 'lftp',
['/.libao'] = 'libao',
Expand Down Expand Up @@ -1739,6 +1740,7 @@ local pattern = {
['[jt]sconfig.*%.json'] = 'jsonc',
['[jJ]ustfile'] = 'just',
['Kconfig%..*'] = starsetf('kconfig'),
['Config%.in%..*'] = starsetf('kconfig'),
['.*%.[Ss][Uu][Bb]'] = 'krl',
['lilo%.conf.*'] = starsetf('lilo'),
['.*/etc/logcheck/.*%.d.*/.*'] = starsetf('logcheck'),
Expand Down
2 changes: 1 addition & 1 deletion test/old/testdir/test_filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func s:GetFilenameChecks() abort
\ 'jsp': ['file.jsp'],
\ 'julia': ['file.jl'],
\ 'just': ['justfile', 'Justfile', '.justfile', 'config.just'],
\ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'],
\ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file', 'Config.in', 'Config.in.host'],
\ 'kdl': ['file.kdl'],
\ 'kivy': ['file.kv'],
\ 'kix': ['file.kix'],
Expand Down

0 comments on commit d0599b0

Please sign in to comment.