Files
dotfiles/nvim/lua/plugins/lsp.lua
2025-05-14 13:30:47 -05:00

109 lines
3.1 KiB
Lua

local servers = {
"rust_analyzer",
"clangd",
"basedpyright",
"lua_ls",
'bashls',
'yamlls',
'gopls',
'html',
'cssls',
}
return {
"b0o/schemastore.nvim",
{
"williamboman/mason.nvim",
ensure_installed = servers
},
-- {
-- "williamboman/mason-lspconfig.nvim",
-- config = function ()
-- require('mason-lspconfig').setup({
-- ensure_installed = servers
-- })
--
-- for _, lsp in pairs(servers) do
-- require('lspconfig')[lsp].setup {
-- on_attach = on_attach,
-- capabilities = capabilities
-- }
-- end
-- end,
--
-- automatic_installation = true,
-- },
{
"neovim/nvim-lspconfig",
dependencies = {
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
'saghen/blink.cmp',
},
opts = {
servers = {
rust_analyzer = {},
clangd = {},
basedpyright = {},
lua_ls = {},
bashls = {},
yamlls = {},
gopls = {
cmd = {"gopls"},
filetypes = {"go", "gomod", "gowork", "gotmpl"},
},
html = {},
cssls = {},
},
},
config = function (_, opts)
local lspconfig = require('lspconfig')
for server, config in pairs(opts.servers) do
-- passing config.capabilities to blink.cmp merges with the capabilities in your
-- `opts[server].capabilities, if you've defined it
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end
end,
},
{
'nvimdev/lspsaga.nvim',
config = function()
require('lspsaga').setup({
diagnostic = {
keys = {
quit = { 'q', '<ESC>' }
}
},
rename = {
keys = {
quit = {'<ESC>'}
}
},
finder = {
keys = {
quit = '<ESC>',
close = '<ESC>',
toggle_or_open = '<CR>'
}
},
outline = {
close_after_jump = true,
keys = {
quit = { 'q', '<ESC>' },
jump = { 'e', '<CR>' },
toggle_or_jump = { 'o', '<TAB>' }
}
},
lightbulb = {
enable = false
}
})
end,
dependencies = {
'nvim-treesitter/nvim-treesitter', -- optional
'nvim-tree/nvim-web-devicons', -- optional
}
}
}