我非常喜欢 emacs 中的自动完成模式。它适用于 ruby、python、clojure、javascript 等,但不支持 lua。有没有可能让它以一种简单的方式支持 Lua? ...o 需要大量工作,我正在阅读 haskell 扩展
http://madscientist.jp/~ikegami/diary/20090215.html#p01
而且我认为添加 Lua 一定更容易,有人知道怎么做吗?
也许如果你知道其他支持 lua 的 emacs 自动完成系统会对我有所帮助..我不需要真正复杂的东西,只要我的 emac 给我一个预定义的单词列表(也许我会用 lua 关键字和然后 emacs 显示它)和比我用过的词
最佳答案
要获得基本的自动完成功能,只需打开文件 auto-complete.el 并将 lua-mode 添加到此定义中:
(defcustom ac-modes
'(emacs-lisp-mode
lisp-interaction-mode
c-mode cc-mode c++-mode
java-mode clojure-mode scala-mode
scheme-mode
ocaml-mode tuareg-mode
perl-mode cperl-mode python-mode ruby-mode
ecmascript-mode javascript-mode js-mode js2-mode php-mode css-mode
makefile-mode sh-mode fortran-mode f90-mode ada-mode
xml-mode sgml-mode)
"Major modes `auto-complete-mode' can run on."
:type '(repeat symbol)
:group 'auto-complete)
使用 C-x C-e 评估表达式或重新启动 Emacs,下次打开 lua-buffer 自动完成模式将在其中激活。如果语义支持 lua,我想你可以使用语义后端来获得一些更高级的完成建议;对于一些更多的自定义设置,你应该看看优秀的 user manual .
关于emacs - Lua 支持在 emacs 中自动完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6487163/