Building neovim: A Comprehensive Guide
neovim is a highly customizable and a lightweight text editor (it can be configured to something much more!)
While it maybe installed to your system by using your favorite package manager, it is best used if you build it from source!
So enough talking and let's start building 🧱!
Prerequisites
Before you start building Neovim, you need some build dependencies installed on your system (psst you might need to update your package list by
sudo apt-get update
on Ubuntu/Debian!):
Ubuntu/Debian
sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
CentOS/RHEL/Fedora
sudo yum -y install ninja-build libtool autoconf automake cmake gcc gcc-c++ make pkgconfig unzip patch gettext curl
openSUSE
sudo zypper install ninja libtool autoconf automake cmake gcc-c++ gettext-tools curl
Arch Linux
sudo pacman -S base-devel cmake unzip ninja tree-sitter curl
Alpine Linux
apk add build-base cmake automake autoconf libtool pkgconf coreutils curl unzip gettext-tiny-dev
Void Linux
xbps-install base-devel cmake curl git
FreeBSD
sudo pkg install cmake gmake libtool sha automake pkgconf unzip wget gettext curl
OpenBSD
doas pkg_add gmake cmake libtool unzip autoconf-2.69p2 automake-1.15p0 curl
export AUTOCONF_VERSION=2.69
export AUTOMAKE_VERSION=1.15
OpenBSD
doas pkg_add gmake cmake libtool unzip autoconf-2.69p2 automake-1.15p0 curl
export AUTOCONF_VERSION=2.69
export AUTOMAKE_VERSION=1.15
MacOS/Homebrew
brew install ninja libtool automake cmake pkg-config gettext curl
Building neovim
Once you have installed the dependencies, you can start building neovim. The following steps will guide you through the process:
- Clone the neovim repository
git clone https://github.com/neovim/neovim.git
- Navigate to the cloned repository
cd neovim
- Build neovim
make CMAKE_BUILD_TYPE=RelWithDebInfo
This might take some time, so you while you wait, you can go get a cup of Mocha ☕
- Install Neovim system wide Great! You've build neovim. But now, you need to install it to your system
sudo make install
- Now if that's done finishing you should be able to start neovim by typing
neovim
in your terminal of choice.
If Neovim is successfully installed, this command should start the editor.
That's it! You've successfully built neovim from source!
sudo make install
- Run neovim
nvim
If Neovim is successfully installed, this command should start the editor.
Congratulations, you have successfully built Neovim from source!
Top comments (0)