DEV Community

Cover image for Neovim
Robert Vásquez
Robert Vásquez

Posted on

Neovim

Neovim, also known as nvim, is a highly configurable and extensible text editor. It is based on Vim and has been developed with the goal of improving efficiency, performance, and ease of use. Some of the key features and advantages of nvim include:

  • Greater performance and speed compared to Vim.
  • More modular and extensible architecture.
  • Support for different programming languages.
  • Wide variety of plugins and extensions available.
  • Compatibility with most Vim scripts and configurations.

Now let's move on to the translation of the content into English:

Neovim (nvim)

Neovim, also known as nvim, is a highly configurable and extensible text editor. It is based on Vim and has been developed with the aim of improving efficiency, performance, and ease of use. Some of the key features and advantages of nvim include:

  • Greater performance and speed compared to Vim.
  • More modular and extensible architecture.
  • Support for different programming languages.
  • Wide variety of plugins and extensions available.
  • Compatibility with most Vim scripts and configurations.

Advantages of nvim over other editors:

  • Vscode: nvim offers a lighter and more customizable editing experience, which can result in better performance and efficiency in large projects. Additionally, its minimalist approach and ability to perform well on resource-limited systems are important advantages.
  • IntelliJ: While IntelliJ is a powerful and versatile IDE, nvim stands out for its lightweight and flexibility. It is ideal for developers who prefer a command-line-based workflow and highly customizable configuration.
  • Sublime Text: While Sublime Text is known for its speed and responsiveness, nvim offers similar features along with a wide range of plugins and extensions that allow for even more customization.

You can customize aspects such as color scheme, keyboard shortcuts, autocompletion behavior, and much more. You can refer to the .init.vim or .vimrc configuration file to make modifications.

Popular Plugins:

Some of the most used plugins in nvim are:

  • coc.nvim: It offers intellisense, autocompletion, and code correction functions. You can find more information on how to configure and use this plugin in the following link: coc.nvim[2].
  • NERDTree: Provides a tree view to explore and navigate project files.
  • vim-airline: Adds an elegant and customizable status bar.
  • fzf: Enables quick search of files and lines of code in a project.

These are just some examples, but there is a wide range of plugins available to further customize your experience with nvim.

Popular Themes:

Some popular themes for nvim include:

  • Solarized: A versatile and widely used theme that offers both light and dark modes.
  • One Dark: Based on the popular Visual Studio Code theme, it provides a modern and sleek appearance.
  • Gruvbox: A theme with warm and earthy tones that offers a pleasant visual experience.

How to Install and Configure Neovim (nvim)

In this tutorial, I will guide you through the necessary steps to install and configure Neovim on Windows, Linux, and macOS operating systems. Additionally, I will show you how to install plugins using the Plug plugin manager.

Neovim Installation

Windows

  1. Download the Neovim installer for Windows from the following link: [Download Neovim for Windows](https://github.com/neovim

/neovim/releases/latest).

  1. Run the downloaded installation file and follow the installer instructions.
  2. Once the installation is complete, open Neovim from the Start menu or by running the nvim command in the command line.

Linux (Ubuntu)

  1. Open a terminal and execute the following commands:
   sudo apt update
   sudo apt install neovim
Enter fullscreen mode Exit fullscreen mode
  1. Once the installation is complete, run nvim in the terminal to start Neovim.

macOS (Homebrew)

  1. Open a terminal and execute the following command:
   brew install neovim
Enter fullscreen mode Exit fullscreen mode
  1. Once the installation is complete, run nvim in the terminal to start Neovim.

Neovim Configuration

  1. Open Neovim. The init.vim configuration file will be automatically created.

  2. To edit the configuration file, execute the following command within Neovim:

   :edit $MYVIMRC
Enter fullscreen mode Exit fullscreen mode
  1. You can then add your preferences and custom configurations to the init.vim file. For example, you can set syntax highlighting options, keyboard shortcuts, themes, etc.

  2. Save the changes and close the configuration file with the :wq command.

Installing Plugins with Plug

  1. Download and install the Plug plugin manager by executing the following commands in the terminal:
   sh -c 'curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
Enter fullscreen mode Exit fullscreen mode
  1. Open the init.vim file to edit it by executing the following command in Neovim:
   :edit $MYVIMRC
Enter fullscreen mode Exit fullscreen mode
  1. Add the following lines to the init.vim file to configure Plug:
   call plug#begin('~/.config/nvim/plugged')
   " Here you can add your plugins
   call plug#end()
Enter fullscreen mode Exit fullscreen mode
  1. Below call plug#begin(), you can add the plugins you wish to install. For example, to install the "example/plugin-name" plugin, add the following line:
   Plug 'example/plugin-name'
Enter fullscreen mode Exit fullscreen mode
  1. Save the changes and close the configuration file with the :wq command.

  2. Restart Neovim. Then, execute the following command within Neovim to install the plugins:

   :PlugInstall
Enter fullscreen mode Exit fullscreen mode
  1. Plug will install the specified plugins and save them in the ~/.config/nvim/plugged directory.

There you have it! Now you have Neovim installed, configured, and plugins installed using the Plug plugin manager.

Top comments (0)