Many (La)TeX editors support the LuaTeX engine. However, which one offers the best support for writing LuaTeX? Which editor or plugin supports features such as syntax highlighting and auto-completion for both Lua and (La)TeX?
Common useful features of LaTeX focused IDEs such as integrated viewer, forward and inverse search, structure browser and spell checking are still important, though supplemented by some Lua syntax support.
Best Answer
Vim supports embedding syntax highlighting of one language in another. I use that to support both MP and Lua syntax highlighting in ConTeXt regions. The basic trick is do define a syntax region as follows:
Then everything inside
\startluacode
...\stopluacode
will have Lua syntax highlighting. Here is a screenshot showing code from one of my modules (not that the lua comments and the functionos.remove
inside the\startluacode
environment are syntax highlighted)For completeness, here is a screenshot showing highlighted Metapost code inside a tex file
The same idea will also work in LaTeX, as follows:
Vim also supports auto-completion, but I don't use that feature so I don't know if language dependent auto-completion is possible or not.
Other requirements, like forward/backward search, spell checking, structure browser, are straight forward, but even then, vim is not what you will call an IDE.