From 40f9f479b746d0f76fbdd4bc0567d593ca7a6070 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 10 Sep 2022 13:30:54 +0200 Subject: 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) https://github.com/vim/vim/commit/9ba2786f15f0b53a90fd221832a5bedfc6dbfe20 --- runtime/lua/vim/filetype.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime/lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 6aa765ebaf..c8777801ec 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -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', -- cgit