Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for AstroNvim v5 #163

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
01c47db
fix: migrate from lspkind and web-devicons to `mini.icons`
mehalter Sep 17, 2024
e10821c
fix: migrate from nvim-colorizer to `nvim-highlight-colors`
mehalter Sep 17, 2024
bae1cc6
fix: migrate to using `mason-tool-installer.nvim` for all Mason packa…
mehalter Sep 17, 2024
fce5bfd
fix: bump required Neovim version to 0.10
mehalter Sep 17, 2024
dc060d1
feat: remove old plugins for `snacks.nvim` migration
mehalter Mar 11, 2025
735fc98
feat(mappings): add new `<Leader>uv` and `<Leader>uV` mappings
mehalter Mar 11, 2025
29e7ed5
docs(default_plugins): add note about plugins only when using Neovim …
mehalter Mar 11, 2025
58442f9
docs(migration): start working on the v5 migration guide
mehalter Mar 11, 2025
6271c15
fix(recipes): update AstroCommunity links for recipes
mehalter Mar 11, 2025
e1012d1
feat(mappings): add new LSP mappings
mehalter Mar 11, 2025
2f67db2
feat(migration): add more details to the v5 migration guide
mehalter Mar 11, 2025
96f9872
fix: broken link
mehalter Mar 11, 2025
3966879
fix: update migration banner
mehalter Mar 11, 2025
2f9e86d
chore: update dependencies
mehalter Mar 11, 2025
37b3c2e
fix: use relative link for migration guide
mehalter Mar 11, 2025
63f18e6
feat(migration): add tip for doing the migration with the user config…
mehalter Mar 11, 2025
5d2b6d4
fix: disable ligatures
mehalter Mar 12, 2025
93a7fb9
chore(migration): remove duplicate notice
mehalter Mar 12, 2025
3070de7
fix(migration): add link and note about where to locate keycode casing
mehalter Mar 12, 2025
b55d420
feat(migration): add new commenting mappings
mehalter Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ export default defineConfig({
logo: {
src: "./src/assets/astronvim.svg",
},
components: {
SiteTitle: "./src/components/SiteTitle.astro",
},
plugins: [
starlightDocSearch({
appId: "JXZNTZ86UN",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"upgrade": "pnpm dlx @astrojs/upgrade"
},
"dependencies": {
"@astrojs/mdx": "^4.0.6",
"@astrojs/starlight": "^0.31.1",
"@astrojs/starlight-docsearch": "^0.4.0",
"@astrojs/mdx": "^4.1.1",
"@astrojs/starlight": "^0.32.2",
"@astrojs/starlight-docsearch": "^0.6.0",
"@astrojs/starlight-tailwind": "^3.0.0",
"@astrojs/tailwind": "^5.1.4",
"@astrojs/tailwind": "^6.0.0",
"@expressive-code/plugin-collapsible-sections": "^0.35.3",
"@fontsource-variable/inter": "^5.1.1",
"@fontsource-variable/jetbrains-mono": "^5.1.2",
"astro": "^5.1.7",
"astro": "^5.4.3",
"sharp": "^0.33.4",
"starlight-image-zoom": "^0.1.0",
"starlight-links-validator": "^0.5.3",
Expand Down
855 changes: 418 additions & 437 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Binary file added src/assets/recipes/picker_theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/recipes/telescope_theme.png
Binary file not shown.
58 changes: 0 additions & 58 deletions src/components/SiteTitle.astro

This file was deleted.

25 changes: 11 additions & 14 deletions src/content/docs/configuration/customizing_plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The `table` notation is the simplest method for configuration but does not cover

:::tip

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.
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.

:::

Expand Down Expand Up @@ -324,7 +324,7 @@ return {

### Extending Core Plugin Config Functions

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:
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:

:::note

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

-- require telescope and load extensions as necessary
require("telescope").load_extension("media_files")
-- require luasnip and use it's API as normal
require("luasnip").filetype_extend("javascript", { "javascriptreact" })
end,
},
}
```

## Disabling Plugins

Plugins can be easily disabled by simply setting the `enabled` option to `false`. Here is an example of disabling the core dashboard plugin, `alpha`:
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`:

```lua title="lua/plugins/disabled.lua" "enabled = false"
return {
{ "goolord/alpha-nvim", enabled = false },
{ "max397574/better-escape.nvim", enabled = false },
}
```

Expand Down Expand Up @@ -390,7 +387,7 @@ return {
},

-- this plugin will be loaded on the autocmd event "UIEnter"
{ "rcarriga/nvim-notify", event = "UIEnter" },
{ "rebelot/heirline.nvim", event = "UIEnter" },
}
```

Expand Down Expand Up @@ -445,10 +442,10 @@ return {

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:

```lua title="lua/plugins/nvim-colorizer.lua" {4}
```lua title="lua/plugins/illuminate.lua" {4}
return {
{
"NvChad/nvim-colorizer.lua",
"RRethy/vim-illuminate",
event = "User AstroFile",
},
}
Expand Down
Loading