mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
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:
@@ -722,12 +722,15 @@ au BufNewFile,BufRead .gitmodules,*.git/modules/*/config setf gitconfig
|
|||||||
if !empty($XDG_CONFIG_HOME)
|
if !empty($XDG_CONFIG_HOME)
|
||||||
au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig
|
au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig
|
||||||
au BufNewFile,BufRead $XDG_CONFIG_HOME/git/attributes setf gitattributes
|
au BufNewFile,BufRead $XDG_CONFIG_HOME/git/attributes setf gitattributes
|
||||||
|
au BufNewFile,BufRead $XDG_CONFIG_HOME/git/ignore setf gitignore
|
||||||
endif
|
endif
|
||||||
au BufNewFile,BufRead .gitattributes,*.git/info/attributes setf gitattributes
|
au BufNewFile,BufRead .gitattributes,*.git/info/attributes setf gitattributes
|
||||||
au BufNewFile,BufRead */.config/git/attributes setf gitattributes
|
au BufNewFile,BufRead */.config/git/attributes setf gitattributes
|
||||||
au BufNewFile,BufRead */etc/gitattributes setf gitattributes
|
au BufNewFile,BufRead */etc/gitattributes setf gitattributes
|
||||||
au BufNewFile,BufRead git-rebase-todo setf gitrebase
|
au BufNewFile,BufRead .gitignore,*.git/info/exclude setf gitignore
|
||||||
au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail
|
au BufNewFile,BufRead */.config/git/ignore setf gitignore
|
||||||
|
au BufNewFile,BufRead git-rebase-todo setf gitrebase
|
||||||
|
au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail
|
||||||
au BufNewFile,BufRead *.git/*
|
au BufNewFile,BufRead *.git/*
|
||||||
\ if getline(1) =~# '^\x\{40,\}\>\|^ref: ' |
|
\ if getline(1) =~# '^\x\{40,\}\>\|^ref: ' |
|
||||||
\ setf git |
|
\ setf git |
|
||||||
|
@@ -1385,6 +1385,7 @@ local filename = {
|
|||||||
['.gitconfig'] = 'gitconfig',
|
['.gitconfig'] = 'gitconfig',
|
||||||
['.gitmodules'] = 'gitconfig',
|
['.gitmodules'] = 'gitconfig',
|
||||||
['.gitattributes'] = 'gitattributes',
|
['.gitattributes'] = 'gitattributes',
|
||||||
|
['.gitignore'] = 'gitignore',
|
||||||
['gitolite.conf'] = 'gitolite',
|
['gitolite.conf'] = 'gitolite',
|
||||||
['git-rebase-todo'] = 'gitrebase',
|
['git-rebase-todo'] = 'gitrebase',
|
||||||
gkrellmrc = 'gkrellmrc',
|
gkrellmrc = 'gkrellmrc',
|
||||||
@@ -1835,6 +1836,13 @@ local pattern = {
|
|||||||
return 'gitattributes'
|
return 'gitattributes'
|
||||||
end
|
end
|
||||||
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',
|
['%.gitsendemail%.msg%.......'] = 'gitsendemail',
|
||||||
['gkrellmrc_.'] = 'gkrellmrc',
|
['gkrellmrc_.'] = 'gkrellmrc',
|
||||||
['.*/usr/.*/gnupg/options%.skel'] = 'gpg',
|
['.*/usr/.*/gnupg/options%.skel'] = 'gpg',
|
||||||
|
@@ -216,6 +216,7 @@ let s:filename_checks = {
|
|||||||
\ 'gitattributes': ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'],
|
\ 'gitattributes': ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'],
|
||||||
\ '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', 'any/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'],
|
||||||
|
\ 'gitignore': ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'],
|
||||||
\ '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'],
|
||||||
|
Reference in New Issue
Block a user