Migration to v3.0
Migrating User Configuration
-
Plugin Manager Change: With v3 we have moved away from Packer and to the new lazy.nvim. The options for lazy can be configured with the
lazy
user option. We have also removed all abstraction away from the plugin specifications. So the lazy.nvim docs can be referred to for the format of adding new plugins. You can also check the updated Customizing Plugins Documentation for defining new plugins as well as overriding core plugins.- Lazy also handles overriding options and setup functions automatically so we have removed all of the
plugins.X
user options for overriding the setup tables for the core provided plugins. These can be set up, extended, and configured similar to any other plugin that you are adding. - Note: The default options for lazy sets
lazy = true
for each plugin. This means plugins should either be configured appropriately for lazy loading or uselazy = false
if you do not want a plugin to be lazy loaded - The
user/plugins/
folder is added to the Lazy plugin specifications to be imported. This allows you to add lists of plugins to any files in theuser/plugins/
folder and they will be used appropriately. This will allow you to organize your plugins in any way you would prefer.
- Lazy also handles overriding options and setup functions automatically so we have removed all of the
-
astronvim.file_plugins
andastronvim.git_plugins
tables have been removed in favor of aUser
autocmd
model. Wherever you are usingastronvim.file_plugins
orastronvim.git_plugins
to lazy load your plugins, please switch to lazy loading on the user eventsUser AstroFile
andUser AstroGitFile
. More details for these can be found in the updated Customizing Plugins Documentation. -
A large restructuring of our internal utilities has taken place.
- Our
core
module has been renamed toastronvim
so anywhere you userequire("core...")
will need to be replaced withrequire("astronvim...")
- Most utility functions in the global
astronvim
variable have been separated into specific modules and can be accessed with require such as:require("astronvim.utils")
. Commonly used changes are:astronvim.lsp
is nowrequire("astronvim.utils.lsp")
,astronvim.status
is nowrequire("astronvim.utils.status")
, and most of the various utilities are now just inrequire("astronvim.utils")
. Please check out the updated API documentation here for specific details and finding specific functions: api.astronvim.com.
- Our
-
We have removed Bufferline and are now using Heirline and
astronvim.utils.status
(previously was inastronvim.status
but is now accessed withrequire("astronvim.utils.status")
) for our own performant and custom tabline. -
:AstroReload
has been removed. There are a couple reasons for this, it was never very reliable and hard to maintain and lazy.nvim strictly does not support hot reloading neovim configurations. -
The
require("astronvim.utils.status").component.macro_recording
status component has been removed. Please use the improvedrequire("astronvim.utils.status").component.cmd_info
component. -
lsp.server-settings
has been renamed tolsp.config
. If you have the["server-settings"]
table in youruser/init.lua
file, just rename it toconfig
. If you have the folderuser/lsp/server-settings
, just rename the folder touser/lsp/config
. -
luasnip
options table has been removed. Please see the updated Custom Snippets Documentation for the new way to extend the default configuration of LuaSnip to add new loaders. -
which-key
options table has been removed. Which-key menu titles can now be easily added into themappings
table by setting a binding to a table with thename
property set and it will be passed towhich-key
. For example, you can add the following to themappings
table:["<leader>b"] = { name = "Buffer" }
. -
nvim-autopairs
options table has been removed. Please see the updated Customize Autopairs Documentation for the new way to extend the default configuration of autopairs and adding more rules. -
cmp
options table has been removed. Please see the updated Customize cmp Completion Documentation for the new way to extend the default configuration of cmp and running morecmp
setup functions. -
mason-lspconfig
,mason-null-ls
, andmason-nvim-dap
options tables have been removed, please use the new plugin notation for extending these options like adding custom setup handlers. This is described in the Extending Core Plugin Config Functions Documentation. -
default_theme
has been migrated to a dedicated plugin that can be used outside of AstroNvim as well at AstroNvim/astrotheme. This can be customized and configured the same as any other plugin, check the README for details on thesetup
function. -
The bindings in
cmp
to scroll the preview window for a completion item have moved to<c-u>
and<c-d>
-
<leader>p
mappings for package and plugin management have been cleaned up to follow a common format amongst each other.<leader>ps
is now for checking Plugin Status and<leader>pS
is for syncing plugins. Mason mappings have been moved to<leader>pm
and<leader>pM
for Mason Status and Mason Update respectively. -
The dashboard mapping has been changed from
<leader>d
to<leader>h
for the “Home Screen” -
The debugging menu has been moved from
<leader>D
to<leader>d
for quicker and more comfortable usage. -
H
andL
have been changed to[b
and]b
respectively for changing tabs in the UI. This is for both switching buffers as well as neo-tree sources in the explorer. This can be changed in the your user configuration by adding the following entries to yourmappings.n
table (This uses an internalastronvim.utils.buffer
function that follows the tab positioning and also allows for using a number to move by multiple tabs at once):
L = { function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end, desc = "Next buffer" },
H = { function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, desc = "Previous buffer" },
-
header
option has been removed in favor of decreasing abstractions. Check the updated Dashboard Customizations Documentation -
<leader>s
has been unified with the<leader>f
menu rather than spreading the Telescope mappings out across two menus. Please check the new mappings by pressing<leader>f
or in the updated Mappings Documentation -
Heirline has moved to a more sustainable configuration format for their
setup
call. Before it was configured withrequire("heirline").setup(statusline, winbar, tabline)
, this has moved to a new format with a single table likerequire("heirline").setup({ statusline = statusline, winbar = winbar, tabline = tabline, statuscolumn = statuscolumn })
. If you have a custom Heirline configuration please check out the updated Customizing Statusline Documentation as well as the updated Heirline Documentation. (Note: also that along with all of the other core plugin setups, the abstractions have been removed and you will need to update to the new Lazy syntax described in the Custom Plugins Documentation) -
lsp.skip_setup
option has been removed as the new and improvedlsp.setup_handlers
option makes this easy. If you are using this option for LSP specific plugins, check up the updated Advanced LSP Setup Documentation. This page also includes the new format for setting these plugins up with Lazy.nvim. -
The
default_tbl(override_tbl, default_tbl)
internal function has been removed and replaced withextend_tbl(default_tbl, override_tbl)
. If you use the original function anywhere in your config, remember to rename it and change the order of the parameters. Also note that this now lives inastronvim.utils
rather than the globalastronvim
table. This can be accessed withrequire("astronvim.utils").extend_tbl(default_tbl, override_tbl)
.