clang-format icon indicating copy to clipboard operation
clang-format copied to clipboard

feature request: clang-format-enable-format-on-save

Open Dushistov opened this issue 6 years ago • 1 comments

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.

Dushistov avatar Jun 03 '18 07:06 Dushistov

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.

matthuszagh avatar Apr 13 '19 03:04 matthuszagh