ZeroBrane has an excellent Lua formatter built in that fires with: Cmd + I
Is there a way to trigger that to fire on save?
Yes, you can create a plugin to do this using onEditorPreSave
event or can make it an inline plugin by adding the following to the config file:
package {
onEditorPreSave = function(self, editor)
ide:GetMainFrame():ProcessEvent(wx.wxCommandEvent(
wx.wxEVT_COMMAND_MENU_SELECTED, ID.REINDENT))
end,
}
This will send a command to process reindentation event, which should have the desired effect.