Add Mason for managing LSPs

This commit is contained in:
Cameron Reed 2024-02-02 19:18:40 -07:00
parent 4b08142700
commit c81546ee26
2 changed files with 2 additions and 17 deletions

View File

@ -1,29 +1,12 @@
local lsp_zero_config = {
call_servers = 'global',
}
local lsp_servers = {
'zls',
'nixd',
'gopls',
'pylsp',
'templ',
'ansiblels',
'rust_analyzer',
}
vim.filetype.add({ extension = { templ = "templ" } })
local lsp = require('lsp-zero').preset({})
lsp.set_preferences(lsp_zero_config)
lsp.on_attach(function(_, bufnr)
lsp.default_keymaps({buffer = bufnr})
end)
lsp.setup_servers(lsp_servers)
local lsp_config = require('lspconfig')
lsp_config.lua_ls.setup(lsp.nvim_lua_ls())

View File

@ -37,6 +37,8 @@ require('lazy').setup({
branch = 'v2.x',
dependencies = {
{'neovim/nvim-lspconfig'},
{'williamboman/mason.nvim'},
{'williamboman/mason-lspconfig.nvim'},
{'hrsh7th/nvim-cmp'},
{'hrsh7th/cmp-nvim-lsp'},