简体   繁体   English

Lua 支持在 emacs 中自动完成

[英]Lua support for auto-complete in emacs

I like a lot the auto-complete mode in emacs..it works great with ruby, python, clojure, javascript, etc, etc..but not support lua..is possible made it support Lua in a easy way?...o require a lot of work, I was reading the haskell extension in我非常喜欢 emacs 中的自动完成模式..它适用于 ruby​​、python、clojure、javascript 等..但不支持 lua..是否有可能让它以简单的方式支持 Lua?... o 需要大量工作,我正在阅读 Haskell 扩展

http://madscientist.jp/~ikegami/diary/20090215.html#p01 http://madscientist.jp/~ikegami/diary/20090215.html#p01

and I think than add Lua must be less difficult, anyone know how to do it?而且我觉得比加 Lua 应该没那么难,有人知道怎么做吗?

Maybe if you know other autocomplete system for emacs with lua support would help me..I don't need something really complicate, only than my emac show me a list words predefined (maybe I would make a file with lua keywords and then emacs show it) and the words than I've used也许如果你知道其他支持 lua 的 emacs 自动完成系统会帮助我..我不需要什么真正复杂的东西,只需要我的 emac 向我显示一个预定义的单词列表(也许我会用 lua 关键字制作一个文件,然后 emacs 显示它)和我用过的词

To get the basic auto-complete features just open the file auto-complete.el and add lua-mode to this definition:要获得基本的自动完成功能,只需打开文件 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)

Eval the expression with Cx Ce or restart Emacs and next time you open a lua-buffer auto-complete mode will be active in it.使用 Cx Ce 评估表达式或重新启动 Emacs,下次打开 lua-buffer 自动完成模式将在其中处于活动状态。 If lua is supported by semantic I guess you can use the semantic backend for some fancier completion suggestions;如果语义支持 lua,我想您可以使用语义后端来获得一些更高级的完成建议; for some more custom setup you should have a look at the excellent user manual .对于更多自定义设置,您应该查看优秀的用户手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM