feat(filetype.lua): add support for txt files (#16926)

This commit is contained in:
KillTheMule 2022-01-05 00:06:57 +01:00 committed by GitHub
parent 74a90cf098
commit a45b578dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -787,6 +787,12 @@ local extension = {
xml = function() vim.fn["dist#ft#FTxml"]() end,
y = function() vim.fn["dist#ft#FTy"]() end,
zsql = function() vim.fn["dist#ft#SQL"]() end,
txt = function(path, bufnr)
--helpfiles match *.txt, but should have a modeline as last line
if not getline(bufnr, -1):match("vim:.*ft=help") then
return "text"
end
end,
-- END EXTENSION
}
@ -1325,6 +1331,7 @@ local pattern = {
["tmac%..*"] = starsetf('nroff'),
["zlog.*"] = starsetf('zsh'),
["zsh.*"] = starsetf('zsh'),
["ae%d+%.txt"] = 'mail',
-- END PATTERN
}
-- luacheck: pop