How to install and use the ‘NeoVim’ text editor [basado en Vim]

by time news

Vi or Vim is an old default command line text editor that you will find in any Linux distribution. Definitely, Vim it’s a simple text editor, but that’s where it also has limitations. if you want that Vim works like a IDE ( Integrated development environment ), you need to acquire the additional skills to configure various plugins.

So, are you looking for an alternative to Vim ? If so, let’s take a look at NeoVim which is a fork of Vim with a focus on extensibility and agility. You can easily convert and NeoVim very close to a IDE (although this is not the goal of the NeoVim team).

NeoVim: hyperextensible text editor based on Vim

NeoVim is a refactored version from Vim containing the basic functions of Vim : fast, versatile and almost minimal with a layer of new advanced features. Being an extension of Vim , Neo’s employs new things that you might get lost in the text editor from Vim . For example, a new plugin architecture with asynchronous execution.

You may have noticed that the user interface from Vim freezes when any plugin code is executed, because all plugin code is executed synchronously in Vim . But that’s not the case with Neo’s .

Interestingly, the Neovim plugin API is also backwards compatible from Vim. If you want to change to NeoVim you can use an existing configuration of Vim for NeoVim via symbolic link ~/.config/nvim/init.vim to your Vim configuration file.

Besides, NeoVim has out-of-the-box support for LSP ( language server protocol ) that enables options like code highlighting, syntax checking, and automatic code completion.

Features of NeoVim

Here is the summary of the characteristics of NeoVim :

  • modal edition
  • Extremely customizable
  • Powerful and asynchronous plugins in any language
  • Better GUI architecture
  • Very fast text editing
  • A vast community of plugins and themes.
  • built-in terminal support
  • external GUI
  • great color schemes
  • Compatible with most Vim plugins, including Ruby and Python plugins
  • Entorno Lua 5.1 integrated optional

let’s install Neo’s to know more about it.

Install NeoVim on Linux systems

There are many ways to install and use Neo’s on Linux distributions:

Install NeoVim using the repository

It is possible that NeoVim does not come pre-installed, but is available in the community repository of major Linux distributions, which you can easily install using the corresponding default package manager.

$ sudo apt install neovim [En Debian, Ubuntu y Mint ]
$ sudo yum install neovim [En RHEL/CentOS/Fedora y Rocky/AlmaLinux ]
$ sudo emerge -a app-editors/neovim [En Gentoo Linux ]
$ sudo apk agregar neovim [En Alpine Linux ]
$ sudo pacman -S neovim [En Arch Linux ]
$ sudo zypper install neovim [En OpenSUSE ]    

Install NeoVim using Snap

As universal package manager is becoming a new trend, you can use Snap package manager Ubuntu pre-installed to get NeoVim on any Linux distribution using a single command:

$ sudo instalación rápida nvim --clásico

Install NeoVim using Flatpak

In the same way Snap you can also install Neo’s on any linux distribution using the package manager Flatpak . If you already have Flatpak on your system, just run:

$ sudo flatpak install flathub io.neovim.nvim

How to use NeoVim on Linux systems

Once you have installed NeoVim on your linux system, open terminal and type ‘ nvim ‘ (no ‘ Neo’s ‘) to open NeoVim :

$ nvim

Run the NeoVim text editor

As you can see in the screenshot above, you get an initial background on the basic commands you can use in NeoVim . how to simply write ":help nvim"to display a summary of the Nvim tool. To exit or exit the application type ":q".

Help NeoVim

Open the Neovim terminal emulator

Do you want to open a terminal emulator from NeoVim ? just type ":terminal"o ":te". To exit the terminal in NeoVim scribe ":q"to go out.

Neovim Terminal Emulator

Configure NeoVim on Linux systems

Let’s move on to an important function of configuring plugins in NeoVim that provides an integrated experience and makes life easier.

NeoVim use the XDG base directory specification to place your configuration files. It means that it follows the standard Linux location convention for configuration files, i.e. ~/.config/nvim/init.vim o $XDG_CONFIG_HOME .

If you couldn’t find the default config file in your home folder, just create it manually:

$ mkdir ~/.config/nvim/
$ toque ~/.config/nvim/init.vim

Now open the file ~/.config/nvim/init.vim using the command nvim :

$ nvim ~/.config/nvim/init.vim

Then press "i"to add the following basic configuration to the file:

"Lo esencial
establecer fondo = oscuro
establecer portapapeles = sin nombre más
establecer ratón = un
establecer número
establecer título

Basic Neovim configuration

After adding the line, press "Esc"and write :wqto save and exit the file. If you open the same configuration file again, you will see some changes like numbering and title.

Open the Neovim configuration file

Install plugins in NeoVim

Now, let’s take an example of installing one of the plugins Telescope . Telescope.nvim is a fuzzy search matcher for NeoVim . To configure Telescope you must first have the extension installed Vim-Plug using the following curl command:

$ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/ vim-enchufe/maestro/enchufe.vim'

Install the NeoVim Vim-Plug extension

Then open the file ~/.config/nvim/init.vim again and add the following lines:

llamar a conectar#comenzar()
        Conecte 'nvim-telescope/telescope.nvim'
llamar a conectar#finalizar()

Add Telescope plugin settings to NeoVim

The above line is basically to add the name of the extension. You can also add multiple plugins at once by just prefixing Plug with the repository path as above. It’s a Vim-Plug which reads a part of the configuration file to find the extension in GitHub and install it in the editor.

Adding the extension name is not enough, now you also need to save the config file, reboot NeoVim and run it :PlugInstallin command mode to install the extensions.

Install the telescope plugin in NeoVim

Execute :PlugInstallwill open a window showing the installation process of each extension. After installation, reboot NeoVim and check if the telescope is installed correctly or not running ":checkhealth telescope"command mode.

Check the telescope plugin in NeoVim

As you can see, Telescope has dependency issues, which means you also need to install all the necessary plugins so that Telescope work.

So as usual just add the multiple extension name in a config file ~/.config/nvim/init.vim in the following format:

llamar a conectar#comenzar()
    Conecte 'nvim-telescope/telescope.nvim'
    Conecte 'nvim-lua/plenary.nvim'
    Conecte 'nvim-treesitter/nvim-treesitter'
    Enchufe 'Sushi quemado/ripgrep'
    Enchufe 'sharkdp/fd'
llamar a conectar#finalizar()

Add multiple extensions to NeoVim setup

now run :PlugInstallto install all uninstalled plugins.

Install plugins in NeoVim

Once everything is installed, type :Telescopein command mode and you will see the extension running and displaying all available commands.

Run the Telescope plugin in NeoVim

You can explore and get more NeoVim plugins and follow the same method above to install it and convert your text editor de NeoVim in a IDE .

Is NeoVim better than Vim?

Ultimately, you may want to know directly if NeoVim is better than Vim yes NeoVim it’s faster than Vim . Well, it can’t be a simple answer, because if you are already well versed in all the commands and tricks of configuring Vim you might think twice before jumping into a steep initial learning curve of NeoVim and waste your learning progress of Vim .

For a beginner you may not have to think as you can hop on NeoVim which will give you a tour of the basic functionality of Vim along with other new features that you miss in Vim for a better coding experience. Surely, you will still have to go through a steep learning curve, whether you choose Vim o NeoVim .

Interestingly, with many extensible editors like VS Code y Atom you can implement the extension NeoVim from your marketplace to use its familiar interface with all the key combinations mapped correctly.

So go try NeoVim and tell us about your experience with NeoVim .

Pin It

You may also like

Leave a Comment