]> git.lizzy.rs Git - micro.git/blob - runtime/plugins/ftoptions/ftoptions.lua
Merge pull request #890 from Jipok/patch-1
[micro.git] / runtime / plugins / ftoptions / ftoptions.lua
1 if GetOption("ftoptions") == nil then
2     AddOption("ftoptions", true)
3 end
4
5 function onViewOpen(view)
6     if not GetOption("ftoptions") then
7         return
8     end
9
10     local ft = view.Buf.Settings["filetype"]
11
12     if ft == "makefile" or ft == "go" then
13         SetOption("tabstospaces", "off")
14     elseif ft == "python" or ft == "python2" or ft == "python3" or ft == "yaml" or ft =="nim" then
15         SetOption("tabstospaces", "on")
16     end
17 end