https://github.com/rubixdev/mason-update-all
Easily update all Mason packages with one command
https://github.com/rubixdev/mason-update-all
Last synced: 12 months ago
JSON representation
Easily update all Mason packages with one command
- Host: GitHub
- URL: https://github.com/rubixdev/mason-update-all
- Owner: RubixDev
- License: gpl-3.0
- Created: 2022-09-22T15:43:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-16T11:15:09.000Z (about 1 year ago)
- Last Synced: 2025-04-16T14:59:54.110Z (about 1 year ago)
- Language: Lua
- Size: 20.5 KB
- Stars: 17
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# mason-update-all
Easily update all [Mason](https://github.com/williamboman/mason.nvim) packages with one command.
## Table of Contents
* [Requirements](#requirements)
* [Installation](#installation)
* [Packer](#packer)
* [vim-plug](#vim-plug)
* [Setup](#setup)
* [Commands](#commands)
* [Events](#events)
* [Updating from CLI](#updating-from-cli)
## Requirements
- [`mason.nvim`](https://github.com/williamboman/mason.nvim)
## Installation
### [Packer](https://github.com/wbthomason/packer.nvim)
```lua
use { 'RubixDev/mason-update-all' }
```
### [vim-plug](https://github.com/junegunn/vim-plug)
```vim
Plug 'RubixDev/mason-update-all'
```
## Setup
```lua
require('mason-update-all').setup()
```
## Commands
- `:MasonUpdateAll` — update all installed Mason packages
## Events
Upon completion of all updates the user event `MasonUpdateAllComplete` will be emitted. You can use it like so:
```lua
vim.api.nvim_create_autocmd('User', {
pattern = 'MasonUpdateAllComplete',
callback = function()
print('mason-update-all has finished')
end,
})
```
or in VimScript:
```vim
autocmd User MasonUpdateAllComplete echo 'mason-update-all has finished'
```
## Updating from CLI
Using the provided vim command and user event, it is possible to update the Mason packages from the command line or shell scripts.
```bash
# Update Packer plugins
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
# Update Mason packages
nvim --headless -c 'autocmd User MasonUpdateAllComplete quitall' -c 'MasonUpdateAll'
```