feat(mason): you can now supply a list of tools you want to have installed

This commit is contained in:
Folke Lemaitre
2023-01-02 17:39:51 +01:00
parent 93c5f84ebc
commit 5daf0cbe73

View File

@ -61,4 +61,28 @@ return {
})
end,
},
-- cmdline tools and lsp servers
{
"williamboman/mason.nvim",
cmd = "Mason",
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
config = function(plugin)
require("mason").setup()
local mr = require("mason-registry")
for _, tool in ipairs(plugin.ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
end
end
end,
},
}