gitmyhub

mason.nvim

Lua ★ 10k updated 2d ago

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.

A Neovim plugin that acts as a one-stop package manager for language servers, linters, formatters, and debuggers, browse, install, and update them all from inside the editor with a single keypress.

LuaNeovimsetup: moderatecomplexity 3/5

Mason.nvim is a plugin for Neovim, a highly configurable text editor popular with developers who prefer working in the terminal. The plugin acts as a package manager specifically for the external tools that Neovim needs to provide features like code completion, error checking, and code formatting.

When you write code in Neovim, the editor can connect to language-specific helper programs called language servers that understand a given programming language and report problems in real time. There are also debuggers, linters (tools that flag style problems), and formatters (tools that tidy up code layout). Each of these needs to be installed separately on your computer, which can involve hunting down binaries or running different install commands for different languages. Mason handles all of that from inside Neovim itself.

Opening the Mason interface with the command :Mason shows a window listing hundreds of available tools. You can search by name or filter by language, install with a keypress, and update or remove tools the same way. Mason stores everything in Neovim's own data directory so installations do not scatter files across the system.

The plugin works across Linux, macOS, and Windows. On each platform it uses whatever download tools are already available, such as curl, wget, or PowerShell's built-in downloader, so it does not require a specific tool to be pre-installed.

Configuration is minimal. Adding Mason to a Neovim plugin manager and calling its setup function is enough to get started. The full list of supported packages lives on a separate website maintained by the project. The plugin is open-source and accepts bug reports and contributions through GitHub.

Where it fits