Clangd for Neovim
Clangd is a language server for C, and C++.
Clangd Lsp Configuration
Clangd is configured with a configuration file at the root of your project. There are two options either a
This is the most straight forward option. Simply list the flags you pass to the compiler, one flag per link. To use c++ version 20, you would simply add this line to your
If your setup is more complicated, a
compile_flags.json file can be generated with cmake. To generate this file provide the
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON flag to cmake.
To regenerate this every time you run cmake, add this line to your