aboutsummaryrefslogtreecommitdiff
path: root/dot.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to 'dot.emacs.d')
-rw-r--r--dot.emacs.d/init.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/dot.emacs.d/init.el b/dot.emacs.d/init.el
index e9896fd..3c1b21d 100644
--- a/dot.emacs.d/init.el
+++ b/dot.emacs.d/init.el
@@ -276,6 +276,31 @@
(setq c-default-style "linux")
+;; Taken from LLVM source tree
+;; https://github.com/llvm/llvm-project/blob/c719a8596d01cef9b54f0585bd2d68d657d8659a/llvm/utils/emacs/emacs.el
+(defun llvm-lineup-statement (langelem)
+ (let ((in-assign (c-lineup-assignments langelem)))
+ (if (not in-assign)
+ '++
+ (aset in-assign 0
+ (+ (aref in-assign 0)
+ (* 2 c-basic-offset)))
+ in-assign)))
+
+;; Add a cc-mode style for editing LLVM C and C++ code
+(c-add-style "llvm.org"
+ '("gnu"
+ (fill-column . 80)
+ (c++-indent-level . 2)
+ (c-basic-offset . 2)
+ (indent-tabs-mode . nil)
+ (c-offsets-alist . ((arglist-intro . ++)
+ (innamespace . 0)
+ (member-init-intro . ++)
+ (statement-cont . llvm-lineup-statement)))))
+;; End LLVM block
+(require 'llvm-mode)
+
(setq tramp-default-method "ssh"
tramp-terminal-type "tramp")