Skip to content

Commit 9eaedb8

Browse files
authored
docs: rework Installation & Setup sections, and other minor adjustments (#1951)
1 parent 1aceba8 commit 9eaedb8

2 files changed

Lines changed: 71 additions & 69 deletions

File tree

README.md

Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
[![GitHub CI](https://github.com/mason-org/mason.nvim/workflows/Tests/badge.svg)](https://github.com/mason-org/mason.nvim/actions?query=workflow%3ATests+branch%3Amain+event%3Apush)
55
[![Sponsors](https://img.shields.io/github/sponsors/williamboman)](https://github.com/sponsors/williamboman)
66

7-
<img src="https://user-images.githubusercontent.com/6705160/177613416-0c0354d2-f431-40d8-87f0-21310f0bba0e.png" alt="mason.nvim" />
7+
<h1>
8+
<img src="https://user-images.githubusercontent.com/6705160/177613416-0c0354d2-f431-40d8-87f0-21310f0bba0e.png" alt="mason.nvim" />
9+
</h1>
810

911
<p align="center">
1012
Portable package manager for Neovim that runs everywhere Neovim runs.<br />
@@ -17,19 +19,18 @@
1719
<sup>Latest version: v2.0.0</sup> <!-- x-release-please-version -->
1820
</p>
1921

20-
# Table of Contents
22+
## Table of Contents
2123

2224
- [Introduction](#introduction)
23-
- [Screenshots](#screenshots)
25+
- [Installation & Usage](#installation--usage)
26+
- [Recommended setup for `lazy.nvim`](#recommended-setup-for-lazynvim)
2427
- [Requirements](#requirements)
25-
- [Installation](#installation)
26-
- [Setup](#setup)
27-
- [Extensions](#extensions)
2828
- [Commands](#commands)
2929
- [Registries](#registries)
30+
- [Screenshots](#screenshots)
3031
- [Configuration](#configuration)
3132

32-
# Introduction
33+
## Introduction
3334

3435
> [`:h mason-introduction`][help-mason-introduction]
3536
@@ -39,18 +40,38 @@ with only a small set of [external requirements](#requirements) needed.
3940

4041
Packages are installed in Neovim's data directory ([`:h standard-path`][help-standard-path]) by default. Executables are
4142
linked to a single `bin/` directory, which `mason.nvim` will add to Neovim's PATH during setup, allowing seamless access
42-
from Neovim builtins (shell, terminal, etc.) as well as other 3rd party plugins.
43+
from Neovim builtins (LSP client, shell, terminal, etc.) as well as other 3rd party plugins.
4344

4445
For a list of all available packages, see <https://mason-registry.dev/registry/list>.
4546

46-
## Screenshots
47+
## Installation & Usage
4748

48-
| | | |
49-
| :----------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: |
50-
| <img alt="Main window" src="https://user-images.githubusercontent.com/6705160/177617680-d62caf26-f253-4ace-ab57-4b590595adca.png"> | <img src="https://user-images.githubusercontent.com/6705160/177617684-6bb4c13f-1235-4ac9-829e-120b06f7437b.png"> | <img alt="Language filter" src="https://user-images.githubusercontent.com/6705160/177617688-8f9ba225-00c8-495c-9c4c-b74240d6f280.png"> |
51-
| <img alt="LSP server configuration schema" src="https://user-images.githubusercontent.com/6705160/177617692-02c6ddde-a97e-42b4-bca4-4f4caf45d569.png"> | <img alt="Checking for new versions" src="https://user-images.githubusercontent.com/6705160/180648183-69077d10-8795-4da6-ba4d-57ecf0cb25c9.png"> | <img alt="Help window" src="https://user-images.githubusercontent.com/6705160/180648292-136a0888-0fb6-4226-aa29-53bd3ffed400.png"> |
49+
> [`:h mason-quickstart`][help-mason-quickstart]
50+
51+
Install using your plugin manager of choice. **Setup is required**:
52+
53+
```lua
54+
require("mason").setup()
55+
```
56+
57+
`mason.nvim` is optimized to load as little as possible during setup. Lazy-loading the plugin, or somehow deferring the
58+
setup, is not recommended.
59+
60+
Refer to the [Configuration](#configuration) section for information about which settings are available.
61+
62+
### Recommended setup for `lazy.nvim`
5263

53-
# Requirements
64+
The following is the recommended setup when using `lazy.nvim`. It will set up the plugin for you, meaning **you don't have
65+
to call `require("mason").setup()` yourself**.
66+
67+
```lua
68+
{
69+
"mason-org/mason.nvim",
70+
opts = {}
71+
}
72+
```
73+
74+
## Requirements
5475

5576
> [`:h mason-requirements`][help-mason-requirements]
5677
@@ -85,50 +106,7 @@ your personal usage, some of these will also need to be installed. Refer to `:ch
85106
[winzip]: https://www.winzip.com/
86107
[winrar]: https://www.win-rar.com/
87108

88-
# Installation
89-
90-
## [Packer](https://github.com/wbthomason/packer.nvim)
91-
92-
```lua
93-
use {
94-
"mason-org/mason.nvim"
95-
}
96-
```
97-
98-
## [lazy.nvim](https://github.com/folke/lazy.nvim)
99-
100-
```lua
101-
{
102-
"mason-org/mason.nvim"
103-
}
104-
```
105-
106-
## [vim-plug](https://github.com/junegunn/vim-plug)
107-
108-
```vim
109-
Plug 'mason-org/mason.nvim'
110-
```
111-
112-
# Setup
113-
114-
> [`:h mason-quickstart`][help-mason-quickstart]
115-
116-
```lua
117-
require("mason").setup()
118-
```
119-
120-
`mason.nvim` is optimized to load as little as possible during setup. Lazy-loading the plugin, or somehow deferring the
121-
setup, is not recommended.
122-
123-
Refer to the [Configuration](#configuration) section for information about which settings are available.
124-
125-
## Extensions
126-
127-
Refer to the [Wiki](https://github.com/mason-org/mason.nvim/wiki/Extensions) for a list of 3rd party extensions.
128-
129-
- [`mason-lspconfig.nvim`](https://github.com/mason-org/mason-lspconfig.nvim) - recommended for usage with `lspconfig`
130-
131-
# Commands
109+
## Commands
132110

133111
> [`:h mason-commands`][help-mason-commands]
134112
@@ -139,17 +117,24 @@ Refer to the [Wiki](https://github.com/mason-org/mason.nvim/wiki/Extensions) for
139117
- `:MasonUninstallAll` - uninstalls all packages
140118
- `:MasonLog` - opens the `mason.nvim` log file in a new tab window
141119

142-
# Registries
120+
## Registries
143121

144122
Mason's core package registry is located at [mason-org/mason-registry](https://github.com/mason-org/mason-registry).
145123
Before any packages can be used, the registry needs to be downloaded. This is done automatically for you when using the
146124
different Mason commands (e.g. `:MasonInstall`), but can also be done manually by using the `:MasonUpdate` command.
147125

148126
If you're utilizing Mason's Lua APIs to access packages, it's recommended to use the
149-
[`:h mason-registry.refresh()`][help-mason-registry-refresh] and/or [`:h mason-registry.update()`][help-mason-registry-update]
127+
[`:h mason-registry.refresh()`][help-mason-registry-refresh] or [`:h mason-registry.update()`][help-mason-registry-update]
150128
functions to ensure you have the latest package information before retrieving packages.
151129

152-
# Configuration
130+
## Screenshots
131+
132+
| | | |
133+
| :----------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: |
134+
| <img alt="Main window" src="https://github.com/user-attachments/assets/b9a57d21-f551-45ad-a1e5-a9fd66291510"> | <img alt="Language search" src="https://github.com/user-attachments/assets/3d24fb7b-2c57-4948-923b-0a42bb627cbe"> | <img alt="Language filter" src="https://github.com/user-attachments/assets/c0ca5818-3c74-4071-bc41-427a2cd1056d"> |
135+
| <img alt="Package information" src="https://github.com/user-attachments/assets/6f9f6819-ac97-483d-a77c-8f6c6131ac85"> | <img alt="New package versions" src="https://github.com/user-attachments/assets/ff1adc4d-2fcc-46df-ab4c-291c891efa50"> | <img alt="Help window" src="https://github.com/user-attachments/assets/1fbe75e4-fe69-4417-83e3-82329e1c236e"> |
136+
137+
## Configuration
153138

154139
> [`:h mason-settings`][help-mason-settings]
155140
@@ -170,7 +155,24 @@ require("mason").setup({
170155
})
171156
```
172157

173-
## Default configuration
158+
### Configuration using `lazy.nvim`
159+
160+
```lua
161+
{
162+
"mason-org/mason.nvim",
163+
opts = {
164+
ui = {
165+
icons = {
166+
package_installed = "",
167+
package_pending = "",
168+
package_uninstalled = ""
169+
}
170+
}
171+
}
172+
}
173+
```
174+
175+
### Default configuration
174176

175177
```lua
176178
---@class MasonSettings
@@ -322,11 +324,11 @@ local DEFAULT_SETTINGS = {
322324
👋 didn't find what you were looking for? Try looking in the <a href="./doc/mason.txt">help docs</a> <code>:help mason.nvim</code>!
323325
</sup>
324326

325-
[help-mason-commands]: ./doc/mason.txt#L178
327+
[help-mason-commands]: ./doc/mason.txt#L140
326328
[help-mason-introduction]: ./doc/mason.txt#L11
327-
[help-mason-quickstart]: ./doc/mason.txt#L67
328-
[help-mason-registry-refresh]: ./doc/mason.txt#L549
329-
[help-mason-registry-update]: ./doc/mason.txt#L542
330-
[help-mason-requirements]: ./doc/mason.txt#L50
331-
[help-mason-settings]: ./doc/mason.txt#L238
329+
[help-mason-quickstart]: ./doc/mason.txt#L42
330+
[help-mason-registry-refresh]: ./doc/mason.txt#L520
331+
[help-mason-registry-update]: ./doc/mason.txt#L513
332+
[help-mason-requirements]: ./doc/mason.txt#L25
333+
[help-mason-settings]: ./doc/mason.txt#L200
332334
[help-standard-path]: https://neovim.io/doc/user/starting.html#standard-path

doc/mason.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function:
5050
require("mason").setup()
5151
<
5252
Mason will do the following during setup:
53-
1) enhance the Neovim session's PATH environment
53+
1) add Mason's `bin/` directory to the Neovim session's PATH
5454
2) register commands (|mason-commands|)
5555

5656
Refer to |mason-settings| for all available settings.

0 commit comments

Comments
 (0)