A minimal and clean Neovim configuration focused on C and C++ development using clangd (LSP).
- init.lua (Neovim 0.11.x) - C/C++ + CMake + Makefile/Autotools
- LSP: clangd, cmake, autotools_ls
- Completion: nvim-cmp
- Formatting: conform.nvim (clang-format + optional cmake-format)
- Plugin manager: lazy.nvim (auto bootstrap)
Make sure Neovim is installed:
nvim --versionNeovim 0.10+ is recommended.
C and C++ language features such as:
- Autocomplete
- Go to definition
- Find references
- Diagnostics
- Code navigation
require clangd.
Install on Ubuntu/Debian:
sudo apt update
sudo apt install clangdVerify installation:
clangd --versiongit clone git@github.com:hyaldiz/NvimConf.gitNeovim config directory (Linux):
~/.config/nvim/
Copy the config:
mkdir -p ~/.config/nvim
cp -r NvimConf/nvim/* ~/.config/nvim/Or sync:
rsync -av NvimConf/nvim/ ~/.config/nvim/Start Neovim:
nvimThen run:
:Lazy syncRestart Neovim after plugin installation.
For proper C/C++ , your project should contain a compile_commands.json file in the project root.
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ln -sf build/compile_commands.json compile_commands.jsonCompiler flags
cmake -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ONHappy coding 🚀