aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanchayan Maity <sanchayan@sanchayanmaity.net>2022-01-07 15:19:49 +0530
committerGregory Anders <greg@gpanders.com>2022-01-13 15:32:18 -0700
commit7a574e54f2309eb9d267282619f9383413b85d08 (patch)
tree1958810c2f238e6d91b6d56f44e5f1b22484f5d7
parent27b664a2de08301ca847c3b06a34df2be71e0caf (diff)
downloadrneovim-7a574e54f2309eb9d267282619f9383413b85d08.tar.gz
rneovim-7a574e54f2309eb9d267282619f9383413b85d08.tar.bz2
rneovim-7a574e54f2309eb9d267282619f9383413b85d08.zip
feat(filetype.lua): add support for files under .git
-rw-r--r--runtime/lua/vim/filetype.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index ea7e57c408..83e4a20ef7 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -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