How to Install Neovim on Linux Mint 21 or 20

This guide provides a comprehensive overview for those seeking to install Neovim on Linux Mint 21 or its older stable release of Linux Mint 20. Neovim, a modern and extensible variant of the well-known Vim text editor, offers an enhanced experience for developers and Linux enthusiasts by addressing Vim’s limitations while retaining its core functionalities.

Key Differences Between Neovim and Vim:

  • Extensibility: Neovim is designed for easy plugin integration, supporting plugins written in various programming languages. This feature allows for a broader and more potent extension than Vim.
  • Asynchronous Processing: With support for asynchronous processing, Neovim can execute tasks like syntax checking, code linting, and auto-completion without interrupting user input, resulting in a smoother and more responsive user experience.
  • Improved Defaults: Neovim introduces improved default settings for a user-friendly experience right out of the box, making it approachable for newcomers while providing the power and flexibility experienced Vim users expect.
  • Built-In Terminal Emulator: Neovim incorporates a built-in terminal emulator, enabling users to effortlessly switch between file editing and shell command execution without exiting the editor.
  • Modern Codebase: The editor boasts a refactored and cleaned-up codebase, simplifying the task for contributors and ensuring faster development, stability, and reliability.
  • Active Development Community: With a community of active and engaged developers, Neovim continuously receives improvements and new features, staying current and relevant in the dynamic programming landscape.

Neovim presents a compelling option for Linux Mint users, offering a powerful, flexible, and extensible text editor designed to boost productivity and improve the computing experience. Whether you are a seasoned Vim user exploring new alternatives or a text editor novice, Neovim is worth considering. The subsequent sections of this guide will walk you through the steps to install Neovim on Linux Mint 21 or Linux Mint 20 using either apt or flatpak.

Install Neovim on Linux Mint 21 or 20 via APT

Step 1: Update Linux Mint Before Neovim Installation

Before proceeding, ensure your system is up-to-date using the following command:

sudo apt update && sudo apt upgrade 

Step 2: Install Neovim

Option 1: Install Neovim with APT Default Repository

Installing Neovim using the standard repository is the easiest method for most users. Install Neovim using the following command:

sudo apt install neovim

For users who want a more updated version, we recommend using one of the PPA versions created by the Neovim team.

Option 2: Install Neovim on Linux Mint 21 or 20 via Neovim PPA

One version can be installed simultaneously. If you import both, the unstable version will be installed, as it is the newest version.

First, import either the stable or unstable Neovim PPA. For most users, the stable PPA is what you should be importing as it is the latest stable release.

Import Stable Neovim PPA:

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

Import Unstable Neovim PPA:

sudo add-apt-repository ppa:neovim-ppa/unstable -y

Run an APT update to sync the changes in your packages index:

sudo apt update

With the PPA imported, install Neovim on Linux Mint 21 or 20 via the PPA:

sudo apt install neovim

Alternatively, you can use the upgrade command if you have the editor installed already. However, we would always advise running the install command.

Install Neovim on Linux Mint 21 or 20 via Flatpak and Flathub

In this section, we’ll explore an alternative installation method for Neovim using the Flatpak package manager, which comes pre-installed on Linux Mint desktops unless you’ve removed it.

The advantage of using Flatpak with the Flathub repository is that you’ll always have the most up-to-date version compared to the Linux Mint default repository, which focuses on stability with older versions that only see updates for security issues or critical bugs.

Enable Flatpak For Neovim on Linux Mint

First, enable Flatpak by entering the following command in your terminal:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Install Neovim on Linux Mint 21 or 20 via Flatpak Command

Now, run the Neovim installation using the following Flatpak command:

flatpak install flathub io.neovim.nvim -y

Launch Neovim on Linux Mint 21 or 20

After installation, this section will explore different methods to launch Neovim on Linux Mint. These methods appeal to users who favor the terminal or desktop environment for their work.

CLI Methods to Launch Neovim on Linux Mint

To launch Neovim from the terminal, enter the following command:

neovim

For Flatpak users, run the following command instead:

flatpak run io.neovim.nvim

GUI Methods to Launch Neovim on Linux Mint

You can find the Neovim application icon for desktop users and add it to your favorites. To locate the Neovim application, follow this path:

