Minimal init.vim for C/C++ development
- Download & save init.vim (
~/.config/nvim/init.vim
) - Download Plug for NVIM: https://github.com/junegunn/vim-plug#unix-1
- Install xclip/xfce4-clipman for the system clipboard support
- Install luajit
- Install clangd (and clang if needed):
sudo apt-get install clangd
- Launch nvim and do
:PlugInstall
- Install coc-clangd:
:CocInstall coc-clangd
- Install bear:
sudo apt-get install bear
(or compile from the sources: https://github.com/rizsotto/Bear) - Open any c/c++ file and launch coc-clangd install in case clangd is not found in $PATH: run
:CocInstall coc-clangd
- To generate compile_commands.json for your project launch
bear -- $your_make_command
(likebear -- make -j8
) - Enjoy!