|
| 1 | +--- |
| 2 | +title: Zig |
| 3 | +--- |
| 4 | + |
| 5 | +`zig-mode` adds Zig language support to Lem: |
| 6 | + |
| 7 | +- syntax highlighting, auto-indentation |
| 8 | +- LSP integration via [zls](https://github.com/zigtools/zls) |
| 9 | + |
| 10 | + |
| 11 | +### Syntax Highlighting |
| 12 | + |
| 13 | +- Keywords (`fn`, `const`, `var`, `if`, `else`, `while`, `for`, `struct`, etc.) |
| 14 | +- Builtin functions (`@import`, `@sizeOf`, `@TypeOf`, etc.) |
| 15 | +- Primitive types (`u8`, `i32`, `bool`, `void`, `anytype`, etc.) |
| 16 | +- Constants (`true`, `false`, `null`, `undefined`) |
| 17 | +- Numeric literals (hex, binary, octal, decimal, float) |
| 18 | +- Strings and comments (including doc comments `///`) |
| 19 | + |
| 20 | +### Commands |
| 21 | + |
| 22 | +| Key | Command | Description | |
| 23 | +|-----|---------|-------------| |
| 24 | +| `C-c C-f` | `zig-format-buffer` | Format with zig fmt | |
| 25 | +| `C-c C-r` | `zig-run` | Run with zig run | |
| 26 | +| `C-c C-b` | `zig-build` | Build with zig build | |
| 27 | +| `C-c C-t` | `zig-test` | Test with zig test | |
| 28 | + |
| 29 | +### Other Features |
| 30 | + |
| 31 | +- Auto-indentation (4 spaces default) |
| 32 | +- Function navigation (`beginning-of-defun`/`end-of-defun`) |
| 33 | +- Electric close (`}`, `)`, `]` auto-indent) |
| 34 | + |
| 35 | +### File Associations |
| 36 | + |
| 37 | +- `.zig`, `.zon` → `zig-mode` |
0 commit comments