My questions to this list are as follows:
- Is anyone else bothered by the Vim's Lua indentation like I am?
- Do any of you use custom Vim indentation scripts? (Which one?)
- What we can do to improve Lua indentation in upstream Vim?
It's occasionally annoying, but most of the irregularities are only mildly inconvenient. The one that really frustrates me though, is that the indentation is completely unaware of long bracket strings. For example, this code prints "This sentence is the\nend of the paragraph.":
if true then
pcall(function()
print[[
This sentence is the
end of the paragraph.]]
end)
end
But it gets auto-indented into code with not only bad indentation, but also completely different behavior (the code now prints " This sentence is the\n end of the paragraph."):
if true then
pcall(function()
print[[
This sentence is the
end of the paragraph.]]
end)
end
Since I've been doing a bunch of work with dynamically generated Lua code, this particular issue is actually something that has bothered me a lot. It's really more of a Vim problem than a Lua problem though. If you want Vim's default Lua indentation to improve, you'd need to get a patch to this file approved: