From 7b73d1111cfb41f980d25c800d86d43ad802d8b8 Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 29 Jun 2024 14:49:05 +0530 Subject: [PATCH] clean up masoninstall cmd func : https://github.com/NvChad/ui/commit/a5c95d346ddb5c1a6a4bec60eda747a0f1f1ca4d now users no longer need to have ensure_installed! --- lua/nvchad/configs/mason.lua | 2 -- lua/nvchad/plugins/init.lua | 17 +---------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/lua/nvchad/configs/mason.lua b/lua/nvchad/configs/mason.lua index 9078818..f7f5bee 100644 --- a/lua/nvchad/configs/mason.lua +++ b/lua/nvchad/configs/mason.lua @@ -1,8 +1,6 @@ dofile(vim.g.base46_cache .. "mason") local options = { - ensure_installed = { "lua-language-server", "stylua" }, -- not an option from mason.nvim - PATH = "skip", ui = { diff --git a/lua/nvchad/plugins/init.lua b/lua/nvchad/plugins/init.lua index aa6abc9..94371be 100644 --- a/lua/nvchad/plugins/init.lua +++ b/lua/nvchad/plugins/init.lua @@ -105,24 +105,9 @@ return { config = function(_, opts) require("mason").setup(opts) - -- custom nvchad cmd to install all mason binaries listed vim.api.nvim_create_user_command("MasonInstallAll", function() - if opts.ensure_installed and #opts.ensure_installed > 0 then - vim.cmd "Mason" - local mr = require "mason-registry" - - mr.refresh(function() - for _, tool in ipairs(opts.ensure_installed) do - local p = mr.get_package(tool) - if not p:is_installed() then - p:install() - end - end - end) - end + require("nvchad.mason").install_all(opts.ensure_installed) end, {}) - - vim.g.mason_binaries_list = opts.ensure_installed end, },