nvim-lspmanager icon indicating copy to clipboard operation
nvim-lspmanager copied to clipboard

Lsp manager for neovim

Nvim-lspmanager

Nvim-lspmanager is a powerful and extensible manager for LSPs (Language Server Protocols). Using pre-made configurations from nvim-lspconfig, you can be sure that your lsp will work without having to write a single line of code.

:star2: Features

  • 3 simple commands missing from native neovim Lsp integration (LspInstall, LspUninstall, LspUpdate)
  • Lots of supported language servers
  • Uses nvim-lspconfig to require configurations for each lsp
  • No need to reload neovim after installing a lsp
  • Fully supports windows

:wrench: Installation

Make sure to use Neovim version 0.5.x or higher.

Dependencies

Make sure you have the following packages installed (some dependencies are responsible for others i.e dotnet LSPs download via dotnet):

Unix
Windows
use {
    'MordechaiHadad/nvim-lspmanager',
    requires = {'neovim/nvim-lspconfig'},
    config = function()
        require('lspmanager').setup()
    end,
}

Resource the current file, and run :PackerInstall to install the plugin.

Plug 'MordechaiHadad/nvim-lspmanager' | Plug 'neovim/nvim-lspconfig'

Resource the current file, and run :PlugInstall to install the plugin.

Now you can place this base configuration in your init.vim file:

lua << EOF
    require('lspmanager').setup()
EOF

:question: Usage

  • :LspInstall ...: Installs a supported language server
  • :LspUninstall ...: Uninstall an installed language server
  • :LspUpdate ...: Update an installed language server. (:LspUpdate all will update all installed ones)

Telescope picker

nvim-lspmanager integrates telescope.nvim to install, uninstall and update language servers.

  • :Telescope lspmanager is used for selecting either one of these options: lsp_install, lsp_uninstall, lsp_update

Customization

You can declare which LSPs you want installed by adding the ensure_installed variable to nvim-lspmanager's setup() function:

require('lspmanager').setup({
    ensure_installed = {
        "sumneko_lua",
        "pyright",
    }
})

The header text for :LspInfoo can be changed by adding the following lines of code to your config:

require('lspmanager').setup({
    info = { 
        header = {
            [[▀█▀]],
            [[░█░]],
            [[░▀░]],
    },},
})

Example nvim-lspmanager config:

local luadev = require("lua-dev").setup({
    library = {
        vimruntime = true,
        types = true,
        plugins = false,
    },
    lspconfig = {
        on_attach = function(client)
            require("illuminate").on_attach(client)
        end,
    },
})

require("lspmanager").setup({
    lsps = {
        sumneko_lua = luadev,
        rust_analyzer = {
            on_attach = function(client)
                require("illuminate").on_attach(client)
            end,
        },
    },
})

:white_check_mark: Supported language servers

Language Language server
:white_check_mark: Angular angularls
:white_check_mark: Bash bashls
:white_check_mark: C/C++ clangd
:white_check_mark: Clojure clojure_lsp
:white_check_mark: CMake cmake
:white_check_mark: CSS cssls
:white_check_mark: Docker dockerls
:white_check_mark: Elixir elixirls
:white_check_mark: Emmet emmet_ls
:white_check_mark: FSharp fsautocomplete
:white_check_mark: Haskell hls
:white_check_mark: HTML html
:white_check_mark: Jsonnet jsonnet
:white_check_mark: JSON jsonls
:white_check_mark: Kotlin kotlinls
:white_check_mark: CSharp omnisharp
:white_check_mark: PureScript purescriptls
:white_check_mark: Python pyright
:white_check_mark: Rust rust_analyser
:white_check_mark: Solidity solang
:white_check_mark: Lua sumneko_lua
:white_check_mark: Svelte sveltels
:white_check_mark: Tailwindcss tailwindcssls
:white_check_mark: Terraform terraformls
:white_check_mark: LaTex texlab
:white_check_mark: Javascript/Typescript tsserver
:white_check_mark: VimL vimls
:white_check_mark: Volar volar
:white_check_mark: Vuejs vuels

:heart: Credits

  • Big thanks to lspinstall which is the mother plugin of lspmanager.