feat(nvim): add mason-null-ls plugin

This commit is contained in:
Stefan Imhoff
2022-12-10 18:59:11 +01:00
parent 61937bbbb5
commit 5a86cf82b8
2 changed files with 12 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
local mason_status_ok, mason = pcall(require, "mason")
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
local mason_lsp_config_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
local mason_null_ls_status_ok, mason_null_ls = pcall(require, "mason-null-ls")
if not mason_status_ok then
return
@@ -14,6 +15,10 @@ if not mason_lsp_config_status_ok then
return
end
if not mason_null_ls_status_ok then
return
end
local servers = {
"astro",
"cssls",
@@ -48,6 +53,12 @@ mason.setup({
max_concurrent_installers = 4,
})
mason_null_ls.setup({
ensure_installed = nil,
automatic_installation = true,
automatic_setup = true,
})
mason_lspconfig.setup({
ensure_installed = servers,
})

View File

@@ -75,6 +75,7 @@ return packer.startup(function(use)
use("neovim/nvim-lspconfig") -- Enable LSP
use("williamboman/mason.nvim") -- Manage LSP servers, DAP servers, linters, and formatters
use("williamboman/mason-lspconfig.nvim") -- Bridge betwen Mason and lspconfig
use("jay-babu/mason-null-ls.nvim") -- Bridge between Mason and null-ls
use("jose-elias-alvarez/null-ls.nvim") -- Inject LSP diagnostics, code actions, and more
use("folke/trouble.nvim") -- Diagnostics
use("creativenull/diagnosticls-configs-nvim") -- Collection of linters and formatters