2017-05-19 22:17:38 +00:00
|
|
|
if GetOption("ftoptions") == nil then
|
|
|
|
|
AddOption("ftoptions", true)
|
|
|
|
|
end
|
|
|
|
|
|
2016-11-08 14:34:12 +00:00
|
|
|
function onViewOpen(view)
|
2017-05-19 22:17:38 +00:00
|
|
|
if not GetOption("ftoptions") then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
2016-11-08 14:34:12 +00:00
|
|
|
local ft = view.Buf.Settings["filetype"]
|
|
|
|
|
|
|
|
|
|
if ft == "makefile" or ft == "go" then
|
|
|
|
|
SetOption("tabstospaces", "off")
|
2017-10-14 15:21:41 +00:00
|
|
|
elseif ft == "python" or ft == "python2" or ft == "python3" or ft == "yaml" or ft =="nim" then
|
2016-11-08 14:34:12 +00:00
|
|
|
SetOption("tabstospaces", "on")
|
|
|
|
|
end
|
|
|
|
|
end
|