Skip to content

Instantly share code, notes, and snippets.

@andmax
Last active August 19, 2022 15:34
Show Gist options
  • Save andmax/77f7ab62a6bb2bf160b0afbf1ed2e454 to your computer and use it in GitHub Desktop.
Save andmax/77f7ab62a6bb2bf160b0afbf1ed2e454 to your computer and use it in GitHub Desktop.
clangd to teach emacs c++
Install clangd to have IDE support in emacs:
https://clangd.llvm.org/
Add following snippet to ~/.emacs:
(require 'eglot)
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd"))
(add-hook 'c-mode-hook 'eglot-ensure)
(add-hook 'c++-mode-hook 'eglot-ensure)
Create file ~/.clangd with:
CompileFlags:
Add:
[
'--cuda-gpu-arch=sm_80',
'--cuda-path=/usr/local/cuda',
'--include-dir=/usr/local/cuda/include',
'-std=c++17'
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment