mason-org / mason-lspconfig.nvim
git clone https://github.com/mason-org/mason-lspconfig.nvim.git
v2.3.0 · 4mo ago
🔥 on GitHub Trending today
Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.
—
stars, 24h
+5
stars, 7 days · #1,597
—
stars, 30 days
4.0k
★ total · +0% this week
223
forks · 88 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageLua
LicenseApache-2.0
Created2022-07-21 (4y ago)
Last push7d ago
Watchers11
OwnerOrganization
Seen on GitHub Trending
- 2026-10-20 — #7 weekly in lua · +5 ★
GitHub topics
Links
README excerpt
mason-lspconfig.nvim
mason-lspconfig bridges mason.nvim with the lspconfig plugin - making it easier to use both
plugins together.
:help mason-lspconfig.nvim
Latest version: v2.3.0
## Table of Contents
- Introduction
- Requirements
- Installation & Usage
- Recommended setup for `lazy.nvim`
- Automatically enable installed servers
- Commands
- Configuration
- Default configuration
## Introduction
> `:h mason-lspconfig-introduction`
This plugin's main responsibilities are to:
- allow you to (i) automatically install, and (ii) automatically enable (`vim.lsp.enable()`) installed servers
- provide extra convenience APIs such as the `:LspInstall` command
- provide additional LSP configurations for a few servers
- translate between `nvim-lspconfig` server names and `mason.nvim` package names (e.g. `lua_ls lua-language-server`)
> [!NOTE]
> Since the introduction of `:h vim.lsp.config`) in Neovim 0.11,
> this plugin's feature set has been reduced. Use this plugin if you want to automatically enable installed servers
> (`:h vim.lsp.enable()`)) or have access to the `:LspInstall`
> command.
## Requirements
> `:h mason-lspconfig-requirements`
- `neovim >= 0.11.0`
- `mason.nvim >= 2.0.0`
- `nvim-lspconfig >= 2.0.0`
## Installation & Usage
> `:h mason-lspconfig-quickstart`
Install using your plugin manager of choice. **Setup is required**:
[code]
It's important that you set up `mason.nvim` _and_ have `nvim-lspconfig` available in `:h
runtimepath` before setting up `mason-lspconfig.nvim`.
Refer to the Configuration section for information about which settings are available.
### Recommended setup for `lazy.nvim`
The following is the recommended setup when using `lazy.nvim`. It will set up the plugin for you, meaning **you don't have
to call `require("mason-lspconfig").setup()` yourself**.
[code]
## Automatically enable installed servers
`mason-lspconfig.nvim` will automatically enable (`vim.lsp.enable()`) installed servers for you by default.
To disable this feature:
[code]
To exclude certain servers from being enabled:
[code]
Alternatively, to only enable specific servers:
[code]
> [!NOTE]
> This will only enable servers that are installed via Mason. It will not recognize servers installed elsewhere on your
> system.
## Commands
> `:h mason-lspconfig-commands`
- `:LspInstall [ ...]`: Installs the provided servers. If no server is provided you will be prompted to select a
server based on the current buffer's `&filetype`.
- `:LspUninstall ...`: Uninstalls the provided servers.
## Configuration
> `:h mason-lspconfig-settings`
You may optionally configure certain behavior of `mason-lspconfig.nvim` when calling the `.setup()` function. Refer to
the default configuration for a list of all available settings.
Example:
[code]
### Configuration using `lazy.nvim`
[code]
### Default configuration
[code] lua
-- automatic_enable = {
-- exclude = { "rust_analyzer", "ts_ls" }
-- }
-- [code] lua
-- automatic_enable = {
-- "lua_ls",
-- "vimls"
-