How to install neovim in Ubuntu 22.04

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to install Neovim on Ubuntu 22.04.

Neovim is a free and open source text editor that is based on Vim.

The difference between Neovim and Vim is that, Neovim allows you to do a lot more as Neovim is extensible, meaning you can install different extensions to make your working environment more productive.

Neovim can be installed on Ubuntu 22.04 via the terminal, by using the apt package manager, as neovim package is available in the default Ubuntu repositories.

Install Neovim in Ubuntu 22.04

Step 1 - Update Package Index

Before proceeding to install Neovim, update the package index on your Ubuntu machine. Updating the package index, ensures that you can use the universe repository that is enabled by default on your system.

To update the package index, you can use any package manager, or simply use the default package manager apt.

sudo apt update

Step 2 - Install Neovim

Now that your package index is updated, you should be able to download Neovim package from the universe repository.

To do so, simply run the command below.

sudo apt install neovim

Step 3 - Verify Neovim Installation

Next, verify that Neovim was installed correctly. One way of verifying if Neovim was installed correctly, is by checking the version that you installed.

This way you can see if Neovim is working after installation .

You can check Neovim version, by using the --version option.

nvim --version

Step 4 - Use Neovim

The command above displayed the Neovim that we installed in this tutorial, this means Neovim was installed correctly, and we can proceed to launch Neovim.

To launch Neovim via terminal, run the following.

nvim

That's it! As you can see Neovim is launched.

Uninstall Neovim in Ubuntu 22.04

You can uninstall Neovim by using the apt package manager. To do so, simply run the command below.

sudo apt remove neovim

If you want to also remove the config files, then you can do so by using the --purge option.

sudo apt remove neovim --purge

Conclusion

In this tutorial, you learned how to install Neovim in Ubuntu 22.04, by downloading and installing the official package of Neovim neovim from the universe repository.