Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>StyLua (fork)New to Visual Studio Code? Get it now.
StyLua (fork)

StyLua (fork)

lixvbnet

|
522 installs
| (1) | Free
A Lua code formatter
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Note: this fork just adds a minor fix/workaround: avoid network access (for stylua version check) when stylua.styluaPath is set.


StyLua VSCode Extension

StyLua is an opinionated code formatter for Lua 5.1 and Luau, built using full-moon. StyLua is inspired by the likes of prettier, it parses your Lua codebase, and prints it back out from scratch, enforcing a consistent code style.

Information

For more information, see the main repository

Usage

Set StyLua as your formatter when prompted, or add the following configuration to your settings.json file:

"[lua]": {
    "editor.defaultFormatter": "JohnnyMorganz.stylua"
},

You can then use StyLua to format your code by running the Format Document command (In CMD/CTRL + Shift + P). The Format Selection command is also supported, firstly highlight the code you wish to format, and select Format Selection.

You can also enable editor.formatOnSave to format your code automatically on save.

Extension Settings

You can specify the path of the StyLua binary using the stylua.styluaPath setting. By default, if this is null, the extension will download the binary and store it in its local storage.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft