zig-mode
zig-mode copied to clipboard
Zig mode for Emacs
An example from std.os.windows, everything after the following line is highlighted as a string because it sees the end quote as escaped: ```js const prefix_u8 = "\\DosDevices\\"; ```
zig fmt 0.6.0 doesn't seem to like getting forward slashes on my (Windows) machine. Ideally it'd accept them either way, but for now Emacs needs to give it the path...
Replacing this mode with a cc-mode derived mode would provide better integration with other emacs packages for c-like languages and allow users cc-mode configuration to work in zig-mode.
Emacs `c-mode` applies `font-lock-constant-face` to labels (e.g. `foo:`) and label references (e.g. `goto foo;`). We should have `zig-mode` do something similar for e.g. `blk: { ... }` and `break :blk`.
For interactive projects its nice to do a quick build run from any file your working on. The new `zig-project-build-run` interactive function identifies the root of the project and calls...
Here's a screencast to show what I mean by "make the cursor jump" https://user-images.githubusercontent.com/15181803/187585877-3fbb3b23-c6dc-48e6-9f00-1820c935254c.mov
Sometimes, the following would happen on save and result in losses of undo-history. It is determined that zig-format-on-save is the culprit, and setting it to nil can be a workaround....
zig-format-buffer calls revert-buffer which ends up terminating minor modes like lsp. By saving the minor-mode-list context and then restoring it after the revert-buffer call (along with setting the PRESERVE-MODES parameter...
While trying out zig-mode on doom emacs I tried it with some remote tramp. Build and run commands work fine but the mode tries to run the formatting command on...