NeoVim Setup

  1. Install NeoVim:
$ curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
$ sudo rm -rf /opt/nvim
$ sudo tar -C /opt -xzf nvim-linux64.tar.gz
$ echo 'export PATH="$PATH:/opt/nvim/"' >> ~/.bashrc

Verify NVim paths:

$ nvim .
:echo stdpath("config")
:echo stdpath("data")
  1. Install plugin manager (vim-plug)
$ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  1. Apply setup:
$ cp -r nvim/ ~/.config/
$ nvim .
:PlugInstall

Dependencies

C++ LSP:

$ sudo apt install clangd libstdc++-12-dev

Fonts

$ mkdir -p ~/.local/share/fonts && cd ~/.local/share/fonts && curl -fLO https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/DroidSansMono/DroidSansMNerdFont-Regular.otf

Language configs

Cpp

"By default, clangd will assume your code is built as clang some_file.cc, and you’ll probably get spurious errors about missing #included files, etc. There are a couple of ways to fix this.

compile_commands.json This file provides compile commands for every source file in a project. It is usually generated by tools." https://clangd.llvm.org/installation#compile_commandsjson

Cmake:

$ cd build
$ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..

Make

$ make clean; bear -- make