A clean Zed extension for formatting Lua and Luau with StyLua.
- Uses
styluafrom the active workspace PATH when it is installed. - Otherwise downloads the official StyLua release for the active platform.
- Starts StyLua's built-in language-server mode with
stylua --lsp. - Contains no machine-specific paths, patches, wrapper scripts, or project-specific logic.
The PATH lookup happens in the environment where the project is open, so it works with local projects, Linux, macOS, Windows, and WSL worktrees.
- Extract the archive.
- Remove any older StyLua dev extension from Zed.
- Run Extensions: Install Dev Extension.
- Select this folder.
- Reopen a Lua or Luau file.
{
"languages": {
"Lua": {
"language_servers": ["lua-language-server", "selene", "stylua", "..."],
"formatter": { "language_server": { "name": "stylua" } },
"format_on_save": "on"
},
"Luau": {
"language_servers": ["luau-lsp", "selene", "stylua", "..."],
"formatter": { "language_server": { "name": "stylua" } },
"format_on_save": "on"
}
}
}No lsp.stylua settings are required.