DEV Community

Async hronous
Async hronous

Posted on • Updated on

Building Neovim from source

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
Enter fullscreen mode Exit fullscreen mode

on Ubuntu/Debian!):

Ubuntu/Debian

sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
Enter fullscreen mode Exit fullscreen mode

CentOS/RHEL/Fedora

sudo yum -y install ninja-build libtool autoconf automake cmake gcc gcc-c++ make pkgconfig unzip patch gettext curl
Enter fullscreen mode Exit fullscreen mode

openSUSE

sudo zypper install ninja libtool autoconf automake cmake gcc-c++ gettext-tools curl
Enter fullscreen mode Exit fullscreen mode

Arch Linux

sudo pacman -S base-devel cmake unzip ninja tree-sitter curl
Enter fullscreen mode Exit fullscreen mode

Alpine Linux

apk add build-base cmake automake autoconf libtool pkgconf coreutils curl unzip gettext-tiny-dev
Enter fullscreen mode Exit fullscreen mode

Void Linux

xbps-install base-devel cmake curl git
Enter fullscreen mode Exit fullscreen mode

FreeBSD

sudo pkg install cmake gmake libtool sha automake pkgconf unzip wget gettext curl
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

MacOS/Homebrew

brew install ninja libtool automake cmake pkg-config gettext curl
Enter fullscreen mode Exit fullscreen mode

Building neovim

Once you have installed the dependencies, you can start building neovim. The following steps will guide you through the process:

  1. Clone the neovim repository
   git clone https://github.com/neovim/neovim.git
Enter fullscreen mode Exit fullscreen mode
  1. Navigate to the cloned repository
   cd neovim
Enter fullscreen mode Exit fullscreen mode
  1. Build neovim
   make CMAKE_BUILD_TYPE=RelWithDebInfo
Enter fullscreen mode Exit fullscreen mode

This might take some time, so you while you wait, you can go get a cup of Mocha ☕

  1. Install Neovim system wide Great! You've build neovim. But now, you need to install it to your system
   sudo make install
Enter fullscreen mode Exit fullscreen mode
  1. 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
Enter fullscreen mode Exit fullscreen mode
  1. Run neovim
   nvim
Enter fullscreen mode Exit fullscreen mode
If Neovim is successfully installed, this command should start the editor.
Enter fullscreen mode Exit fullscreen mode

Congratulations, you have successfully built Neovim from source!

Top comments (0)