Neovim is a popular text editor that is known for its speed, customization options, and powerful plugins. Plugins can be used to extend Neovim’s functionality and add new features, such as improved syntax highlighting, autocompletion, and file exploration.
In this blog post, we will be covering some of the top Neovim plugins that you should consider using. These plugins will help you to improve your productivity and workflow when using Neovim.
Plugin Manager
A plugin manager is a Neovim plugin that makes it easy to install and manage other plugins. Plugin managers typically provide a central location where you can list all of your installed plugins, as well as commands for installing, uninstalling, and updating plugins.
There are many different plugin managers available for Neovim, but two of the most popular are packer.nvim and lazy.nvim.
Packer.nvim
Packer.nvim is a plugin manager that is inspired by use-package. It is known for its speed, flexibility, and ease of use.
To install packer.nvim, you can follow our tutorial
Once packer.nvim is installed, you can add plugins to your Neovim configuration file by adding them to the packer.startup()
function. For example, to install the telescope plugin, you would add the following code to your Neovim configuration file:
packer.startup(function()
use {
'nvim-telescope/telescope.nvim',
}
end)
To install all of your plugins, you can run the following command:
:PackerSync
Lazy.nvim
Lazy.nvim is another popular plugin manager for Neovim. It is known for its simplicity and performance.
To install lazy.nvim, you can run the following command:
git clone --depth 1 https://github.com/folke/lazy.nvim ~/.local/share/nvim/site/pack/packer/start/lazy.nvim
Once lazy.nvim is installed, you can add plugins to your Neovim configuration file by adding them to the lazy.nvim.use()
function. For example, to install the telescope plugin, you would add the following code to your Neovim configuration file:
lazy.nvim.use {
'nvim-telescope/telescope.nvim',
}
To install all of your plugins, you can run the following command
:Lazy status
Which plugin manager should I use?
Both packer.nvim and lazy.nvim are excellent plugin managers. packer.nvim is more flexible and customizable, while lazy.nvim is simpler and easier to use.
If you are new to Neovim, I recommend using lazy.nvim. It is easy to use and get started with. Once you have become more familiar with Neovim, you can switch to packer.nvim if you need more flexibility or customization.
Which plugin manager do you use?
I personally use packer.nvim. I like its flexibility and customization options. However, I understand why some people prefer lazy.nvim. It is a great option for people who are new to Neovim or who want a simple and easy-to-use plugin manager.
Searching
Searching is an important feature in any text editor, and Neovim is no exception. Neovim has a built-in search feature, but there are also many plugins available that can extend and improve the search functionality.
One of the most popular Neovim plugins for searching is Telescope. Telescope is a fuzzy finder that can be used to search for files, text, and other items within Neovim. Telescope is known for its speed, flexibility, and ease of use.
To install Telescope, you can follow our tutorial
Telescope also provides a number of other features, such as the ability to search for text in buffers, search for symbols, and search for files in the current project.
File Explorer
A file explorer plugin for Neovim can make it much easier to navigate through your files and folders within Neovim. File explorer plugins typically provide a tree view of your files and folders, as well as the ability to open, create, and delete files and folders.
Two of the most popular Neovim plugins for file exploration are nvim-tree.lua and which-key.nvim.
Nvim-tree.lua
Nvim-tree.lua is a file explorer plugin that is written in Lua. It is known for its speed, flexibility, and ease of use.
To install nvim-tree.lua, you can follow our tuorial
Nvim-tree.lua also provides a number of other features, such as the ability to filter files and folders, search for files and folders, and open files in a split view.
Which-key.nvim
Which-key.nvim is a plugin that can be used to display a list of all of the available keyboard bindings for the current context. This can be useful for discovering new keyboard bindings, as well as for learning the keyboard bindings for a new plugin.
Which-key.nvim can also be used to create a custom file explorer. To do this, you would first need to create a new Neovim command that opens a buffer with the file tree. Then, you would need to add a key binding to the command.
Once you have created the custom file explorer command and key binding, you can open the file explorer by pressing the key binding.
Syntax Highlighting and Autocompletion
Syntax highlighting and autocompletion are two important features that can help you to improve your productivity when writing code and other types of text in Neovim.
Nvim-treesitter
Syntax highlighting is a feature that colors different parts of your code based on their type. This can make it easier to read and understand your code, and it can also help you to spot errors.
Neovim has built-in support for syntax highlighting, but there are also a number of plugins available that can improve the syntax highlighting functionality.
One of the most popular Neovim plugins for syntax highlighting is nvim-treesitter. Nvim-treesitter is a parser that can be used to parse a wide range of languages and file types. It provides more accurate and detailed syntax highlighting than the built-in syntax highlighting feature in Neovim.
To install nvim-treesitter, you can follow our tutorial
Nvim-cmp
Autocompletion is a feature that suggests possible completions for words and phrases as you type. This can help you to write code and other types of text more quickly and accurately.
Neovim has built-in support for autocompletion, but there are also a number of plugins available that can improve the autocompletion functionality.
One of the most popular Neovim plugins for autocompletion is nvim-cmp. Nvim-cmp is a completion plugin that can be used to provide autocompletion for a wide range of languages and file types. It also provides a number of features that can be used to customize the autocompletion experience.
To install nvim-cmp, you can follow our tutorial
Nvim-autopairs
Nvim-autopairs is a Neovim plugin that automatically inserts closing pairs of characters, such as parentheses, curly braces, and square brackets. It is a very popular plugin, and it is used by many developers to improve their productivity and workflow.
Nvim-autopairs works by listening for certain keystrokes. When it detects that you have typed an opening pair of characters, it automatically inserts the closing pair of characters. For example, if you type an opening parenthesis, nvim-autopairs will automatically insert a closing parenthesis.
Nvim-autopairs is very configurable, and you can customize it to your liking. For example, you can choose which pairs of characters nvim-autopairs should automatically insert. You can also choose whether nvim-autopairs should insert the closing pair of characters immediately after the opening pair of characters, or whether it should wait until you press a specific key.
Nvim-ts-autotag
Nvim-ts-autotag is a Neovim plugin that provides autocompletion for TypeScript tags. It is a popular plugin among TypeScript developers, as it can help to improve their productivity and workflow.
Nvim-ts-autotag works by using the Treesitter parser to understand the syntax of the TypeScript code. It then uses this information to provide autocompletion for TypeScript tags.
For example, if you are typing a div
tag, nvim-ts-autotag will suggest a list of possible attributes that you can add to the tag. It will also suggest a list of possible child elements that you can add to the tag.
Nvim-ts-autotag is highly configurable, and you can customize it to your liking. For example, you can choose which TypeScript tags should be included in the autocompletion list. You can also choose whether nvim-ts-autotag should suggest attributes and child elements for TypeScript tags.
Comment.nvim
Comment.nvim is a Neovim plugin that provides autocompletion for comments in a variety of programming languages. It is a popular plugin among developers, as it can help to improve their productivity and workflow.
Comment.nvim works by using the Treesitter parser to understand the syntax of the code. It then uses this information to provide autocompletion for comments.
For example, if you are typing a comment in Python, Comment.nvim will suggest a list of possible comment prefixes, such as #
, """
, and '''
. It will also suggest a list of possible comment tags, such as @param
, @return
, and @todo
.
Appearance and customization:
Neovim is a highly customizable text editor, so you can make it look and feel just the way you like it. There are a ton of plugins available for appearance and customization, so you can find the ones that are perfect for you.
Lualine
Lualine is a Neovim plugin that lets you customize the statusline and tabline. You can add or remove elements, change the colors, and more.
Think of it as a fancy dress-up game for your Neovim window. You can make it look however you want, and add all the bells and whistles you need.
Here’s an example of a customized statusline using Lualine:
This statusline includes the following elements:
- The current buffer name
- The current mode (visual, insert, etc.)
- The current line number and column number
- The current branch name
- The current git status
- The current time and date
You can customize the statusline to include any elements that you want. You can also change the colors and formatting of the statusline.
Nvim-ts-rainbow2
Nvim-ts-rainbow2 is a Neovim plugin that adds rainbow parentheses to Neovim. It is a simple plugin, but it can be very useful for improving the readability of your code.
Nvim-ts-rainbow2 works by highlighting each pair of parentheses in a different color. This makes it easier to see where each code block begins and ends.
Nvim-ts-rainbow2 is highly configurable, and you can customize it to your liking. For example, you can choose which colors are used to highlight parentheses. You can also choose whether to highlight parentheses in all programming languages or just in specific programming languages.
Tokyonight.nvim
Tokyonight.nvim is a popular Neovim color scheme that is known for its readability and comfort. It is a great choice for long coding sessions because it is easy on the eyes and does not cause eye strain.
Tokyonight.nvim is based on the Tokyo Night color scheme for Visual Studio Code. It uses a dark blue background with light blue and green text. The color scheme is also highly customizable, so you can adjust it to your liking.
Vim-nightfly-colors
Vim-nightfly-colors is a color scheme for Neovim that is known for its dark and vibrant colors. It is a good choice for developers who want their code editor to look cool and unique.
Vim-nightfly-colors is based on the Nightfly color scheme for Atom. It uses a dark blue background with vibrant green, blue, and pink text. The color scheme is also highly customizable, so you can adjust it to your liking.
To use appearance and customization plugins in Neovim, you’ll first need to install them. You can do this using a plugin manager like packer.nvim or lazy.nvim.
Conclusion
Neovim is a great text editor, but it can be even better with plugins. Plugins can add all sorts of new features and functionality to Neovim, making it more powerful and customizable.
In this blog post, I’ve covered some of the top Neovim plugins that you should consider using. These plugins can help you to improve your productivity, workflow, and enjoyment when using Neovim.