• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

immerrr/lua-mode: Emacs major mode for editing Lua

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

immerrr/lua-mode

开源软件地址(OpenSource Url):

https://github.com/immerrr/lua-mode

开源编程语言(OpenSource Language):

Emacs Lisp 89.3%

开源软件介绍(OpenSource Introduction):

Lua mode

Build Status MELPA MELPA Stable

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.

INSTALLATION

MELPA INSTALLATION

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 INSTALLATION

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.

MANUAL INSTALLATION

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))

FEATURES

  • syntactic indentation & highlighting (including multiline literals/comments)
  • evaluation of lines/regions/functions/files in Lua subprocess or direct interaction with its REPL
  • documentation lookup (using online/offline reference manual, e.g. string.find)
  • imenu integration
  • HideShow integration

CUSTOMIZATION

The following variables are available for customization (see more via M-x customize-group lua):

  • Var lua-indent-level (default 3): indentation offset in spaces
  • Var lua-indent-string-contents (default nil): set to t if you like to have contents of multiline strings to be indented like comments
  • Var lua-indent-nested-block-content-align (default t) set to nil to stop aligning the content of nested blocks with the open parenthesis
  • Var lua-indent-close-paren-align (default t) set to t to align close parenthesis with the open parenthesis rather than with the beginning of the line
  • Var lua-mode-hook: list of functions to execute when lua-mode is initialized
  • Var lua-documentation-url (default "http://www.lua.org/manual/5.1/manual.html#pdf-"): base URL for documentation lookup
  • Var lua-documentation-function (default browse-url): function used to show documentation (eww is a viable alternative for Emacs 25)

LUA SUBPROCESS CREATION

  • Var lua-default-application (default "lua"): command to start up the subprocess (REPL)
  • Var 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)
  • Cmd lua-start-process: start new REPL process, usually happens automatically
  • Cmd lua-kill-process: kill current REPL process

LUA SUBPROCESS INTERACTION

  • Cmd lua-show-process-buffer: switch to REPL buffer
  • Cmd lua-hide-process-buffer: hide window showing REPL buffer
  • Var lua-always-show: show REPL buffer after sending something
  • Cmd lua-send-buffer: send whole buffer
  • Cmd lua-send-current-line: send current line
  • Cmd lua-send-defun: send current top-level function
  • Cmd lua-send-region: send active region
  • Cmd lua-restart-with-whole-file: restart REPL and send whole buffer



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
lmc0217/lua: nginx+lus+redis,token令牌校验发布时间:2022-08-16
下一篇:
facebookarchive/fblualib: Facebook libraries and utilities for Lua发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap