lua-mode is a major mode for editing Lua sources in Emacs.
If you have a problem or a suggestion about lua-mode, please, let me know about it via github's Issue Tracker.
lua-mode's officially supported installation method is from MELPA archive.
To get started, enable installing packages from MELPA:
(require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize)
To fetch the list of packages you can do
<M-x> package-refresh-contents
And after that lua-mode can be installed with
<M-x> package-install "lua-mode"
Please, refer to MELPA documentation and Emacs documentation on packages for further information.
El-get is a package manager which greatly simplifies adding modules to your Emacs and keeping them up-to-date. Once you have el-get set up, lua-mode can also be installed 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.
To install, 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 lua-mode 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))
The following variables are available for customization (see more via M-x customize-group lua
):
lua-indent-level
(default 3
): indentation offset in spaceslua-indent-string-contents
(default nil
): set to t
if you like to have contents of multiline strings to be indented like commentslua-indent-nested-block-content-align
(default t
) set to nil
to stop aligning the content of nested blocks with the open parenthesislua-indent-close-paren-align
(default t
) set to t
to align close parenthesis with the open parenthesis rather than with the beginning of the linelua-mode-hook
: list of functions to execute when lua-mode is initializedlua-documentation-url
(default "http://www.lua.org/manual/5.1/manual.html#pdf-"
): base URL for documentation lookuplua-documentation-function
(default browse-url
): function used to show documentation (eww
is a viable alternative for Emacs 25)lua-default-application
(default "lua"
): command to start up the subprocess (REPL)lua-default-command-switches
(default "-i"
): arguments to pass to the subprocess on startup (make sure -i
is there if you expect working with Lua shell interactively)lua-start-process
: start new REPL process, usually happens automaticallylua-kill-process
: kill current REPL processlua-show-process-buffer
: switch to REPL bufferlua-hide-process-buffer
: hide window showing REPL bufferlua-always-show
: show REPL buffer after sending somethinglua-send-buffer
: send whole bufferlua-send-current-line
: send current linelua-send-defun
: send current top-level functionlua-send-region
: send active regionlua-restart-with-whole-file
: restart REPL and send whole bufferRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4