feat(filetype.lua): add support for files under .git

This commit is contained in:
Sanchayan Maity 2022-01-07 15:19:49 +05:30 committed by Gregory Anders
parent 27b664a2de
commit 7a574e54f2

View File

@ -1359,6 +1359,12 @@ local pattern = {
[".*/0/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/0%.orig/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/etc/sensors%.d/[^.].*"] = starsetf('sensors'),
[".*%.git/.*"] = function(path, bufnr)
local firstline = getline(bufnr, 1)
if firstline:find("^" .. string.rep("%x", 40) .. "+ ") or firstline:sub(1, 5) == "ref: " then
return "git"
end
end,
-- END PATTERN
}
-- luacheck: pop