Taskbar > Activities > Neovim
Screenshot demonstrating how to launch Neovim from the taskbar on Linux Mint 21 or 20.
Quick Access: Launching Neovim from Linux Mint Taskbar with a Simple Click

Getting Started with Neovim on Linux Mint 21 or 20

This section will cover some essential tips and customizations to help you start with Neovim on your Linux Mint system. These tips will enhance your Neovim experience and make your workflow more efficient.

General Neovim Tips with Linux Mint

  • Switching between modes: Neovim, like Vim, has multiple modes. The primary modes are Normal, Insert, and Visual. To switch between modes, use the following key commands:
    • Normal mode: Press Esc to return to Normal mode from any other mode.
    • Insert mode: Press i in Normal mode to enter Insert mode.
    • Visual mode: Press v in Normal mode to enter Visual mode.
  • Saving and quitting: To save changes to your file, press :w in Normal mode. To quit Neovim, press :q. To save and quit simultaneously, press :wq.
  • Undo and redo: In Normal mode, press u to undo the last action and Ctrl + r to redo the action.

Neovim Customizations with Linux Mint

  • Neovim configuration file: Neovim uses a configuration file called init.vim to store user settings and customizations. This file is located at ~/.config/nvim/init.vim. Create this file if it doesn’t exist.
  • Changing the color scheme: To change the color scheme in Neovim, add the following line to your init.vim file and replace colorscheme_name with the desired scheme:vim
colorscheme colorscheme_name
  • Enabling line numbers: To display line numbers in Neovim, add the following line to your init.vim file:vim
set number
  • Installing plugins: Neovim supports many plugins to extend its functionality. We recommend using a plugin manager like vim-plug to simplify plugin installation and management. Follow the installation instructions in the vim-plug repository and add your desired plugins to the init.vim file.

Other Neovim Tips with Linux Mint

  • Searching within a file: To search for a specific word or pattern within a file, press / in Normal mode, type your search query, and press Enter. To navigate between search results, press n to move forward and N to move backward.
  • Split windows: Neovim allows you to split the window horizontally and vertically. To create a horizontal split, press :split in Normal mode. To create a vertical split, press :vsplit. To navigate between split windows, use Ctrl + w followed by h, j, k, or l.
  • Copy and paste: To copy the text in Neovim, first enter Visual mode by pressing v in Normal mode. Select the text you want to copy and press y to yank it. To paste the copied text, move the cursor to the desired position and press p in Normal mode.
Screenshot displaying Neovim’s default UI upon first launch on Linux Mint 21 or 20 desktop.
Initial View: Neovim’s Default User Interface on Linux Mint Desktop

Additional Neovim Management Commands on Linux Mint 21 or 20

This section will cover additional commands and tips for updating and removing Neovim on your Linux Mint system. These tips will help you maintain your Neovim installation and manage your system resources.

Update Neovim on Linux Mint 21 or 20

Although updates should appear in notifications, checking for updates using the terminal periodically is a good idea. Use one of the following commands, depending on your installation method:

APT Update Method For Neovim on Linux Mint:

sudo apt update

Flatpak Update Method For Neovim on Linux Mint:

flatpak update

Remove Neovim From Linux Mint 21 or 20

If you no longer need Neovim, use one of the following commands based on your original installation method to remove the application:

APT Remove Method For Neovim on Linux Mint:

sudo apt remove neovim

For users who installed Neovim using one of the two listed PPAs, use the following command to remove the repository. If you’re downgrading from the unstable to the stable version, re-import the stable repository using the earlier steps.

sudo add-apt-repository ppa:neovim-ppa/stable -y
sudo add-apt-repository ppa:neovim-ppa/unstable -y

Flatpak Remove Method For Neovim on Linux Mint:

flatpak remove  --delete-data io.neovim.nvim -y

Conclusion

In conclusion, installing Neovim on Linux Mint is a straightforward process that offers multiple methods, including APT, Flatpak, and Neovim PPA. Each method has its advantages, with APT providing stable versions, Flatpak ensuring up-to-date releases, and Neovim PPA catering to those who prefer stable or unstable versions directly from the Neovim team. By following the steps outlined in this guide, you’ll have a powerful and customizable text editor at your fingertips, ready to enhance your productivity on Linux Mint.

Leave a Comment