aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-01-16 16:40:31 +0100
committerMarc André Tanner <mat@brain-dump.org>2020-01-16 16:40:31 +0100
commit1b0382160acda0a9efd5c07045619bc20292192a (patch)
tree7ded7abc6eb05e491f550d23a7ea55b798b0e40c /lua/plugins
parent5d610affb2d5332a417248a32da81acf72ea8e4f (diff)
parentfebe0528303f838fa9f346aa343fff0fe29f5ba3 (diff)
downloadvis-1b0382160acda0a9efd5c07045619bc20292192a.tar.gz
vis-1b0382160acda0a9efd5c07045619bc20292192a.tar.xz
Merge branch 'text' of https://github.com/zsugabubus/vis
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/filetype.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua
index 601bfa2..cff073a 100644
--- a/lua/plugins/filetype.lua
+++ b/lua/plugins/filetype.lua
@@ -388,6 +388,10 @@ vis.ftdetect.filetypes = {
texinfo = {
ext = { "%.texi$" },
},
+ text = {
+ ext = { "%.txt$" },
+ mime = { "text/plain" },
+ },
toml = {
ext = { "%.toml$" },
},
@@ -500,6 +504,12 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
end
end
+ -- try text lexer as a last resort
+ if (mime or 'text/plain'):match('^text/.+$') then
+ set_filetype('text', vis.ftdetect.filetypes.text)
+ return
+ end
+
win:set_syntax(nil)
end)