Easily update all Mason packages with one command.
use { 'RubixDev/mason-update-all' }
Plug 'RubixDev/mason-update-all'
require('mason-update-all').setup()
:MasonUpdateAll
— update all installed Mason packages
Upon completion of all updates the user event MasonUpdateAllComplete
will be emitted. You can use it like so:
vim.api.nvim_create_autocmd('User', {
pattern = 'MasonUpdateAllComplete',
callback = function()
print('mason-update-all has finished')
end,
})
or in VimScript:
autocmd User MasonUpdateAllComplete echo 'mason-update-all has finished'
Using the provided vim command and user event, it is possible to update the Mason packages from the command line or shell scripts.
# Update Packer plugins
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
# Update Mason packages
nvim --headless -c 'autocmd User MasonUpdateAllComplete quitall' -c 'MasonUpdateAll'