mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
feat(filetype.lua): add support for txt files (#16926)
This commit is contained in:
parent
74a90cf098
commit
a45b578dbe
@ -787,6 +787,12 @@ local extension = {
|
|||||||
xml = function() vim.fn["dist#ft#FTxml"]() end,
|
xml = function() vim.fn["dist#ft#FTxml"]() end,
|
||||||
y = function() vim.fn["dist#ft#FTy"]() end,
|
y = function() vim.fn["dist#ft#FTy"]() end,
|
||||||
zsql = function() vim.fn["dist#ft#SQL"]() 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
|
-- END EXTENSION
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1325,6 +1331,7 @@ local pattern = {
|
|||||||
["tmac%..*"] = starsetf('nroff'),
|
["tmac%..*"] = starsetf('nroff'),
|
||||||
["zlog.*"] = starsetf('zsh'),
|
["zlog.*"] = starsetf('zsh'),
|
||||||
["zsh.*"] = starsetf('zsh'),
|
["zsh.*"] = starsetf('zsh'),
|
||||||
|
["ae%d+%.txt"] = 'mail',
|
||||||
-- END PATTERN
|
-- END PATTERN
|
||||||
}
|
}
|
||||||
-- luacheck: pop
|
-- luacheck: pop
|
||||||
|
Loading…
Reference in New Issue
Block a user