Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Latest commit

 

History

History
41 lines (39 loc) · 2.42 KB

README.md

File metadata and controls

41 lines (39 loc) · 2.42 KB

A minimal LSP server manager for Neovim, inspired by vim-plug, humbly standing on the shoulders of nvim-lsp-installer

Motivation

I strive to be able to setup a new machine purely by scripts and config. To that end, I manage all of my configurations in git. The awesome vim-plug does that job for my nvim plugins. And while nvim-lsp-installer does save me the headache of manually installing and updating LSP servers, it does not allow me out of the box to manage the LSP serves I want installed as convenient as vim-plug for plugins.

Requirements

  1. a working installation of nvim-lsp-installer
  2. all the requirments of nvim-lsp-installer

Installation

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

Usage

Configuration

-- somewhere in your init.lua or in a lua block in your init.vim
local lsplug = require("nvim-lsplug")

-- valid servers: https://github.com/williamboman/nvim-lsp-installer/#available-lsps
lsplug.add("sumneko_lua")
lsplug.add("vimls")
-- optionally add data to pass through to setup
lsplug.add("jsonls", {commands = {
      Format = {
        function()
          vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0})
        end
      }
    }})
lsplug.add(..)

lsplug.finish()

Commands

Command Description
Lspluginstall Install all configured LSP servers
Lsplugclean Uninstall all manually installed LSP servers

Status

This is a scratch-your-own-itch plugin and a working alpha at best. It is literally the first time I am writing anything in Lua and also my first try of writing a vim plugin. I do not know if I will maintain this. If you are reading this, see the merit of this plugin and are more proficient in Lua, please feel free to reach out.