feat(mason): you can now supply a list of tools you want to have installed
This commit is contained in:
@ -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,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user