How to Compile NEOVIM from Scratch

When some plugin wants the latest version and your operating system repository doesnt have it yet.


How to Compile NEOVIM from Scratch


When some plugin wants the latest version of Neovim and your operating system repository doesn’t have it yet, the solution is to compile it from scratch or download an AppImage when available.

Let’s see that this task is very simple and in this example we will show in Ubuntu 22.04 LTS and you can adapt to any other system, using search from your package manager.


Dependencies

First of all remove Neovim from your system:

sudo apt remove neovim --purge
sudo apt autoremove autoclean clean

Now install the necessary dependencies:

sudo apt update
sudo apt install git build-essential cmake git pkg-config libtool g++ libunibilium4 libunibilium-dev \
ninja-build gettext libtool libtool-bin autoconf automake unzip curl doxygen lua-term lua-term-dev luarocks

In the case of Ubuntu, when the latest version is already installed, it doesn’t reinstall unless you want to indicate the parameter for it.


Building

Now just clone from repository

NOTE: it is necessary first to use the command make CMAKE_BUILD_TYPE=RelWithDebInfo so that there is no lag when exiting Neovim, because in this case, we will use CMake .

git clone https://github.com/neovim/neovim
neovim cd
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install

See here the path where everything is installed.


Solving possible problems

If you have trouble reading the lfs of Lua install with LuaRocks:

sudo luarocks install luafilesystem

Sometimes the Neovim development team makes an AppImage version available in releases, if not, of course, there will be ready-made binaries here, if you prefer .


Useful links


neovim


Share


YouTube channel

Subscribe


Marcos Oliveira

Marcos Oliveira

Software developer
https://github.com/terroo

Related articles