commit 44a0388801668e1626d72a0e0a03a2343cb61b0a
parent 242abf60b31808f520e6bb933884a7358760a686
Author: mrgrouse <mrgrouse@mrgrouse.com>
Date: Thu, 5 Sep 2024 16:01:42 -0400
mason.lua: delete old config and copy config from 'josean.com/posts/neovim-linting-and-formatting'
Diffstat:
1 file changed, 18 insertions(+), 36 deletions(-)
diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua
@@ -1,36 +1,18 @@
-return { "williamboman/mason.nvim",
- cmd = "Mason",
- build = ":MasonUpdate",
- opts = {
- ensure_installed = {
- "ast-grep",
- },
- },
- ---@param opts MasonSettings | {ensure_installed: string[]}
- config = function(_, opts)
- require("mason").setup(opts)
- local mr = require("mason-registry")
- mr:on("package:install:success", function()
- vim.defer_fn(function()
- -- trigger FileType event to possibly load this newly installed LSP server
- require("lazy.core.handler.event").trigger({
- event = "FileType",
- buf = vim.api.nvim_get_current_buf(),
- })
- end, 100)
- end)
- local function ensure_installed()
- 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
- if mr.refresh then
- mr.refresh(ensure_installed)
- else
- ensure_installed()
- end
- end,
- }
+return {
+ "williamboman/mason.nvim",
+ config = function()
+ -- import mason
+ local mason = require("mason")
+
+ -- enable mason and configure icons
+ mason.setup({
+ ui = {
+ icons = {
+ package_installed = "✓",
+ package_pending = "➜",
+ package_uninstalled = "✗",
+ },
+ },
+ })
+ end,
+}