micro/runtime/plugins/ftoptions/ftoptions.lua

24 lines
522 B
Lua
Raw Normal View History

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"]
2017-10-11 15:02:37 +00:00
if ft == "go" or
ft == "makefile" then
SetOption("tabstospaces", "off")
2017-10-11 15:02:37 +00:00
elseif ft == "fish" or
2017-10-17 04:03:57 +00:00
ft == "python" or
ft == "python2" or
ft == "python3" or
ft == "yaml" or
ft == "nim" then
SetOption("tabstospaces", "on")
end
end