Lua Editor Support

lua-users home
wiki

Editor support may include syntax highlighting, auto-formatting, syntax checking, build and debug integration, etc.

The following editors have some Lua support (at least highlighting or formatting) out of the box:

Editors requiring 3rd party add-ons, and miscellaneous editor tools:

Comments on Specific Editors

UltraEdit?

Add code-folding ability by adding these lines to the syntax highlighting file above:

/Open Fold Strings = "{" /Close Fold Strings = "}"

Xemacs

This tickles XEmacs' syntax highlighting a bit. On the first line place "local x = (x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)*(x)". On the second line type "print()". The hourglass cursor flickers for a few couple seconds after typing the ")". Additional terms cause much longer flicker. Some rexex performance issue I suppose. Xemacs 21.4 (patch 13) i586-pc-win32. --DavidManura, 200703

Here's a fill paragraph (M-q) function for wrapping comments. A similar questions was posted in LuaList:2004-04/msg00320.html , but I didn't see this function in the the latest 20061208 version of lua-mode.el on LuaForge. It can probably be improved from this simple form. --DavidManura, 200703

; Fill paragraph (M-q) for wrapping Lua comments.
; http://lua-users.org/wiki/LuaEditorSupport
(defun lua-fill-paragraph (arg)
  (save-excursion
    (beginning-of-line)
    (cond
     ((looking-at "^ *\-\-+ ")
       ; Comment found.  Set fill prefix.  Then fill.
      (let ((fill-prefix (buffer-substring-no-properties
                         (match-beginning 0) (match-end 0)))
	    (fill-paragraph-function nil))
	(fill-paragraph nil)
	t))))
)
(setq fill-paragraph-function 'lua-fill-paragraph)

FindPage · RecentChanges · preferences
edit · history
Last edited January 31, 2009 4:56 pm GMT (diff)