Skip to content

Commit bea7dee

Browse files
authored
Update for AstroNvim v5 (#163)
* fix: migrate from lspkind and web-devicons to `mini.icons` * fix: migrate from nvim-colorizer to `nvim-highlight-colors` * fix: migrate to using `mason-tool-installer.nvim` for all Mason package management * fix: bump required Neovim version to 0.10 * feat: remove old plugins for `snacks.nvim` migration * feat(mappings): add new `<Leader>uv` and `<Leader>uV` mappings * docs(default_plugins): add note about plugins only when using Neovim 0.10 * docs(migration): start working on the v5 migration guide * fix(recipes): update AstroCommunity links for recipes * feat(mappings): add new LSP mappings * feat(migration): add more details to the v5 migration guide * fix: broken link * fix: update migration banner * chore: update dependencies * fix: use relative link for migration guide * feat(migration): add tip for doing the migration with the user configuration rather than a base template * fix: disable ligatures * chore(migration): remove duplicate notice * fix(migration): add link and note about where to locate keycode casing * feat(migration): add new commenting mappings * feat(migration): add comment about new `v:count` support for diagnostic navigation * feat: move from `nvim-cmp` to `blink.cmp`
1 parent 75c10bc commit bea7dee

28 files changed

+1082
-1223
lines changed

astro.config.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ export default defineConfig({
118118
logo: {
119119
src: "./src/assets/astronvim.svg",
120120
},
121-
components: {
122-
SiteTitle: "./src/components/SiteTitle.astro",
123-
},
124121
plugins: [
125122
starlightDocSearch({
126123
appId: "JXZNTZ86UN",

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"upgrade": "pnpm dlx @astrojs/upgrade"
1212
},
1313
"dependencies": {
14-
"@astrojs/mdx": "^4.0.6",
15-
"@astrojs/starlight": "^0.31.1",
16-
"@astrojs/starlight-docsearch": "^0.4.0",
14+
"@astrojs/mdx": "^4.1.1",
15+
"@astrojs/starlight": "^0.32.2",
16+
"@astrojs/starlight-docsearch": "^0.6.0",
1717
"@astrojs/starlight-tailwind": "^3.0.0",
18-
"@astrojs/tailwind": "^5.1.4",
18+
"@astrojs/tailwind": "^6.0.0",
1919
"@expressive-code/plugin-collapsible-sections": "^0.35.3",
2020
"@fontsource-variable/inter": "^5.1.1",
2121
"@fontsource-variable/jetbrains-mono": "^5.1.2",
22-
"astro": "^5.1.7",
22+
"astro": "^5.4.3",
2323
"sharp": "^0.33.4",
2424
"starlight-image-zoom": "^0.1.0",
2525
"starlight-links-validator": "^0.5.3",

pnpm-lock.yaml

Lines changed: 418 additions & 437 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/recipes/picker_theme.png

149 KB
Loading
-289 KB
Binary file not shown.

src/components/SiteTitle.astro

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/content/docs/configuration/customizing_plugins.mdx

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,6 @@ return {
7878
},
7979
},
8080
},
81-
-- customize cmp mappings
82-
{
83-
"hrsh7th/nvim-cmp",
84-
-- override the options table that is used
85-
-- in the `require("cmp").setup()` call
86-
opts = function(_, opts)
87-
-- opts parameter is the default options table
88-
-- the function is lazy loaded so cmp is able to be required
89-
local cmp = require("cmp")
90-
-- modify the mapping part of the table
91-
opts.mapping["<C-x>"] = cmp.mapping.select_next_item()
92-
end,
93-
},
9481
-- customize treesitter parsers
9582
{
9683
"nvim-treesitter/nvim-treesitter",
@@ -123,7 +110,7 @@ The `table` notation is the simplest method for configuration but does not cover
123110

124111
:::tip
125112

126-
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 the following plugins: [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter), [`mason-lspconfig.nvim`](https://github.com/williamboman/mason-lspconfig.nvim), [`mason-null-ls.nvim`](https://github.com/jay-babu/mason-null-ls.nvim), and [`mason-nvim-dap.nvim`](https://github.com/jay-babu/mason-nvim-dap.nvim). This allows the user to use the basic table notation to simply add more items to these `ensure_installed` lists.
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.
127114

128115
:::
129116

@@ -324,7 +311,7 @@ return {
324311

325312
### Extending Core Plugin Config Functions
326313

327-
Many of our core plugins have additional code that runs during setup which you might want to extend. For this reason we have included our own modules in `require("astronvim.plugins.configs.X")` (replacing `X` with the plugin `require` string) that returns the AstroNvim default config function in each plugin specification that has a `config` function which can be easily called if you want to extend a plugin configuration. This is particularly useful if you want to do something like add rules to `nvim-autopairs`, add user snippets to `luasnip`, or add more extensions to `telescope` without having to rewrite our entire configuration function. Here is an example of adding the `media_files` Telescope extension:
314+
Many of our core plugins have additional code that runs during setup which you might want to extend. For this reason we have included our own modules in `require("astronvim.plugins.configs.X")` (replacing `X` with the plugin `require` string) that returns the AstroNvim default config function in each plugin specification that has a `config` function which can be easily called if you want to extend a plugin configuration. This is particularly useful if you want to do something like add rules to `nvim-autopairs` or add user snippets to `luasnip` without having to rewrite our entire configuration function. Here is an example of adding extending LuaSnip to use extend snippet filetypes:
328315

329316
:::note
330317

@@ -335,30 +322,27 @@ Not all plugins have custom `config` functions and will not have an `astronvim.p
335322
```lua title="lua/plugins/extended_config.lua" {10-11}
336323
return {
337324
{
338-
"nvim-telescope/telescope.nvim",
339-
dependencies = { -- add a new dependency to telescope that is our new plugin
340-
"nvim-telescope/telescope-media-files.nvim",
341-
},
325+
"L3MON4D3/LuaSnip",
342326
-- the first parameter is the plugin specification
343327
-- the second is the table of options as set up in Lazy with the `opts` key
344328
config = function(plugin, opts)
345329
-- run the core AstroNvim configuration function with the options table
346-
require("astronvim.plugins.configs.telescope")(plugin, opts)
330+
require("astronvim.plugins.configs.luasnip")(plugin, opts)
347331

348-
-- require telescope and load extensions as necessary
349-
require("telescope").load_extension("media_files")
332+
-- require luasnip and use it's API as normal
333+
require("luasnip").filetype_extend("javascript", { "javascriptreact" })
350334
end,
351335
},
352336
}
353337
```
354338

355339
## Disabling Plugins
356340

357-
Plugins can be easily disabled by simply setting the `enabled` option to `false`. Here is an example of disabling the core dashboard plugin, `alpha`:
341+
Plugins can be easily disabled by simply setting the `enabled` option to `false`. Here is an example of disabling the core easy escape plugin, `better-escape`:
358342

359343
```lua title="lua/plugins/disabled.lua" "enabled = false"
360344
return {
361-
{ "goolord/alpha-nvim", enabled = false },
345+
{ "max397574/better-escape.nvim", enabled = false },
362346
}
363347
```
364348

@@ -390,7 +374,7 @@ return {
390374
},
391375

392376
-- this plugin will be loaded on the autocmd event "UIEnter"
393-
{ "rcarriga/nvim-notify", event = "UIEnter" },
377+
{ "rebelot/heirline.nvim", event = "UIEnter" },
394378
}
395379
```
396380

@@ -445,10 +429,10 @@ return {
445429

446430
AstroNvim has many plugins that we load on the first real file that is open. This is used internally for plugins like Treesitter, LSP related plugins, and other various plugins related to interacting with files. We achieve this by creating a custom `User` `autocmd` event called `AstroFile`. This can also be used by users for lazy loading plugins on the first real file that is opened:
447431

448-
```lua title="lua/plugins/nvim-colorizer.lua" {4}
432+
```lua title="lua/plugins/illuminate.lua" {4}
449433
return {
450434
{
451-
"NvChad/nvim-colorizer.lua",
435+
"RRethy/vim-illuminate",
452436
event = "User AstroFile",
453437
},
454438
}

0 commit comments

Comments
 (0)