vim-patch:9.0.0434: gitignore files are not recognized (#20143)

Problem:    gitignore files are not recognized.
Solution:   Add patterns for the gitignore filetype. (closes vim/vim#11102)
9ba2786f15
This commit is contained in:
Christian Clason
2022-09-10 13:30:54 +02:00
committed by GitHub
parent 82d93429e7
commit 40f9f479b7
3 changed files with 16 additions and 4 deletions

View File

@@ -1385,6 +1385,7 @@ local filename = {
['.gitconfig'] = 'gitconfig',
['.gitmodules'] = 'gitconfig',
['.gitattributes'] = 'gitattributes',
['.gitignore'] = 'gitignore',
['gitolite.conf'] = 'gitolite',
['git-rebase-todo'] = 'gitrebase',
gkrellmrc = 'gkrellmrc',
@@ -1835,6 +1836,13 @@ local pattern = {
return 'gitattributes'
end
end,
['.*%.git/info/exclude'] = 'gitignore',
['.*/%.config/git/ignore'] = 'gitignore',
['.*/git/ignore'] = function(path, bufnr)
if vim.env.XDG_CONFIG_HOME and path:find(vim.env.XDG_CONFIG_HOME .. '/git/ignore') then
return 'gitignore'
end
end,
['%.gitsendemail%.msg%.......'] = 'gitsendemail',
['gkrellmrc_.'] = 'gkrellmrc',
['.*/usr/.*/gnupg/options%.skel'] = 'gpg',