[nvim] feat: use nvim_lsp_installer

manage lsp servers through nvim's plugin

!!! BREAKING: requires npm
check https://github.com/williamboman/nvim-lsp-installer.git
This commit is contained in:
David JULIEN 2021-10-17 12:44:44 +02:00
parent 2bf23cc38f
commit ca81062105
No known key found for this signature in database
GPG Key ID: 4B388E8BD9D47382
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,29 @@
-- Author : swytch
-- Created : Saturday Sept. 11, 2021 22:12:33 CET
-- License : GPLv3
-- Description : nvim-lsp-installer plugin config file
local lsp_installer = require("nvim-lsp-installer")
lsp_installer.settings {
ui = {
icons = {
server_installed = "",
server_pending = "",
server_uninstalled = ""
}
}
}
lsp_installer.on_server_ready(function(server)
local opts = {}
-- (optional) Customize the options passed to the server
-- if server.name == "tsserver" then
-- opts.root_dir = function() ... end
-- end
-- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
server:setup(opts)
vim.cmd [[ do User LspAttachBuffers ]]
end)

View File

@ -48,6 +48,15 @@ return require("packer").startup(function()
}
-- LSP
use {
"williamboman/nvim-lsp-installer",
cmd = {
"LspInstall",
"LspInstallInfo"
},
config = function() require("plugin.lsp_installer").setup() end
}
use {
"neovim/nvim-lspconfig",
ft = { "c", "cpp", "lua", "python", "tex"},