This repository was archived by the owner on Nov 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Then add the following to your `.emacs` file:
2929(unless (version< emacs-version "24")
3030 (add-to-list 'load-path "~/path/to/your/zig-mode/")
3131 (autoload 'zig-mode "zig-mode" nil t)
32- (add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode) ))
32+ (add-to-list 'auto-mode-alist '("\\.\\( zig\\|zon\\)\\ '" . zig-mode))
3333```
3434
3535## Testing
Original file line number Diff line number Diff line change 4646 :type 'boolean
4747 :safe #'booleanp )
4848
49+ (defcustom zig-ast-check-on-format nil
50+ " Look for simple compile errors on format."
51+ :type 'boolean
52+ :safe #'booleanp )
53+
4954(defcustom zig-zig-bin " zig"
5055 " Path to zig executable."
5156 :type 'file
@@ -108,10 +113,11 @@ If given a SOURCE, execute the CMD on it."
108113 (zig--run-cmd " run" (file-local-name (buffer-file-name )) " -O" zig-run-optimization-mode))
109114
110115; ; zig fmt
111-
112116(reformatter-define zig-format
113117 :program zig-zig-bin
114- :args '(" fmt" " --stdin" )
118+ :args (append '(" fmt" " --stdin" )
119+ (when (string-match-p " \\ .zon\\ '" buffer-file-name) '(" --zon" ))
120+ (when zig-ast-check-on-format '(" --ast-check" )))
115121 :group 'zig-mode
116122 :lighter " ZigFmt" )
117123
You can’t perform that action at this time.
0 commit comments