diff --git a/README.md b/README.md index 8fb021f..577f180 100644 --- a/README.md +++ b/README.md @@ -912,6 +912,7 @@ extensions = {'quickfix'} - symbols-outline - toggleterm - trouble +- mason #### Custom extensions diff --git a/lua/lualine/extensions/mason.lua b/lua/lualine/extensions/mason.lua new file mode 100644 index 0000000..16ed56b --- /dev/null +++ b/lua/lualine/extensions/mason.lua @@ -0,0 +1,25 @@ +-- lualine extension for mason.nvim + +local ok, mason_registry = pcall(require, 'mason-registry') +if not ok then + return '' +end + +local M = {} + +M.sections = { + lualine_a = { + function() + return 'Mason' + end, + }, + lualine_b = { + function() + return 'Installed: ' .. #mason_registry.get_installed_packages() .. '/' .. #mason_registry.get_all_package_specs() + end, + }, +} + +M.filetypes = { 'mason' } + +return M