File: ftoptions.lua

package info (click to toggle)
micro 2.0.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,828 kB
  • sloc: sh: 247; makefile: 77; xml: 53
file content (17 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
VERSION = "1.0.0"

function onBufferOpen(b)
    local ft = b:FileType()

    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