neovim: Set up managed LSP installer
This commit is contained in:
parent
596a3d06ef
commit
a348810adc
1 changed files with 9 additions and 4 deletions
|
|
@ -52,6 +52,7 @@ Plug 'udalov/kotlin-vim'
|
||||||
Plug 'urbit/hoon.vim'
|
Plug 'urbit/hoon.vim'
|
||||||
Plug 'vim-python/python-syntax'
|
Plug 'vim-python/python-syntax'
|
||||||
Plug 'vim-ruby/vim-ruby'
|
Plug 'vim-ruby/vim-ruby'
|
||||||
|
Plug 'williamboman/nvim-lsp-installer', { 'branch': 'main' }
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
set number
|
set number
|
||||||
|
|
@ -368,17 +369,21 @@ local on_attach = function(client, bufno)
|
||||||
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()]]
|
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()]]
|
||||||
end
|
end
|
||||||
|
|
||||||
local servers = {
|
local lsp_installer = require('nvim-lsp-installer')
|
||||||
|
lsp_installer.setup({})
|
||||||
|
|
||||||
|
local lsp_settings = {
|
||||||
gopls = {},
|
gopls = {},
|
||||||
jedi_language_server = {},
|
jedi_language_server = {},
|
||||||
rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
solargraph = {},
|
solargraph = {},
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
}
|
}
|
||||||
for lsp, settings in pairs(servers) do
|
|
||||||
nvim_lsp[lsp].setup {
|
for _, server in ipairs(lsp_installer.get_installed_servers()) do
|
||||||
|
nvim_lsp[server.name].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = settings,
|
settings = lsp_settings[server.name],
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue