Skip to content

Commit c02cc8d

Browse files
authored
Add eglot configuration.
1 parent d214a63 commit c02cc8d

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,26 @@ clangd --background-index --clang-tidy
4747

4848
Recommended `eglot` configuration:
4949
```emacs lisp
50-
(add-to-list 'eglot-server-programs
51-
'((c-mode c-ts-mode c++-mode c++-ts-mode objc-mode)
52-
. ("clangd"
53-
"--compile-commands-dir=./build/"
54-
"--background-index"
55-
"--clang-tidy"
56-
"--completion-style=detailed"
57-
"--header-insertion=never"
58-
"--pch-storage=memory"
59-
"--malloc-trim")))
50+
(use-package eglot
51+
:ensure t
52+
:hook (((c-mode c++-mode c-ts-mode c++-ts-mode) . eglot-ensure))
53+
:init
54+
(setq eglot-stay-out-of '(imenu)
55+
read-process-output-max (* 1024 1024) ; 1MB
56+
eglot-autoshutdown t
57+
eglot-events-buffer-size 0
58+
eglot-send-changes-idle-time 0.5)
59+
:config
60+
(add-to-list 'eglot-server-programs
61+
'((c-mode c-ts-mode c++-mode c++-ts-mode objc-mode)
62+
. ("clangd"
63+
"--compile-commands-dir=./build/"
64+
"--background-index"
65+
"--clang-tidy"
66+
"--completion-style=detailed"
67+
"--header-insertion=never"
68+
"--pch-storage=memory"
69+
"--malloc-trim"))))
6070
```
6171

6272
Recommended `tree-sitter` configuration:

0 commit comments

Comments
 (0)