Emacs major mode for editing Lua

Project maintained by immerrr Hosted on GitHub Pages — Theme by mattgraham


Author immerrr

lua-mode is an Emacs major mode for editing Lua. The development has moved to github, so update your bookmarks if you still look for new releases at luaforge.

If you have a problem or a suggestion about lua-mode, please, let me know about it via issue tracker.


The preferred way of installation is via el-get or MELPA packages.


El-get is a a package manager which greatly simplifies adding modules to your Emacs and keeping them up-to-date. It already includes a recipe for lua-mode, so once you have el-get set up, installing lua-mode can be done with

   <M-x> el-get-install lua-mode

and updating is no more than

   <M-x> el-get-update lua-mode

Please, consult with el-get documentation for further information.


MELPA is a package repository compatible with standard Emacs lisp package archive (ELPA) introduced in Emacs24 that strives to provide up-to-date versions packages which is invaluable in the world of everchanging Emacs packages. Please, follow the installation instructions from MELPA main page and you’ll be able to install lua-mode with

   <M-x> package-install lua-mode


1. Grab a zipball or pick any commit you like on github:

2. Next, you need to make sure that lua-mode.el is on your load-path (and optionally byte-compile it) and to set up Emacs to automatically enable it for *.lua files or ones that contain lua hash-bang line (`#!/usr/bin/lua`). Putting this snippet to .emacs should be enough in most cases:

    ;;;; This snippet enables lua-mode
    ;; This line is not necessary, if lua-mode.el is already on your load-path
    (add-to-list 'load-path "/path/to/directory/where/lua-mode-el/resides")

    (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
    (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
    (add-to-list 'interpreter-mode-alist '("lua" . lua-mode))

3. (optional) Byte-compile lua-mode if you like


lua-mode supports automatical code indentation and sending of lines/regions/files to a Lua interpreter. An interpreter (see variable lua-default-application) will be started if you try to send some code and none is running. You can use the process-buffer (named after the application you chose) as if it were an interactive shell. See the documentation for comint.el for details.

Lua-mode also works with Hide Show minor mode (see hs-minor-mode).