ランキングに戻る

mason-org/mason-lspconfig.nvim

Lua

Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.

lsplspconfigmasonneovimnvimnvim-lspconfigneovim-pluginnvim-pluginpackage-manager
スター成長
スター
3.9k
フォーク
221
週間成長
Issue
82
1k2k3k
2022年7月2023年11月2025年3月2026年7月
README

Linux macOS Windows GitHub CI Sponsors

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

: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:

require("mason-lspconfig").setup()

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.

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.

{
    "mason-org/mason-lspconfig.nvim",
    opts = {},
    dependencies = {
        { "mason-org/mason.nvim", opts = {} },
        "neovim/nvim-lspconfig",
    },
}

Automatically enable installed servers

mason-lspconfig.nvim will automatically enable (vim.lsp.enable()) installed servers for you by default.

To disable this feature:

require("mason-lspconfig").setup {
    automatic_enable = false
}

To exclude certain servers from being enabled:

require("mason-lspconfig").setup {
    automatic_enable = {
        exclude = {
            "rust_analyzer",
            "ts_ls"
        }
    }
}

Alternatively, to only enable specific servers:

require("mason-lspconfig").setup {
    automatic_enable = {
        "lua_ls",
        "vimls"
    }
}

[!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 [<server> ...]: 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 <server> ...: 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:

require("mason-lspconfig").setup {
    ensure_installed = { "lua_ls", "rust_analyzer" },
}

Configuration using lazy.nvim

{
    "mason-org/mason-lspconfig.nvim",
    opts = {
        ensure_installed = { "lua_ls", "rust_analyzer" },
    },
    dependencies = {
        { "mason-org/mason.nvim", opts = {} },
        "neovim/nvim-lspconfig",
    },
}

Default configuration

local DEFAULT_SETTINGS = {
    -- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer@nightly", "lua_ls" }
    ---@type string[]
    ensure_installed = {},

    -- Whether installed servers should automatically be enabled via `:h vim.lsp.enable()`.
    --
    -- To exclude certain servers from being automatically enabled:
    -- ```lua
    --   automatic_enable = {
    --     exclude = { "rust_analyzer", "ts_ls" }
    --   }
    -- ```
    --
    -- To only enable certain servers to be automatically enabled:
    -- ```lua
    --   automatic_enable = {
    --     "lua_ls",
    --     "vimls"
    --   }
    -- ```
    ---@type boolean | string[] | { exclude: string[] }
    automatic_enable = true,
}
関連リポジトリ
neoclide/coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.

TypeScriptnpmOtherautocompletionlanguage-client
25.2k957
neovim/nvim-lspconfig

Quickstart configs for Nvim LSP

LuaApache License 2.0vimnvim
13.8k2.5k
a-h/templ

A language for writing HTML user interfaces in Go.

GoGo ModulesMIT Licensetemplating-languageside-support
templ.guide
10.4k362
facebook/pyrefly

A fast type checker and language server for Python

Rustcrates.ioMIT Licensecode-qualityide
pyrefly.org
6.8k446
rebelot/kanagawa.nvim

NeoVim dark colorscheme inspired by the colors of the famous painting by Katsushika Hokusai.

LuaMIT Licenseneovimlsp
6.3k234
zigtools/zls

A language server for Zig supporting developers with features like autocomplete and goto definition

ZigMIT Licensezigziglang
zigtools.org/zls/install/
5k437
LuaLS/lua-language-server

A language server that offers Lua language support - programmed in Lua

LuaMIT Licenselualanguage-server
luals.github.io
4.3k431
zenc-lang/zenc

Write like a high-level language, run like C.

CMIT Licenseccompiler
zenc-lang.org
4.3k218
VonHeikemen/lsp-zero.nvim

A starting point to setup some lsp related features in neovim.

LuaMIT Licenseneovimnvim
4k89
nvimdev/lspsaga.nvim

improve neovim lsp experience

LuaMIT Licenselspneovim
3.8k304
jose-elias-alvarez/null-ls.nvim

Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.

LuaOtherneovimneovim-plugin
3.6k777
Myriad-Dreamin/tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].

Rustcrates.ioApache License 2.0formatterlsp
myriad-dreamin.github.io/tinymist
3.4k171