Emacs: Format C++ code with clang-format before saving.

This commit is contained in:
tastytea 2020-06-15 21:57:42 +02:00
parent c9eb9776b5
commit bbcaeaf792
1 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
;;; c++.el --- C++ settings. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-06-01T17:55:46+0200>
;; Time-stamp: <2020-06-15T21:30:37+0200>
;;; Commentary:
@ -126,7 +126,10 @@
)
(when (executable-find "clang-format")
(use-package clang-format))
(use-package clang-format
:hook ((c-mode-common
. (lambda ()
(add-hook 'before-save-hook #'clang-format-buffer nil t))))))
(provide 'programming/c++)
;;; c++.el ends here