zig fmt: Format Your Code
Keep code tidy with the built-in formatter.
One Canonical Style
Zig ships a built-in formatter so every project looks the same. The command zig fmt rewrites your code into the canonical Zig style.
Format a File in Place
Point zig fmt at a file and it reformats that file directly on disk, fixing indentation, spacing, and line breaks for you.
zig fmt main.zigAll lessons in this course
- zig run vs zig build-exe
- Debug, ReleaseSafe, ReleaseFast
- Reading Compiler Errors
- zig fmt: Format Your Code