diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2022-01-05 00:06:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 16:06:57 -0700 |
commit | a45b578dbe6ba02ba9a052a7b058f4243d38a07b (patch) | |
tree | bcb25cc105648add1ce14d7d11a9abb42adaba34 | |
parent | 74a90cf0989dc4d6b564406844386c7f6504ce6e (diff) | |
download | rneovim-a45b578dbe6ba02ba9a052a7b058f4243d38a07b.tar.gz rneovim-a45b578dbe6ba02ba9a052a7b058f4243d38a07b.tar.bz2 rneovim-a45b578dbe6ba02ba9a052a7b058f4243d38a07b.zip |
feat(filetype.lua): add support for txt files (#16926)
-rw-r--r-- | runtime/lua/vim/filetype.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index f53911d0a0..1496975365 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -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 |