-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbunny-lang-cpp.el
40 lines (34 loc) · 1.15 KB
/
bunny-lang-cpp.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(setq use-lsp (eq ss-c++-system 'lsp))
(setq use-lsp-clangd (eq ss-c++-system 'lsp-clangd))
(setq use-dumb-jump (eq ss-c++-system 'dumb-jump))
(when use-lsp
(use-package ccls :ensure t
:config
(setq lsp-file-watch-threshold 10000)
(add-hook 'c++-mode-hook 'lsp)
(setq ccls-executable
(if (eq 'default ss-ccls-executable)
(locate-file "ccls" exec-path)
ss-ccls-executable))))
(when use-lsp-clangd
(use-package lsp-mode :ensure t
:config
(add-hook 'c++-mode-hook 'lsp)
(setq lsp-clangd-binary-path (locate-file "clangd" exec-path))))
(when use-dumb-jump
(use-package dumb-jump :ensure t
:init
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)))
(defun bunny-compile-and-run-c++-file ()
(interactive)
(save-buffer)
(compile
(concat "g++ " (buffer-name) " --std=c++14 && ./a.out" )))
;; fix tab spaces to 2 in cpp files.
(add-hook 'c++-mode-hook
(lambda ()
(setq-default indent-tabs-mode nil)
(setq-default c-default-style "linux")
(setq-default tab-width 2)
(setq c-basic-offset 2)))
;;; bunny-lang-python.el ends here.