clang-format
clang-format copied to clipboard
feature request: clang-format-enable-format-on-save
It would be to have option with name like clang-format-enable-format-on-save
,
that use can enable and code in buffer will reformatted during saving on disk process.
This doesn't directly address your request but I use this, which achieves that effect:
:hook ((c-mode-common . (lambda ()
(add-hook 'before-save-hook 'clang-format-buffer nil t)))
Note that this used within the context of use-package
, so you should change the syntax accordingly if not using use-package
.