-function onViewOpen(view)
- local ft = view.Buf.Settings["filetype"]
+function onBufferOpen(b)
+ local ft = b:FileType()
- if ft == "makefile" or ft == "go" then
- SetOption("tabstospaces", "off")
- elseif ft == "python" then
- SetOption("tabstospaces", "on")
+ if ft == "go" or
+ ft == "makefile" then
+ b:SetOption("tabstospaces", "off")
+ elseif ft == "fish" or
+ ft == "python" or
+ ft == "python2" or
+ ft == "python3" or
+ ft == "yaml" or
+ ft == "nim" then
+ b:SetOption("tabstospaces", "on")
end
end