You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/configuration/customizing_plugins.mdx
+37-72Lines changed: 37 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,19 +78,18 @@ return {
78
78
},
79
79
},
80
80
},
81
-
-- customize treesitter parsers
81
+
-- customize enabled AstroLSP servers
82
82
{
83
-
"nvim-treesitter/nvim-treesitter",
83
+
"AstroNvim/astrolsp",
84
84
opts=function(_, opts)
85
-
-- list like portions of a table cannot be merged naturally and require the user to merge it manually
85
+
-- list like portions of a table cannot be merged naturally and may require the user to merge it manually
86
86
-- check to make sure the key exists
87
-
ifnotopts.ensure_installedthen
88
-
opts.ensure_installed= {}
87
+
ifnotopts.serversthen
88
+
opts.servers= {}
89
89
end
90
-
vim.list_extend(opts.ensure_installed, {
91
-
"lua",
92
-
"vim",
93
-
-- add more arguments for adding more treesitter parsers
90
+
vim.list_extend(opts.servers, {
91
+
"lua_ls",
92
+
-- add more arguments for manually enabling more language servers
94
93
})
95
94
end,
96
95
},
@@ -110,19 +109,19 @@ The `table` notation is the simplest method for configuration but does not cover
110
109
111
110
:::tip
112
111
113
-
Since [`lazy.nvim` v10.23.0](https://github.com/folke/lazy.nvim/releases/tag/v10.23.0) a new configuration option has been added called `opts_extend` which allows specifying that a part of the options passed to the `opts` table should be treated as a list that is extended rather than replaced completely as described below. Since [AstroNvim v4.9.0](https://github.com/AstroNvim/AstroNvim/releases/tag/v4.9.0) this option has been enabled out of the box for the `ensure_installed` tables for [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) and [`mason-tool-installer.nvim`](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim). This allows the user to use the basic table notation to simply add more items to these `ensure_installed` lists.
112
+
Since [`lazy.nvim` v10.23.0](https://github.com/folke/lazy.nvim/releases/tag/v10.23.0) a new configuration option has been added called `opts_extend` which allows specifying that a part of the options passed to the `opts` table should be treated as a list that is extended rather than replaced completely as described below. Since [AstroNvim v4.9.0](https://github.com/AstroNvim/AstroNvim/releases/tag/v4.9.0) this option has been enabled out of the box for the `ensure_installed` tables for [`mason-tool-installer.nvim`](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim). This allows the user to use the basic table notation to simply add more items to these `ensure_installed` lists.
114
113
115
114
:::
116
115
117
-
Let's take a closer look at these two notations with an example using [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter). Let's assume the default configuration for `nvim-treesitter` is:
116
+
Let's take a closer look at these two notations with an example using [`mason-tool-installer.nvim`](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim). Let's assume the default configuration for `mason-tool-installer` is:
118
117
119
118
```lua
120
119
return {
121
-
"nvim-treesitter/nvim-treesitter",
120
+
"WhoIsSethDaniel/mason-tool-installer.nvim",
122
121
opts= {
123
-
ensure_installed= { "lua", "vim" },
124
-
highlight= {
125
-
enable=true,
122
+
ensure_installed= { "lua_ls" },
123
+
integrations= {
124
+
["mason-lspconfig"]=true,
126
125
},
127
126
},
128
127
}
@@ -132,9 +131,9 @@ With this specification the current `opts` would resolve to the table:
132
131
133
132
```lua
134
133
opts= {
135
-
ensure_installed= { "lua", "vim" },
136
-
highlight= {
137
-
enable=true,
134
+
ensure_installed= { "lua_ls" },
135
+
integrations= {
136
+
["mason-lspconfig"]=true,
138
137
},
139
138
}
140
139
```
@@ -143,67 +142,36 @@ If you use the table notation to override these fields in your configuration lik
143
142
144
143
```lua
145
144
return {
146
-
"nvim-treesitter/nvim-treesitter",
145
+
"WhoIsSethDaniel/mason-tool-installer.nvim",
147
146
opts= {
148
-
ensure_installed= { "python" },
149
-
highlight= {
150
-
enable=false,
147
+
ensure_installed= { "prettier" },
148
+
integrations= {
149
+
["mason-lspconfig"] =false,
150
+
["mason-nvim-dap"] =true,
151
151
},
152
-
indent= {
153
-
enable=false,
154
-
},
155
-
},
156
-
}
157
-
```
158
-
159
-
You would end up with the `opts` resolving to:
160
-
161
-
```lua
162
-
opts= {
163
-
ensure_installed= { "python" },
164
-
highlight= {
165
-
enable=false,
166
-
},
167
-
indent= {
168
-
enable=false,
169
152
},
170
153
}
171
154
```
172
155
173
-
The `highlight.enabled` and `indent.enabled` fields work as expected, but the `ensure_installed` table does not actually extend the list and instead simply overwrites it. This is a limitation of the table merging. To resolve this we can rewrite our `opts` as a function where the first parameter is the resolve plugin specification (this is rarely used but may be useful in very advanced cases) and the second parameter which is the current `opts` table:
174
-
175
-
```lua
176
-
return {
177
-
"nvim-treesitter/nvim-treesitter",
178
-
opts=function(plugin, opts)
179
-
table.insert(opts.ensure_installed, "python")
180
-
end,
181
-
}
182
-
```
183
-
184
156
You would end up with the `opts` resolving to:
185
157
186
158
```lua
187
159
opts= {
188
-
ensure_installed= { "lua", "vim", "python" },
189
-
highlight= {
190
-
enable=true,
160
+
ensure_installed= { "prettier" },
161
+
integrations= {
162
+
["mason-lspconfig"] =false,
163
+
["mason-nvim-dap"] =true,
191
164
},
192
165
}
193
166
```
194
167
195
-
One thing to watch out for (that `table` merging handles automatically, but the function notation does not) is the creation of nested/parent keys. When using a function to modify `opts`, you’re responsible for ensuring that nested tables exist before setting any values on them. For example, if we want to set `indent.enable = true`in our `opts` with the function notation, it would look something like this:
168
+
The `integrations.mason-lspconfig` and `integrations.mason-nvim-dap` fields work as expected, but the `ensure_installed` table does not actually extend the list and instead simply overwrites it. This is a limitation of the table merging. To resolve this we can rewrite our `opts` as a function where the first parameter is the resolve plugin specification (this is rarely used but may be useful in very advanced cases) and the second parameter which is the current `opts` table:
196
169
197
170
```lua
198
171
return {
199
-
"nvim-treesitter/nvim-treesitter",
172
+
"WhoIsSethDaniel/mason-tool-installer.nvim",
200
173
opts=function(plugin, opts)
201
-
-- check if an `indent` table exists, if not, create it
202
-
ifnotopts.indentthen
203
-
opts.indent= {}
204
-
end
205
-
-- once we know it is created, we can set the sub-keys
206
-
opts.indent.enable=true
174
+
table.insert(opts.ensure_installed, "prettier")
207
175
end,
208
176
}
209
177
```
@@ -212,12 +180,9 @@ You would end up with the `opts` resolving to:
212
180
213
181
```lua
214
182
opts= {
215
-
ensure_installed= { "lua", "vim", "python" },
216
-
highlight= {
217
-
enable=true,
218
-
},
219
-
indent= {
220
-
enable=true,
183
+
ensure_installed= { "lua_ls", "prettier" },
184
+
integrations= {
185
+
["mason-lspconfig"] =true,
221
186
},
222
187
}
223
188
```
@@ -226,7 +191,7 @@ Notice how we didn't return anything from this function. In Lua, tables are pass
226
191
227
192
```lua
228
193
return {
229
-
"nvim-treesitter/nvim-treesitter",
194
+
"WhoIsSethDaniel/mason-tool-installer.nvim",
230
195
opts=function(plugin, opts)
231
196
return {}
232
197
end,
@@ -239,7 +204,7 @@ You would end up with the `opts` resolving to:
239
204
opts= {}
240
205
```
241
206
242
-
The last thing that this function notation provides is the ability to `require` modules safely even with lazy loading. `nvim-treesitter` isn't a great example of this, so here is a simple example with `nvim-cmp`. `nvim-cmp` allows the configuration of mappings and provides helper functions to make setting these mappings easy. Because `nvim-cmp` is lazy loaded, the function notation is required in this situation so that we don't break the lazy loading:
207
+
The last thing that this function notation provides is the ability to `require` modules safely even with lazy loading. `mason-tool-installer.nvim` isn't a great example of this, so here is a simple example with `nvim-cmp`. `nvim-cmp` allows the configuration of mappings and provides helper functions to make setting these mappings easy. Because `nvim-cmp` is lazy loaded, the function notation is required in this situation so that we don't break the lazy loading:
243
208
244
209
```lua
245
210
return {
@@ -293,17 +258,17 @@ return {
293
258
294
259
##### `list_insert_unique`
295
260
296
-
Other times when you do list inserting you want to safely insert new entries into a list but skip over values that already exist. This is useful if you are importing lots of language packs in AstroCommunity. Here is the previous `nvim-treesitter` example above using this function:
261
+
Other times when you do list inserting you want to safely insert new entries into a list but skip over values that already exist. This is useful if you are importing lots of language packs in AstroCommunity. Here is the previous `mason-tool-installer` example above using this function:
297
262
298
263
```lua
299
264
return {
300
-
"nvim-treesitter/nvim-treesitter",
265
+
"WhoIsSethDaniel/mason-tool-installer.nvim",
301
266
opts=function(plugin, opts)
302
267
-- `list_insert_unique` is in place, so it will modify
Copy file name to clipboardExpand all lines: src/content/docs/faq.mdx
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,6 @@ If you're already using a Nerd Font and face this issue it's very likely that yo
34
34
35
35
If your icons appear too small it's because you're using a Mono font. If a font ends with `mono` the icons will also be monospaced. [Video recommendation](https://youtu.be/mQdB_kHyZn8) on how to install a Nerd Font for a handful of popular terminals.
36
36
37
-
## Why am I getting `symbol not found` error on Mac OS Sonoma?
38
-
39
-
This was a bug in core Neovim not supporting Mac OS Sonoma. Most likely you have an outdated [Neovim](https://github.com/neovim/neovim) version, please update to at least v0.10.
40
-
41
37
## Why is `<Leader>fw` not working?
42
38
43
39
Make sure you have [ripgrep](https://github.com/BurntSushi/ripgrep) installed. For other missing feature please check [optional requirements section](/#-requirements) in the documentation.
Copy file name to clipboardExpand all lines: src/content/docs/index.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ AstroNvim is an aesthetically pleasing and feature-rich neovim config that is ex
25
25
## ⚡ Requirements
26
26
27
27
-[Nerd Fonts](https://www.nerdfonts.com/font-downloads) (_Optional with manual intervention:_ See [Recipes/Customizing Icons](/recipes/icons#disable-icons)) <sup>[[1]](#1)</sup>
28
-
-[Neovim v0.10+ (_Not_ including nightly)](https://github.com/neovim/neovim/releases/tag/stable)
28
+
-[Neovim v0.11+ (_Not_ including nightly)](https://github.com/neovim/neovim/releases/tag/stable)
29
29
-[Tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md) (_Note:_ This is only necessary if you want to use `auto_install` feature with Treesitter)
30
30
- A clipboard tool is necessary for the integration with the system clipboard (see [`:help clipboard-tool`](https://neovim.io/doc/user/provider.html#clipboard-tool) for supported solutions)
31
31
- Terminal with true color support (for the default theme, otherwise it is dependent on the theme you are using) <sup>[[2]](#2)</sup>
@@ -161,7 +161,6 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
161
161
> Example: `:DapInstall python`
162
162
163
163
-**Manage plugins**
164
-
165
164
- Run `:Lazy check` (`<Leader>pu`) to check for plugin updates
166
165
- Run `:Lazy update` (`<Leader>pU`) to apply any pending plugin updates
167
166
- Run `:Lazy sync` (`<Leader>pS`) to update and clean plugins
Copy file name to clipboardExpand all lines: src/content/docs/recipes/advanced_lsp.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -676,7 +676,7 @@ return {
676
676
677
677
## Inlay Hints
678
678
679
-
Since Neovim v0.10 there is the ability to handle and render inline virtual text and therefore first class support of inlay hints. AstroLSP comes with a built in feature for enabling inlay hints easily as well as toggling them during runtime. By default inlay hints are disabled, but they can easily be enabled by default by modifying `features.inlay_hints` in the AstroLSP `opts`:
679
+
Neovim has the ability to handle and render inline virtual text and therefore first class support of inlay hints. AstroLSP comes with a built in feature for enabling inlay hints easily as well as toggling them during runtime. By default inlay hints are disabled, but they can easily be enabled by default by modifying `features.inlay_hints` in the AstroLSP `opts`:
Copy file name to clipboardExpand all lines: src/content/docs/recipes/disable_borders.mdx
+5-41Lines changed: 5 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,7 @@ id: disable_borders
3
3
title: Disable Borders
4
4
---
5
5
6
-
By default AstroNvim unifies the user interface to utilize rounded borders. If you prefer other border types such as setting borders to `"none"` then you currently must do this for each individual plugin which has configurable borders. The provided code below helps aid the user in getting started with this.
7
-
8
-
It is worth noting that Neovim v0.11 adds support for a new option, `winborder`, which will allow an easy place to change this option. Currently AstroNvim is not able to utilize this option due to lack of support in plugins currently which leads to unexpected results in the user interface. Once plugins catch up in general we will move to utilizing this option globally to improve the user configuration experience.
6
+
By default AstroNvim unifies the user interface to utilize rounded borders. If you prefer other border types such as setting borders to `"none"` then you currently must do this for each individual plugin which has configurable borders. This can be easily configured with the `vim.opt.winborder` configuration setting. Here is some example code:
0 commit comments