Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 863 Bytes

README.md

File metadata and controls

35 lines (28 loc) · 863 Bytes

Yet another lua-mode that is suitable for luvit or any callback-based programming

Default emacs' lua-mode indents like this:

local foo = function()
               print("Hello, world")
            end

It takes too many indents, apparently corrupt..

Here you will get:

local foo = function()
  print("Hello, world!")
end

Nice, isnt it.

Put my-lua.el anywhere and append this:

(add-hook 'lua-mode-hook 
          (lambda () (unless (fboundp 'lua-calculate-indentation-right-shift-next)
                       (load-file (locate-file "my-lua.el" load-path)))))

in your .emacs .

Related discussions

See how to configure indentation in emacs lua-mode : stack overflow

In this repository it fixes the bug in above code.