Skip to main content
GLuaLS includes a formatter. Format a file with Format Document (Shift+Alt+F). To format on every save, turn on editor.formatOnSave in VS Code.
Choosing the CFC preset in the settings panel, saving, and formatting a file
These settings live under format in .gluarc.json.

Options

.gluarc.json

Style options

The settings panel lists every style option with a description. These are the most common:

External formatter

To use another formatter such as StyLua, give its command and arguments. GLuaLS sends the file on standard input and reads the result from standard output. ${file} is replaced with the file path.
.gluarc.json