You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/page/faq.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,3 +71,17 @@ The issue is caused by `clojure-lsp` server being more aggressive with formattin
71
71
``` elisp
72
72
(setq lsp-enable-suggest-server-download nil)
73
73
```
74
+
75
+
---
76
+
### :grey_question: How can I stop #include statements being automatically inserted when editing C/C++ code?
77
+
78
+
You can use `lsp-clients-clangd-args` to configure your clangd. Add the following:
79
+
80
+
``` elisp
81
+
(setq lsp-clients-clangd-args
82
+
'("--header-insertion=never"))
83
+
```
84
+
85
+
For more flags, see clangd --help.
86
+
87
+
(Thanks to [Martingale on Emacs StackExchange](https://emacs.stackexchange.com/questions/58015/how-to-stop-lsp-mode-including-headers-automatically-for-c-c-code) for this answer!)
0 commit comments