commit 021e52ab4664716f4b672271ac39dbe37cb8a96e
parent 369cb9b5e510662c11e9762a6c4134a3114e237c
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Sat, 28 Apr 2018 17:06:20 -0500
Add clang-format.
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/README.org b/README.org
@@ -867,3 +867,18 @@ Install =keyfreq=.
(keyfreq-mode 1)
(keyfreq-autosave-mode 1))
#+END_SRC
+* Clang-format
+** Installation
+Install and set hot keys for formatting.
+#+BEGIN_SRC emacs-lisp
+ (use-package clang-format
+ :ensure t
+ :init
+ (global-set-key (kbd "C-c i") 'clang-format-region)
+ (global-set-key (kbd "C-c u") 'clang-format-buffer))
+#+END_SRC
+** Set code style
+Use Google's C++ style.
+#+BEGIN_SRC emacs-lisp
+ (custom-set-variables '(clang-format-style "Google"))
+#+END_SRC