]> git.lizzy.rs Git - micro.git/blob - runtime/plugins/ftoptions/ftoptions.lua
Merge pull request #891 from pranavraja/master
[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 == "go" or
13     ft == "makefile" then
14         SetOption("tabstospaces", "off")
15     elseif ft == "fish" or
16            ft == "python" or
17            ft == "python2" or
18            ft == "python3" or
19            ft == "yaml" or
20            ft == "nim" then
21         SetOption("tabstospaces", "on")
22     end
23 end