2021-04-11 23:53:27 +02:00
|
|
|
;;; -*- lexical-binding: t; -*-
|
2020-07-14 21:34:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
(load! "google-c-style")
|
|
|
|
|
|
|
|
(after! flycheck
|
|
|
|
(add-to-list 'flycheck-disabled-checkers 'c/c++-gcc)
|
2020-07-17 16:28:50 +02:00
|
|
|
(add-to-list 'flycheck-disabled-checkers 'c/c++-clang))
|
2020-07-14 21:34:23 +02:00
|
|
|
|
2024-02-12 04:00:40 +01:00
|
|
|
(defun +aspen/cpp-setup ()
|
2020-07-14 21:34:23 +02:00
|
|
|
(when (s-starts-with?
|
2024-02-12 04:00:40 +01:00
|
|
|
"/home/aspen/code/depot/third_party/nix"
|
2020-07-14 21:34:23 +02:00
|
|
|
(buffer-file-name))
|
2024-02-12 04:00:40 +01:00
|
|
|
(setq lsp-clients-clangd-executable "/home/aspen/code/depot/users/aspen/emacs.d/nix-clangd.sh"
|
2020-07-14 21:34:23 +02:00
|
|
|
lsp-clients-clangd-args nil)
|
|
|
|
(google-set-c-style)
|
2020-07-17 16:28:50 +02:00
|
|
|
(lsp)
|
|
|
|
(add-to-list 'flycheck-disabled-checkers 'c/c++-gcc)
|
|
|
|
(add-to-list 'flycheck-disabled-checkers 'c/c++-clang)))
|
2020-07-14 21:34:23 +02:00
|
|
|
|
2024-02-12 04:00:40 +01:00
|
|
|
(add-hook 'c++-mode-hook #'+aspen/cpp-setup)
|
2020-07-14 21:34:23 +02:00
|
|
|
|
2020-07-17 00:38:19 +02:00
|
|
|
(use-package! protobuf-mode)
|
|
|
|
|
2020-07-18 03:00:25 +02:00
|
|
|
(use-package! clang-format+
|
|
|
|
:config
|
|
|
|
(add-hook 'c-mode-common-hook #'clang-format+-mode))
|
|
|
|
|
2020-08-01 20:35:11 +02:00
|
|
|
(map!
|
|
|
|
(:map c++-mode-map
|
|
|
|
:leader
|
|
|
|
(:n "/ i" #'counsel-semantic-or-imenu)))
|
|
|
|
|
2020-07-14 21:34:23 +02:00
|
|
|
(comment
|
|
|
|
(setq
|
|
|
|
lsp-clients-clangd-executable
|
2024-02-12 04:00:40 +01:00
|
|
|
"/home/aspen/code/depot/third_party/nix/clangd.sh"
|
2020-07-14 21:34:23 +02:00
|
|
|
lsp-clients-clangd-args nil)
|
|
|
|
)
|