In this article, we will review installing and using Vi or Vim, a versatile and powerful text editor commonly found in Unix-based operating systems like
Learn how to install NeoVim on RHEL 9 with this step-by-step guide. Includes CLI examples, configuration tips, and plugin setup to enhance your editing experience on RHEL.
Neovim is a powerful, extensible text editor that’s rapidly gaining traction among developers, system administrators, and power users. With features like better plugin management, asynchronous job control, and enhanced performance over Vim, Neovim is an essential tool for many. This guide will walk you through the steps to install NeoVim on RHEL 9, from installing dependencies to launching your first NeoVim session. We’ll also cover some basic configurations to get you started.
Why NeoVim on RHEL 9? |
If you’re working on RHEL 9 Workstation, you may find the default editor, vim
, to be somewhat limiting. NeoVim offers a modern take, maintaining compatibility with Vim configurations while adding enhancements that appeal to coders and sysadmins alike.
Key Benefits of NeoVim: |
Step 1: Prepare Your System |
Before diving into the installation, ensure your system is updated. This helps avoid conflicts during the installation process.
sudo dnf update -y
Step 2: Install Prerequisites |
Neovim requires several libraries and development tools. Use the command below to install the necessary packages.
sudo dnf install -y gcc make cmake unzip curl gettext tar xclip
Step 3: Install Neovim |
Neovim is available in the Extra Packages for Enterprise Linux (EPEL) repository, making installation straightforward on RHEL 9. Below, we’ll cover how to enable EPEL and install Neovim.
Option 1: Install from the EPEL Repository |
Enable the EPEL Repository: The EPEL repository provides access to additional packages, including Neovim:
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf install epel-release -y
Install NeoVim and Dependencies: Now that EPEL is enabled, install NeoVim along with all required dependencies:
sudo dnf install neovim -y
The installation includes essential packages like libvterm
, luajit
, msgpack
, and others to support NeoVim’s extended features.
Photo by admingeek from Infotechys
Verify the Installation: Check the installation and version to confirm NeoVim is ready:
nvim --version
Photo by admingeek from Infotechys
Option 2: Download and Install the AppImage (Alternative Method) |
If you prefer to use the latest AppImage release from GitHub, follow these steps:
Download the Neovim AppImage |
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
Make the AppImage executable |
chmod u+x nvim.appimage
Move Neovim to a directory in your PATH for easy access |
sudo mv nvim.appimage /usr/local/bin/nvim
Verify the installation |
nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info
Step 4: Set Up Neovim Configuration |
Neovim, like Vim, uses a configuration file (init.vim
) to manage settings. Let’s create this file and set some basic configurations.
mkdir -p ~/.config/nvim
touch ~/.config/nvim/init.vim
Add some initial configurations by editing init.vim
:
vim ~/.config/nvim/init.vim
Here’s a simple starter configuration:
" Enable line numbers
set number
" Enable syntax highlighting
syntax on
" Use spaces instead of tabs
set expandtab
set tabstop=4
set shiftwidth=4
Step 5: Install NeoVim Plugin Manager (Optional) |
For plugin management, vim-plug
is a popular choice. It’s efficient, lightweight, and easy to use.
vim ~/.config/nvim/init.vim
Install vim-plug: |
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Add Plugin Configurations to |
Here’s how to add a sample plugin, such as gruvbox
for a color theme:
call plug#begin('~/.config/nvim/plugged')
Plug 'morhetz/gruvbox'
call plug#end()
call plug#begin('~/.local/share/nvim/plugged')
Plug 'tpope/vim-sensible'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
call plug#end()
This configuration tells NeoVim where to look for plugins and specifies a few sample plugins.
Install the Plugin in Neovim: |
Open Neovim and run the following command to install the plugin:
:PlugInstall
Photo by admingeek from Infotechys
Step 6: Verify Your Installation |
After setting up Neovim, check to make sure it’s working correctly.
Open Neovim |
nvim
Open the Command Mode and Check Plugins |
In Neovim, press :
to open the command mode, then type :PlugStatus
to see the status of your plugins.
Photo by admingeek from Infotechys
Step | Description | Command |
---|---|---|
System Update | Update your RHEL 9 system | sudo dnf update -y |
Install Prerequisites | Install essential tools and libraries | sudo dnf install -y gcc make cmake unzip curl gettext tar xclip |
Download Neovim | Download the Neovim AppImage | curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage |
Set Permissions | Make AppImage executable | chmod u+x nvim.appimage |
Move to PATH | Move Neovim to a directory in PATH | sudo mv nvim.appimage /usr/local/bin/nvim |
Verify Installation | Check Neovim version | nvim --version |
Create Config File | Set up Neovim configuration | mkdir -p ~/.config/nvim and touch ~/.config/nvim/init.vim |
Install vim-plug | Install Plugin Manager | curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
Below are some CLI examples and commands you can use to customize and enhance your Neovim experience.
Setting a Custom Color Scheme |
To set a new color scheme, add the following line to your init.vim
file. For instance, using the popular gruvbox
theme:
" Set Color Scheme:
colorscheme gruvbox
Then reload your configuration:
source ~/.config/nvim/init.vim
Key Mapping for Faster Navigation |
Key mappings can save you time. Here’s an example to remap the jk
key combination to exit insert mode:
" Set Key Mappings:
inoremap jk
Neovim supports various plugins that can improve productivity, especially for coding. Here are some popular plugins:
Plugin | Purpose | Installation Command in init.vim |
---|---|---|
NERDTree | File Explorer | Plug 'preservim/nerdtree' |
coc.nvim | Language Server Protocol (LSP) support | Plug 'neoclide/coc.nvim', {'branch': 'release'} |
lightline.vim | Lightweight status line | Plug 'itchyny/lightline.vim' |
vim-airline | Enhanced status/tab line | Plug 'vim-airline/vim-airline' |
vim-commentary | Quick commenting | Plug 'tpope/vim-commentary' |
vim-surround | Easy manipulation of surrounding characters | Plug 'tpope/vim-surround' |
To install these plugins, add the corresponding Plug
command in the init.vim
file and then run :PlugInstall
in Neovim.
call plug#begin('~/.local/share/nvim/plugged')
" List plugins below:
Plug 'preservim/nerdtree'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'itchyny/lightline.vim'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
call plug#end()
:PlugInstall
Photo by admingeek from Infotechys
Neovim Not Found in Path |
Ensure the AppImage file was moved to /usr/local/bin
or another directory in your PATH
. Run echo $PATH
to confirm.
Permission Denied on Plugin Install |
This often occurs if you’re trying to install plugins in a directory without write permissions. Ensure you have ownership of the ~/.config/nvim/plugged
directory.
Neovim Freezes with Heavy Plugins |
Some plugins may slow Neovim. Consider disabling or limiting plugins if you encounter performance issues.
By following these steps, you’ve successfully installed and configured Neovim on RHEL 9. This setup provides you with a powerful, customizable editor that enhances productivity and aligns with modern coding practices. As you grow more familiar with Neovim, explore additional plugins, themes, and configurations that suit your workflow.
Did you find this article useful? Your feedback is invaluable to us! Please feel free to share your thoughts in the comments section below and share this post!
In this article, we will review installing and using Vi or Vim, a versatile and powerful text editor commonly found in Unix-based operating systems like
In this article, we will review in detail how to install sublime text4 on CentOS8 or RHEL8 and also provide examples. Table of Contents Brief
This article covers how to install Vim on Ubuntu 24.04 with our comprehensive guide. Learn the steps to set up Vim using APT or from