All Articles

Installing Neovim on a Raspberry Pi

When booting a fresh installation of Raspbian, the version of neovim that comes as part of the apt repositories is currently: neovim/stable 0.1.7-3 armhf

This usually isn’t a recent enough build for most plugins that you’ll want to use. So it’s often necessary to build neovim from source, below list the steps to do so:

Firstly, you need some prerequisites installed:

  • git
  • cmake
  • automake
  • libtool
  • libtool-bin
  • gettext
  • python3-pip

You can install these with the normal apt procedure e.g.

sudo apt install cmake automake libtool libtool-bin gettext

Once complete, you can proceed to clone the repository for neovim from: here using the command:

git clone https://github.com/neovim/neovim.git

Change into the newly created directory and run the install commands:

cd neovim
make -j8 CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
pip3 install --user neovim

This will take a while depending on which version of the Raspberry Pi you’re using. However, once complete you should now have a working Neovim setup on Raspbian, verify this with:

pi at pi3☁️  in ~
$ nvim --version
NVIM v0.3.2-1043-ge9685d9f7
Build type: RelWithDebInfo

You can then proceed to set neovim as your default editor:

sudo update-alternatives --install /usr/bin/vi vi "$(command -v nvim)" 60
sudo update-alternatives --config vi

sudo update-alternatives --install /usr/bin/vim vim "$(command -v nvim)" 60
sudo update-alternatives --config vim

sudo update-alternatives --install /usr/bin/editor editor "$(command -v nvim)" 60
sudo update-alternatives --config editor

NB: If you run nvim and get a bunch of errors, just run :checkhealth and Google around until you find solutions for those errors.