Merge pull request #19242 from smjonas/vim-9.0.0042

vim-patch:9.0.{0041,0042}: filetype patterns
This commit is contained in:
Christian Clason
2022-07-06 08:14:08 +02:00
committed by GitHub
5 changed files with 13 additions and 7 deletions

View File

@@ -2388,7 +2388,7 @@ au BufNewFile,BufRead *fvwm2rc*
au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom') au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom')
" Git " Git
au BufNewFile,BufRead */.gitconfig.d/*,/etc/gitconfig.d/* call s:StarSetf('gitconfig') au BufNewFile,BufRead */.gitconfig.d/*,*/etc/gitconfig.d/* call s:StarSetf('gitconfig')
" Gitolite " Gitolite
au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite') au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite')
@@ -2453,7 +2453,7 @@ au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc')
au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
" OpenBSD hostname.if " OpenBSD hostname.if
au BufNewFile,BufRead /etc/hostname.* call s:StarSetf('config') au BufNewFile,BufRead */etc/hostname.* call s:StarSetf('config')
" Pam conf " Pam conf
au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf') au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf')

View File

@@ -1257,7 +1257,7 @@ local filename = {
['.*/named/db%..*'] = starsetf('bindzone'), ['.*/named/db%..*'] = starsetf('bindzone'),
['cabal%.project%..*'] = starsetf('cabalproject'), ['cabal%.project%..*'] = starsetf('cabalproject'),
['sgml%.catalog.*'] = starsetf('catalog'), ['sgml%.catalog.*'] = starsetf('catalog'),
['/etc/hostname%..*'] = starsetf('config'), ['.*/etc/hostname%..*'] = starsetf('config'),
['.*/etc/cron%.d/.*'] = starsetf('crontab'), ['.*/etc/cron%.d/.*'] = starsetf('crontab'),
['crontab%..*'] = starsetf('crontab'), ['crontab%..*'] = starsetf('crontab'),
WORKSPACE = 'bzl', WORKSPACE = 'bzl',
@@ -1766,7 +1766,7 @@ local pattern = {
return require('vim.filetype.detect').fvwm(path) return require('vim.filetype.detect').fvwm(path)
end), end),
['.*/tmp/lltmp.*'] = starsetf('gedcom'), ['.*/tmp/lltmp.*'] = starsetf('gedcom'),
['/etc/gitconfig%.d/.*'] = starsetf('gitconfig'), ['.*/etc/gitconfig%.d/.*'] = starsetf('gitconfig'),
['.*/gitolite%-admin/conf/.*'] = starsetf('gitolite'), ['.*/gitolite%-admin/conf/.*'] = starsetf('gitolite'),
['tmac%..*'] = starsetf('nroff'), ['tmac%..*'] = starsetf('nroff'),
['.*/%.gitconfig%.d/.*'] = starsetf('gitconfig'), ['.*/%.gitconfig%.d/.*'] = starsetf('gitconfig'),

View File

@@ -1323,6 +1323,7 @@ local patterns_hashbang = {
['fish\\>'] = { 'fish', { vim_regex = true } }, ['fish\\>'] = { 'fish', { vim_regex = true } },
['gforth\\>'] = { 'forth', { vim_regex = true } }, ['gforth\\>'] = { 'forth', { vim_regex = true } },
['icon\\>'] = { 'icon', { vim_regex = true } }, ['icon\\>'] = { 'icon', { vim_regex = true } },
guile = 'scheme',
} }
---@private ---@private

View File

@@ -206,6 +206,10 @@ if s:line1 =~# "^#!"
elseif s:name =~# 'icon\>' elseif s:name =~# 'icon\>'
set ft=icon set ft=icon
" Guile
elseif s:name =~# 'guile'
set ft=scheme
endif endif
unlet s:name unlet s:name

View File

@@ -115,7 +115,7 @@ let s:filename_checks = {
\ 'coco': ['file.atg'], \ 'coco': ['file.atg'],
\ 'conaryrecipe': ['file.recipe'], \ 'conaryrecipe': ['file.recipe'],
\ 'conf': ['auto.master'], \ 'conf': ['auto.master'],
\ 'config': ['configure.in', 'configure.ac', '/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'], \ 'confini': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf'],
\ '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'],
\ 'cook': ['file.cook'], \ 'cook': ['file.cook'],
@@ -208,7 +208,7 @@ let s:filename_checks = {
\ 'gemtext': ['file.gmi', 'file.gemini'], \ 'gemtext': ['file.gmi', 'file.gemini'],
\ 'gift': ['file.gift'], \ 'gift': ['file.gift'],
\ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG', 'EDIT_DESCRIPTION'], \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG', 'EDIT_DESCRIPTION'],
\ 'gitconfig': ['file.git/config', 'file.git/config.worktree', 'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/usr/local/etc/gitconfig', '/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'], \ 'gitconfig': ['file.git/config', 'file.git/config.worktree', 'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/usr/local/etc/gitconfig', '/etc/gitconfig.d/file', 'any/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'],
\ 'gitolite': ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], \ 'gitolite': ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'],
\ 'gitrebase': ['git-rebase-todo'], \ 'gitrebase': ['git-rebase-todo'],
\ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'], \ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'],
@@ -705,7 +705,8 @@ let s:script_checks = {
\ 'awk': [['#!/path/awk'], \ 'awk': [['#!/path/awk'],
\ ['#!/path/gawk']], \ ['#!/path/gawk']],
\ 'wml': [['#!/path/wml']], \ 'wml': [['#!/path/wml']],
\ 'scheme': [['#!/path/scheme']], \ 'scheme': [['#!/path/scheme'],
\ ['#!/path/guile']],
\ 'cfengine': [['#!/path/cfengine']], \ 'cfengine': [['#!/path/cfengine']],
\ 'erlang': [['#!/path/escript']], \ 'erlang': [['#!/path/escript']],
\ 'haskell': [['#!/path/haskell']], \ 'haskell': [['#!/path/haskell']],