Skip to main content

lazy.nvim

The starter includes a pre-configured lazy.nvim setup that installs the LazyVim plugin and imports its plugins.

tip

The version for lazy.nvim and LazyVim will default to the latest stable release.

If you'd rather use the latest development version, add the code below to your specs:

lua/plugins/core.lua
return {
{ "folke/lazy.nvim", version = false },
{ "LazyVim/LazyVim", version = false },
}
caution

lazy.nvim can be configured to always try to use the latest stable version of a plugin, if a plugin has releases.

However, it's recommended to leave version=false for now, since a lot the plugins that support versioning, have outdated releases, which may break your Neovim install.

If you still want to try using the latest stable releases, you can set config.defaults.version = "*"

Some plugins that are known to break with their outdated release will still be forced to install the latest development version. To override that, specify version="*" for those plugins. (see the LazyVim code)

lua/config/lazy.lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
-- { import = "lazyvim.plugins.extras.lang.typescript" },
-- { import = "lazyvim.plugins.extras.lang.json" },
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})