work in progress, migrating to lazy
This commit is contained in:
46
lua/plugins/lsp.lua
Normal file
46
lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
local lsp = require('lsp-zero').preset({})
|
||||
|
||||
lsp.ensure_installed({
|
||||
'lua_ls', -- Lua
|
||||
'rust_analyzer', -- rust
|
||||
'texlab', -- LaTeX
|
||||
'clangd', -- C/C++
|
||||
'jedi_language_server', -- Python
|
||||
'html', -- HTML
|
||||
'ocamllsp', -- OCaml
|
||||
})
|
||||
|
||||
-- Fix undefined global 'vim'
|
||||
lsp.configure('lua_ls', {
|
||||
cmd = { 'lua-language-server' },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = vim.split(package.path, ';'),
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
||||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lsp.on_attach(function(_, bufnr)
|
||||
lsp.default_keymaps({ buffer = bufnr })
|
||||
end)
|
||||
|
||||
lsp.set_sign_icons({
|
||||
error = '✘',
|
||||
warn = '▲',
|
||||
hint = '⚑',
|
||||
info = '»'
|
||||
})
|
||||
|
||||
lsp.setup()
|
||||
Reference in New Issue
Block a user