Update ftoptions and statusline plugin configuration options

This commit is contained in:
Zachary Yedidia
2019-07-28 16:28:04 -07:00
parent 23a76e1381
commit 576036f251
4 changed files with 82 additions and 37 deletions

View File

@@ -1,23 +1,15 @@
if GetOption("ftoptions") == nil then
AddOption("ftoptions", true)
end
function onViewOpen(view)
if not GetOption("ftoptions") then
return
end
local ft = view.Buf.Settings["filetype"]
function onBufferOpen(b)
local ft = b:FileType()
if ft == "go" or
ft == "makefile" then
SetOption("tabstospaces", "off")
b:SetOption("tabstospaces", "off")
elseif ft == "fish" or
ft == "python" or
ft == "python2" or
ft == "python3" or
ft == "yaml" or
ft == "nim" then
SetOption("tabstospaces", "on")
b:SetOption("tabstospaces", "on")
end
end