Install Neovim on Raspberry Pi

Neovim is a text editor that enable the user to create and edit text files via command line. Neovim is a fork of Vim text editor. This means that development of Neovim was started from copy of Vim repository. Neovim is focused to improve plugin architecture, performance, and user experience.

This tutorial explains how to install Neovim on Raspberry Pi.

Install Neovim

Use SSH to connect to Raspberry Pi. Update the package lists and install Neovim by using the following commands:

sudo apt update
sudo apt install -y neovim

When installation is finished, we can check Neovim version:

nvim --version

Testing Neovim

Run nvim command and provide filename as argument in order to create a new file or edit an existing file:

nvim test.txt

Execute the command as superuser if you don’t have required permissions.

sudo nvim /var/log/daemon.log

File is opened in read-only mode. We need to switch to insertion mode in order to edit the file. Press the letter i to do that. When editing is complete, exit the insertion mode by pressing ESC key. Type :wq command and press the Enter key to save the file and exit Neovim. If you want to exit without saving, type :q! command.

Editing file with Neovim on Raspberry Pi

Uninstall Neovim

If you wish to completely remove Neovim and related dependencies, execute the following command:

sudo apt purge --autoremove -y neovim

We can also remove data directory of Neovim:

rm -rf ~/.local/share/nvim
sudo rm -rf /root/.local/share/nvim

Leave a Comment

Your email address will not be published. Required fields are marked *