Create ftoptions option to disable auto settings

Closes #662
This commit is contained in:
Zachary Yedidia
2017-05-19 18:17:38 -04:00
parent e7ee194acf
commit f364965ac0
3 changed files with 20 additions and 6 deletions

View File

@@ -1,9 +1,17 @@
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"]
if ft == "makefile" or ft == "go" then
SetOption("tabstospaces", "off")
elseif ft == "python" then
elseif ft == "python" or ft == "python2" or ft == "python3" then
SetOption("tabstospaces", "on")
end
end