about summary refs log tree commit diff
path: root/users/glittershark/emacs.d/cpp.el
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-14T19·34-0400
committerglittershark <grfn@gws.fyi>2020-07-14T19·38+0000
commit8a7f0beb861d3aa2336625da90e13c4fb881c218 (patch)
treefdc1c254d8827f888987e9f2b368f0024fd375c2 /users/glittershark/emacs.d/cpp.el
parentd3ad338726b78915ee79e4a7d007daf3129e70f1 (diff)
feat(gs/emacs): Configure for C++ development r/1293
Vendor the google-c-style module, and configure lsp-mode to run the
clangd wrapper script for hacking on tvlnix

Change-Id: I8d1ac2f30c9708501e0840ef3d53fe479bc39fa7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1166
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'users/glittershark/emacs.d/cpp.el')
-rw-r--r--users/glittershark/emacs.d/cpp.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/users/glittershark/emacs.d/cpp.el b/users/glittershark/emacs.d/cpp.el
new file mode 100644
index 0000000000..225d8b7f8c
--- /dev/null
+++ b/users/glittershark/emacs.d/cpp.el
@@ -0,0 +1,26 @@
+;;; ~/code/depot/users/glittershark/emacs.d/cpp.el -*- lexical-binding: t; -*-
+
+
+(load! "google-c-style")
+
+(after! flycheck
+  (add-to-list 'flycheck-disabled-checkers 'c/c++-gcc)
+  (add-to-list 'flycheck-disabled-checkers 'c/c++-clangd))
+
+(defun +grfn/cpp-setup ()
+  (when (s-starts-with?
+         "/home/grfn/code/depot/third_party/nix"
+         (buffer-file-name))
+    (setq lsp-clients-clangd-executable "/home/grfn/code/depot/users/glittershark/emacs.d/nix-clangd.sh"
+          lsp-clients-clangd-args nil)
+    (google-set-c-style)
+    (lsp)))
+
+(add-hook 'c++-mode-hook #'+grfn/cpp-setup)
+
+(comment
+ (setq
+  lsp-clients-clangd-executable
+  "/home/grfn/code/depot/third_party/nix/clangd.sh"
+  lsp-clients-clangd-args nil)
+ )