aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emacs/.config/emacs/config.org4
1 files changed, 4 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 7784803..5f2993f 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -2351,6 +2351,10 @@ format [[file:~/Dotfiles/ClangFormat/.clang-format][config file]] in my dotfiles
:keymaps '(c-mode-map c++-mode-map)
"cf" #'+code/clang-format-region-or-buffer)
:config
+ (add-hook 'after-save-hook (proc (interactive)
+ (if (or (eq major-mode 'c-mode)
+ (eq major-mode 'c++-mode))
+ (clang-format-buffer))))
(defun +code/clang-format-region-or-buffer ()
(interactive)
(if (mark)