Improved Lua 5.3 syntax and indentation support for Vim.
Highlighting: stock Vim (left) vs. this plugin (right):
(Color scheme: solarized dark; Font: Anonymous Pro)
vim-lua supports a few options. All are boolean and off by default: set an
option to 1 with let g:lua_syntax_someoption = 1 to enable it (setting to 0
for disabling is currently not supported -- just don't set the option at all to
keep it disabled).
g:lua_syntax_nosymboloperatordisables highlighting of the Lua symbol operators (that is, all operators except for the keyword operatorsandandor).g:lua_syntax_fancynotequalenables displaying Lua's~=operator with Unicode character≠.g:lua_syntax_nofolddisables code folding. If this option is set, you can selectively reenable some folds withg:lua_syntax_fold_<group>where<group>can be table, comment, function, control or string. You can also have even more fine-grained control by enabling specific syntax regions instead of groups. Look in the source code for the second argument ofcall s:FoldableRegionfor all options, but note that the names are subject to change in later versions.g:lua_syntax_nostdlibdisables highlighting of all standard library names like,io,printand evenrequire,erroretc. If that is too much you can useg:lua_syntax_noextendedstdlibinstead to keep_G,module,require,assert,error,pcallandxpcallhighlighted.
Contributions are welcome! Please follow the existing code style and in your pull request explain the reason for the proposed change and how it is valuable.
The indent code was based off this gist.
Various configuration options were contributed by Christian Neumüller (@Oberon00).