Home

Awesome

ℹ️ Project status

This is an excerpt from the announcement here.

nvim-lsp-installer is no longer maintained.

mason.nvim is the next generation version of nvim-lsp-installer. It builds on top of the very same foundation as nvim-lsp-installer (which means it's easy to migrate), but with a majority of internals refactored to improve extensibility and testability.

More importantly, the scope of mason.nvim has also been widened to target more than just LSP servers. mason.nvim supports DAP servers, linters, formatters, and more. As of writing, mason.nvim provides 150+ packages for 100+ languages. It can be thought of as a general-purpose package manager, native to Neovim, that runs everywhere Neovim runs (Windows, macOS, Linux, etc.).

Another big change with mason.nvim is that executables are now linked to a single, shared, location, allowing seamless access from Neovim builtins (shell, terminal, etc.) as well as other 3rd party plugins.

There have also been other improvements such as broader test coverage, more documentation, and a revamped UI - check it out!

<p align="center"> <img src="https://user-images.githubusercontent.com/6705160/118490159-f064bb00-b71d-11eb-883e-4affbd020074.png" alt="nvim-lsp-installer" width="50%" /> </p>

About

Neovim plugin that allow you to manage LSP servers (servers are installed inside :echo stdpath("data") by default). It works in tandem with lspconfig<sup>1</sup> by registering a hook that enhances the PATH environment variable, allowing neovim's LSP client to locate the server executable installed by nvim-lsp-installer.<sup>2</sup>

On top of just providing commands for installing & uninstalling LSP servers, it:

<sup>1 - while lspconfig is the main target, this plugin may also be used for other use cases</sup> <br> <sup>2 - some servers don't provide an executable, in which case the full command to spawn the server is provided instead</sup>

Screenshots

<img src="https://user-images.githubusercontent.com/6705160/150685720-782e33ba-172c-44b6-8558-fb4e98495294.png" /><img src="https://user-images.githubusercontent.com/6705160/150685404-2cd34b25-166e-4c84-b9dd-1d5580dc2bdd.png" /><img src="https://user-images.githubusercontent.com/6705160/150685322-a537f021-5850-4bbc-8be2-1ece5678d205.png" />
<img src="https://user-images.githubusercontent.com/6705160/150685324-1310ae7d-67bf-4053-872c-d27e8a4c4b80.png" /><img src="https://user-images.githubusercontent.com/6705160/150686052-fd5c4d54-b4da-4cb3-bb82-a094526ee5b5.png" /><img src="https://user-images.githubusercontent.com/6705160/150686059-f1be8131-1274-4f62-9aa8-345599cbd8bc.png" />

Requirements

Requires neovim >= 0.7.0 and nvim-lspconfig.

Minimum requirements

The minimum recommended requirements are:

Additional requirements

Additional requirements to install & run all servers are (depending on usage):

Installation

Packer

use {
    "williamboman/nvim-lsp-installer",
    "neovim/nvim-lspconfig",
}

vim-plug

Plug 'williamboman/nvim-lsp-installer'
Plug 'neovim/nvim-lspconfig'

Usage

nvim-lsp-installer will only make sure that Neovim can find your installed servers, it does not set up any servers for you automatically. You will have to set up your servers yourself (for example via lspconfig).

Setup

In order for nvim-lsp-installer to register the necessary hooks at the right moment, make sure you call the require("nvim-lsp-installer").setup() function before you set up any servers!

require("nvim-lsp-installer").setup {}

Refer to the Configuration section for information about which settings are available.

Commands

Configuration

You may optionally configure certain behavior of nvim-lsp-installer when calling the .setup() function.

Refer to the default configuration for all available settings.

Example:

require("nvim-lsp-installer").setup({
    automatic_installation = true, -- automatically detect which servers to install (based on which servers are set up via lspconfig)
    ui = {
        icons = {
            server_installed = "✓",
            server_pending = "➜",
            server_uninstalled = "✗"
        }
    }
})

Available LSPs

LanguageServer name
AWKawk_ls
Angularangularls
Ansibleansiblels
Apexapex_ls
Arduino (docs!!!)arduino_language_server
Assembly (GAS/NASM, GO)asm_lsp
Astroastro
Bashbashls
Beancountbeancount
Bicepbicep
Cccls
Cclangd
C#csharp_ls
C# (docs)omnisharp
C++ccls
C++clangd
CMakecmake
CSScssls
CSScssmodules_ls
Clarityclarity_lsp
Clojureclojure_lsp
CodeQLcodeqlls
Crystalcrystalline
Crystalscry
Cucumbercucumber_language_server
Dartdartls
Denodenols
Dhalldhall_lsp_server
Diagnostic (general purpose server)diagnosticls
Dlangserve_d
Dockerdockerls
Dotdotls
EFM (general purpose server)efm
ESLint (docs)eslint
Elixirelixirls
Elmelmls
Emberember
Emmetemmet_ls
Erlangerlangls
F#fsautocomplete
Fluxflux_lsp
Foam (OpenFOAM)foam_ls
Fortranfortls
Gogolangci_lint_ls
Gogopls
Grammarlygrammarly
GraphQLgraphql
Groovygroovyls
HTMLhtml
Haskellhls
Haxehaxe_language_server
Hoonhoon_ls
JSONjsonls
Java (docs)jdtls
JavaScriptquick_lint_js
JavaScripttsserver
Jsonnetjsonnet_ls
Julia (docs)julials
Kotlinkotlin_language_server
LaTeXltex
LaTeXtexlab
Lelwellelwel_ls
Luasumneko_lua
Markdownmarksman
Markdownprosemd_lsp
Markdownremark_ls
Markdownzk
Metamath Zeromm0_ls
Nickelnickel_ls
Nimnimls
Nixrnix
OCamlocamlls
OCamlocamllsp
Objective Cccls
OneScript, 1C:Enterprisebsl_ls
OpenCLopencl_ls
PHPintelephense
PHPphpactor
PHPpsalm
Perlperlnavigator
Powershellpowershell_es
Prismaprismals
Puppetpuppet
PureScriptpurescriptls
Pythonjedi_language_server
Pythonpyright
Pythonsourcery
Python (docs)pylsp
Rr_language_server
ReScriptrescriptls
Reasonreason_ls
Robot Frameworkrobotframework_ls
Romerome
Rubysolargraph
Rustrust_analyzer
SQLsqlls
SQLsqls
Saltsalt_ls
Shopify Theme Checktheme_check
Slintslint_lsp
Soliditysolang
Soliditysolc
Solidity (VSCode)solidity_ls
Sorbetsorbet
Sphinxesbonio
Stylelintstylelint_lsp
Sveltesvelte
Swiftsourcekit
SystemVerilogsvlangserver
SystemVerilogsvls
SystemVerilogverible
TOMLtaplo
Tailwind CSStailwindcss
Tealteal_ls
Terraformterraformls
Terraform (docs)tflint
TypeScripttsserver
Vvls
Valavala_ls
VimLvimls
Visualforcevisualforce
Vuevolar
Vuevuels
XMLlemminx
YAMLyamlls
Zigzls

Logo

Illustrations in the logo are derived from @Kaligule's "Robots" collection.

Default configuration

local DEFAULT_SETTINGS = {
    -- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer", "sumneko_lua" }
    -- This setting has no relation with the `automatic_installation` setting.
    ensure_installed = {},

    -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
    -- This setting has no relation with the `ensure_installed` setting.
    -- Can either be:
    --   - false: Servers are not automatically installed.
    --   - true: All servers set up via lspconfig are automatically installed.
    --   - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
    --       Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
    automatic_installation = false,

    ui = {
        -- Whether to automatically check for outdated servers when opening the UI window.
        check_outdated_servers_on_open = true,

        -- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
        border = "none",

        icons = {
            -- The list icon to use for installed servers.
            server_installed = "◍",
            -- The list icon to use for servers that are pending installation.
            server_pending = "◍",
            -- The list icon to use for servers that are not installed.
            server_uninstalled = "◍",
        },
        keymaps = {
            -- Keymap to expand a server in the UI
            toggle_server_expand = "<CR>",
            -- Keymap to install the server under the current cursor position
            install_server = "i",
            -- Keymap to reinstall/update the server under the current cursor position
            update_server = "u",
            -- Keymap to check for new version for the server under the current cursor position
            check_server_version = "c",
            -- Keymap to update all installed servers
            update_all_servers = "U",
            -- Keymap to check which installed servers are outdated
            check_outdated_servers = "C",
            -- Keymap to uninstall a server
            uninstall_server = "X",
        },
    },

    -- The directory in which to install all servers.
    install_root_dir = path.concat { vim.fn.stdpath "data", "lsp_servers" },

    pip = {
        -- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior
        -- and is not recommended.
        --
        -- Example: { "--proxy", "https://proxyserver" }
        install_args = {},
    },

    -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
    -- debugging issues with server installations.
    log_level = vim.log.levels.INFO,

    -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
    -- servers that are requested to be installed will be put in a queue.
    max_concurrent_installers = 4,

    github = {
        -- The template URL to use when downloading assets from GitHub.
        -- The placeholders are the following (in order):
        -- 1. The repository (e.g. "rust-lang/rust-analyzer")
        -- 2. The release version (e.g. "v0.3.0")
        -- 3. The asset name (e.g. "rust-analyzer-v0.3.0-x86_64-unknown-linux-gnu.tar.gz")
        download_url_template = "https://github.com/%s/releases/download/%s/%s",
    },
}