Neovim is a highly configurable and extensible text editor designed as a fork of Vim, aiming to improve upon its predecessor by offering enhanced features, modern integration, and a more streamlined user experience. It is particularly favored by developers who require a powerful editor that supports a wide range of plugins, scripting languages, and customization options. Neovim is built to be fast and efficient, with support for asynchronous tasks and improved user interface elements, making it an ideal choice for both programming and general text editing.
On Fedora 40 or 39, Neovim can be installed via Fedora’s AppStream, providing a stable and well-integrated version that aligns with the system’s package management. For users who prefer a more isolated environment or want access to potentially newer versions, Neovim can also be installed using Flatpak with Flathub. This guide will walk you through both installation methods, helping you choose the one that best suits your workflow.
Method 1: Install Neovim via Fedora Appstream
Update Fedora’s Packages Before Neovim Installation
It’s always a good idea to begin installation by updating your system’s existing packages. This ensures you’re not installing new software on an outdated system, which can sometimes lead to compatibility issues.
To update your Fedora system, open your terminal and enter the following command:
sudo dnf upgrade --refresh
This command updates all of your currently installed packages and refreshes your system’s repositories to ensure the latest versions are available for installation.
Install Neovim via DNF Command
You can proceed with the Neovim installation now that your system is up-to-date. To install Neovim from Fedora’s DNF repository, input the following command:
sudo dnf install neovim
Upon running this command, DNF will fetch Neovim from its repository and handle the installation for you.
Method 2: Install Neovim via Flatpak and Flathub
Enable Flathub Repository For Neovim Installation
In this method, we will install Neovim using Flatpak with the Flathub repository. Flatpak is a universal package manager for Linux, making application distribution easier across various Linux distributions.
First, you need to add the Flathub repository to your system. To do this, type in the following command:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Despite adding the repository, sometimes it can be automatically disabled. To ensure that the repository is enabled, run the following command:
flatpak remote-modify --enable flathub
Install Neovim via Flatpak Command
With the Flathub repository enabled, you can now proceed with installing Neovim. To do so, input the following command:
flatpak install flathub io.neovim.nvim
When you run this command, Flatpak will retrieve the Neovim package from Flathub and handle the installation process for you.
Starting Neovim UI
CLI Commands to Launch Neovim
If you installed Neovim using Fedora’s DNF repository, you can start it with the following command:
nvim
If you installed Neovim using Flatpak, the command will be slightly different. This is due to the nature of Flatpak’s isolated environments. To launch Neovim installed via Flatpak, use the following command:
flatpak run io.neovim.nvim
GUI Method to Launch Neovim
Neovim can also be accessed via the Fedora desktop environment if you prefer to use a graphical interface. Follow the steps below:
- You can open the Activities overview by clicking on the ‘Activities’ option at the top left corner of your desktop.
- Click on ‘Show Applications’ located at the bottom of your screen.
- You will now see a grid of all the installed applications. Scroll through them or use the search bar at the top to find Neovim.
- Click on the Neovim icon to start the application.
Managing Neovim
Update Neovim on Fedora
Consistently keeping your applications up-to-date is necessary to retain the system’s security and benefit from the latest features and improvements. While you may get update notifications, we recommend manually checking for updates regularly.
DNF Neovim Update Command
You can refresh your repositories and update all your installed packages, including Neovim, by executing the following command in the terminal:
sudo dnf update --refresh
Flatpak Neovim Update Command
For those who have installed Neovim via Flatpak, you can update it using this command:
flatpak update
Remove Neovim
If you wish to remove Neovim from your Fedora system for any reason, you can execute a few simple commands. Please ensure that you use the correct command corresponding to the method you used for the initial installation.
DNF Neovim Remove Command
To uninstall Neovim that was installed via DNF and also remove any unused packages leftovers from the application, run the following command:
sudo dnf remove neovim
Flatpak Neovim Remove Command
If you had installed Neovim through Flatpak, you can uninstall it with the following command:
flatpak remove --delete-data io.neovim.nvim -y
Note that this command will also delete your data related to Neovim, so ensure you’ve backed up any essential files before proceeding.
Conclusion
By successfully installing Neovim on Fedora, whether through AppStream or Flatpak, you’ve equipped your system with a highly efficient and customizable text editor tailored for modern development needs. The AppStream method ensures stability and easy integration with your system, while the Flatpak option provides the flexibility of a sandboxed environment and access to potentially newer updates. To maximize your productivity with Neovim, regularly update it and explore its rich ecosystem of plugins and configurations. Staying current with updates and enhancements will help you fully leverage Neovim’s capabilities, ensuring that your editing environment remains both powerful and adaptable to your evolving needs.