Skip to content

MordechaiHadad/nvim-lspmanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

🌟 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

🔧 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

❓ 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,
        },
    },
})

✅ Supported language servers

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

❤️ Credits

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