Closed gozes closed 4 years ago
You can do something like this (zig
needs to be on your path):
(defun zig-format ()
"Zig format the buffer."
(interactive)
(shell-command (format "zig fmt %s" (buffer-file-name)))
(revert-buffer :ignore-auto :noconfirm))
(use-package zig-mode
:defer t
:mode ("\\.zig\\'" . zig-mode)
:config (add-hook 'after-save-hook #'zig-format))
It nice if this mode supported formant on save like the vim plugin dose