How to Install Neovim on Ubuntu 22.04

Written by: Subhash Chandra   |   Last updated: November 15, 2022

Neovim is an easy-to-use fork of the well-known text editor VIM. You can also use a GUI, IDEs, web browser to embed Neovim as an editor. It provides asynchronous job control with better functionality and reusability. Neovim is an open-source tool that is available for all major operating systems, and it supports XDG-based directories.

In this tutorial, we will learn how to install the Neovim text editor on Ubuntu.

Ubuntu supports multiple methods to install Neovim on Ubuntu. Here, we will list some of the most used methods for installing Neovim.

Install Neovim on Ubuntu

The Neovim version available on your operating system repository is not always the latest available version. To install the latest version of Neovim, you must download it first on your computer and then install it manually. The latest Neovim images are available to download on GitHub:

https://github.com/neovim/neovim/releases/tag/v0.7.2

Follow this procedure to install the latest version of Neovim on Ubuntu 22.04:

Step 1. Log on to the Neovim GitHub repository

https://github.com/neovim/neovim/releases/tag/v0.7.2

As of writing this article, the latest version available is Neovim 0.7.

Step 2. Download Neovim Tar File

Locate and download the latest available Neovim package for Linux x64, available at the bottom of the page in the Assets section:

neovim package on github

Step 3. Extract the contents of the Neovim package

tar xzvf nvim-linux64.tar.gz
extract neovim tar file

Step 4. Run the command to start the Neovim

Run the following command to start the nvim:

./nvim-linux64/bin/nvim

Alternative Ways to Install Neovim

You may also install neovim using apt , PPA or appimage.

Using apt

Ubuntu provides Advanced Packaging Tool (APT) command-line utility to install packages on your system. You can easily install the Neovim package from the package repository using the apt. If you are keen to have the latest version download and install from Github.

It is always a good idea to update your package repository before you install any package.

sudo apt update

Once the package repository is updated, you can install Neovim on your computer using the following sudo apt install command:

sudo apt install neovim

After the installation is complete, you can start Neovim from the applications. The welcome window of Neovim looks like this:

neovim home screen

As of writing this guide, the apt repository has Neovim 0.6 version, which we have installed. This is a stable version suitable for a normal user.

Using PPA

Ubuntu supports using Personal Package Archive (PPA) where you can add application or tool packages for installation. Neovim is available on PPA and you can install Neovim using the apt package manager.

PPA has both stable and unstable versions that Neovim support. The following links list the currently available stable and unstable versions of Neovim:

  • https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable
  • https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable

The following procedure shows you how to install Neovim on Ubuntu 22.04 using PPA:

1. Install the software-properties-common package to enable the use of the add-apt-repository function:

sudo apt install software-properties-common

2. Add the PPA repository on your Ubuntu computer using:

sudo add-apt-repository ppa:neovim-ppa/stable
neovim PPA

3. Update the PPA repository to get a list of the most recent versions of all the packages:

sudo apt update

4. Install the latest available stable version of Neovim:

sudo apt install neovim

Using the PPA also got the latest version of Neovim 0.7.

Using AppImage

Ubuntu supports the AppImage format that you can use to run Neovim without installing the tool on your operating system. AppImage works on most Linux distributions.

Follow this procedure to run the Neovim text editor on Ubuntu Linux using AppImage:

1. Download the Neovim AppImage package using:

curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage

2. Make the Neovim AppImage file executable by the currently logged-in user, by running the chmod command:

chmod u+x nvim.appimage

3. Run the Neovim AppImage:

./nvim.appimage

4. If the above step fails, then extract the AppImage contents:

./nvim.appimage --appimage-extract

5. Check the Neovim tool version and run the tool using AppImage by using the following commands:

./squashfs-root/AppRun –version
./squashfs-root/AppRun

Uninstall Neovim

If you do not want to use the Neovim text editor and you want to remove it from your system, then you can uninstall Neovim and all its dependent files:

sudo apt -y autoremove neovim

Remove Neovim Package and Configuration

The above command just uninstalls Neovim, however, if you want to remove all the configurations and data of Neovim, then use the following command:

sudo apt -y purge neovim

Install Plugins Using Vim-plug

Vim-plug is an open-source and minimalist Vim plugin manager that you can use to install and update Vim plugins. Vim-plug can load plugins on-demand to ensure faster boot time. It can also create plugin clones to minimize download time and disk space.

The first step is to install the Vim-plug:

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

To install a plugin using the Vim-plug plugin manager, just type PlugInstall in the Neovim command line.

Some of the most useful Neovim plugins are as follows:

  • Nvim Treesitter- Provides improved and effective syntax highlighting for your code.
  • Telescope- Fuzzy finder that you can expand to search files and search content within the file.
  • Hop- Enables you to jump into a document with a minimal number of screenshots.
  • Barbar- Manages tabs in the Neovim editor.

Try these plugins to make the best of the Neovim text editor.

Related Read: How to Install Plugins in Neovim

Conclusion

Neovim is very easy to use. If you are familiar with Vim, you should be able to use it effectively. Neovim enables you to code easily and makes the best out of a text editor. Some of the alternatives to Neovim are Vim, GNU nano, and Sublime Text.

If you have any questions or feedback about this article, please do let us know in the comment section below.

About The Author

Subhash Chandra

Subhash Chandra

Subhash Chandra, an Oracle Certified Database Administrator and professional writer, works as a Consulting User Assistance Developer at Oracle, bringing over 15 years of experience to the role. He enjoys sharing his technological passion through how-to articles, simplifying complex concepts in Linux, Windows, Mac OS, and various other platforms and technologies for a wide audience.

SHARE

Comments

Please add comments below to provide the author your ideas, appreciation and feedback.

Leave a Reply

Leave a Comment