2022-07-25 13:49:33 +00:00
|
|
|
local present, mason = pcall(require, "mason")
|
|
|
|
|
|
|
|
if not present then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2022-07-30 10:31:47 +00:00
|
|
|
vim.api.nvim_create_augroup("_mason", { clear = true })
|
|
|
|
vim.api.nvim_create_autocmd("Filetype", {
|
2022-08-20 13:35:30 +00:00
|
|
|
pattern = "mason",
|
2022-07-30 10:31:47 +00:00
|
|
|
callback = function()
|
2022-11-17 13:56:43 +00:00
|
|
|
require "base46_cache.mason"
|
2022-07-30 10:31:47 +00:00
|
|
|
end,
|
|
|
|
group = "_mason",
|
|
|
|
})
|
2022-07-25 13:49:33 +00:00
|
|
|
|
|
|
|
local options = {
|
2022-07-25 14:25:31 +00:00
|
|
|
ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim
|
2022-07-25 13:49:33 +00:00
|
|
|
|
2022-10-06 00:11:05 +00:00
|
|
|
PATH = "skip",
|
|
|
|
|
2022-07-25 13:49:33 +00:00
|
|
|
ui = {
|
|
|
|
icons = {
|
|
|
|
package_pending = " ",
|
|
|
|
package_installed = " ",
|
|
|
|
package_uninstalled = " ﮊ",
|
|
|
|
},
|
|
|
|
|
|
|
|
keymaps = {
|
|
|
|
toggle_server_expand = "<CR>",
|
|
|
|
install_server = "i",
|
|
|
|
update_server = "u",
|
|
|
|
check_server_version = "c",
|
|
|
|
update_all_servers = "U",
|
|
|
|
check_outdated_servers = "C",
|
|
|
|
uninstall_server = "X",
|
|
|
|
cancel_installation = "<C-c>",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
max_concurrent_installers = 10,
|
|
|
|
}
|
|
|
|
|
2022-07-26 01:27:50 +00:00
|
|
|
options = require("core.utils").load_override(options, "williamboman/mason.nvim")
|
2022-07-25 13:49:33 +00:00
|
|
|
|
2022-07-25 14:25:31 +00:00
|
|
|
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
|
|
|
vim.cmd("MasonInstall " .. table.concat(options.ensure_installed, " "))
|
|
|
|
end, {})
|
|
|
|
|
2022-07-25 13:49:33 +00:00
|
|
|
mason.setup(options)
|