Interactive setup for C/C++ LSP development environment
Interactive setup for C/C++ LSP with clangd, clang-format, clang-tidy, and cppcheck. Run this first when starting C/C++ projects to enable IDE features like autocomplete and error checking.
/plugin marketplace add zircote/cpp-lsp/plugin install cpp-lsp@zircote-lspThis command will configure your C/C++ development environment with clangd LSP and essential tools.
macOS (Homebrew):
brew install llvm
Add to PATH:
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Static analysis
brew install cppcheck
# CMake (for compile_commands.json generation)
brew install cmake
clangd --version
clang-format --version
clang-tidy --version
cppcheck --version
For CMake projects:
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build
ln -s build/compile_commands.json .
For Make projects:
brew install bear
bear -- make
export ENABLE_LSP_TOOL=1