runtime/plugins/ftoptions/ftoptions.lua
raw| 1 | VERSION = "1.0.0" |
| 2 | |
| 3 | function onBufferOpen(b) |
| 4 | local ft = b:FileType() |
| 5 | |
| 6 | if ft == "go" or |
| 7 | ft == "makefile" then |
| 8 | b:SetOption("tabstospaces", "off") |
| 9 | elseif ft == "fish" or |
| 10 | ft == "python" or |
| 11 | ft == "python2" or |
| 12 | ft == "python3" or |
| 13 | ft == "yaml" or |
| 14 | ft == "nim" then |
| 15 | b:SetOption("tabstospaces", "on") |
| 16 | end |
| 17 | end |