Neovim for Beginners — Package Manager Plugin
Use mason.nvim to install and manage LSP servers, DAP servers, linters, and formatters.
We use the
nvim-lsp-installer plugin to install and manage the LSP servers. In this article, we will refactor our existing configuration to use
mason.nvim. It is the next-generation version of
nvim-lsp-installer that makes it easy to install LSP servers, DAP servers, linters, and formatters.
This article is part of the Neovim for Beginners series.
The Neovim configuration files are available in this repository.
In our existing configuration, we will install these 3 plugins.
mason.nvimthat allows us to easily manage external editor tooling such as LSP servers, DAP servers, linters, and formatters through a single interface.
mason-lspconfig.nvimwhich is an extension of
nvim-lspconfigplugin, making it easier to use both plugins together.
mason-tool-installer.nvimis a simple plugin that helps to install or upgrade all of the third-party tools.
lua/plugins.lua file, we add the lines to install these plugins.
We remove the
nvim-lsp-installer plugin and add the lines to install the 3 plugins.
We will refactor the code in the
We add the following lines to configure this plugin.
For other configurable parameters, check out the documentation.