Top Related Projects
A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
:hibiscus: Minimalist Vim Plugin Manager
:zap: Dark powered Vim/Neovim plugin manager
Quick Overview
Lazy.nvim is a modern plugin manager for Neovim. It offers fast startup times, lazy-loading capabilities, and advanced features like dependency management and version locking. Lazy.nvim aims to simplify plugin management while providing powerful options for customization.
Pros
- Fast startup times due to efficient lazy-loading
- Easy to use with a simple configuration syntax
- Supports automatic plugin installation and updates
- Provides advanced features like dependency management and version locking
Cons
- Requires Neovim 0.8.0 or higher
- May require some learning for users transitioning from other plugin managers
- Some advanced features might be overwhelming for beginners
Code Examples
- Basic plugin configuration:
require("lazy").setup({
"folke/which-key.nvim",
{ "folke/neoconf.nvim", cmd = "Neoconf" },
"folke/neodev.nvim",
})
This code sets up Lazy.nvim and adds three plugins: which-key.nvim, neoconf.nvim (lazy-loaded on command), and neodev.nvim.
- Plugin with dependencies and configuration:
{
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/notes",
},
},
},
},
}
end,
}
This example configures the Neorg plugin with a build command, a dependency, and a configuration function.
- Conditional loading based on Neovim version:
{
"folke/trouble.nvim",
cond = function()
return vim.version().minor >= 8
end,
}
This code loads the trouble.nvim plugin only if the Neovim version is 0.8 or higher.
Getting Started
To get started with Lazy.nvim, follow these steps:
- Add the following code to your Neovim configuration file (usually
~/.config/nvim/init.lua
):
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Add your plugins here
})
- Add your desired plugins to the
setup
function call. - Restart Neovim, and Lazy.nvim will automatically install and manage your plugins.
Competitor Comparisons
A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
Pros of Packer.nvim
- Mature and stable plugin with a large user base
- Supports a wide range of plugin types and installation methods
- Offers fine-grained control over plugin loading and compilation
Cons of Packer.nvim
- Slower startup times compared to Lazy.nvim
- Requires manual intervention for plugin updates
- Less intuitive configuration syntax for some users
Code Comparison
Packer.nvim configuration:
use {
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} }
}
Lazy.nvim configuration:
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' }
}
Key Differences
- Lazy.nvim offers faster startup times and automatic plugin updates
- Packer.nvim provides more granular control over plugin loading
- Lazy.nvim has a more modern and user-friendly configuration syntax
- Packer.nvim has a larger ecosystem of plugins and configurations
Conclusion
While Packer.nvim is a well-established and feature-rich plugin manager, Lazy.nvim offers improved performance and a more streamlined user experience. The choice between the two depends on individual needs and preferences, with Lazy.nvim being particularly attractive for users seeking faster startup times and simplified configuration.
:hibiscus: Minimalist Vim Plugin Manager
Pros of vim-plug
- Simpler setup and configuration, ideal for beginners
- Faster initial startup time for Vim/Neovim
- Wider compatibility with older Vim versions
Cons of vim-plug
- Lacks advanced features like lazy loading and dependency management
- Manual intervention required for plugin updates
- Less granular control over plugin loading and configuration
Code Comparison
vim-plug:
call plug#begin()
Plug 'tpope/vim-fugitive'
Plug 'preservim/nerdtree'
call plug#end()
lazy.nvim:
require("lazy").setup({
{ "tpope/vim-fugitive", lazy = true },
{ "preservim/nerdtree", event = "VeryLazy" },
})
Key Differences
- lazy.nvim offers more advanced features like lazy loading and automatic plugin management
- vim-plug uses Vimscript, while lazy.nvim uses Lua for configuration
- lazy.nvim provides better performance for larger plugin collections
- vim-plug has a larger user base and more extensive documentation
- lazy.nvim integrates more deeply with Neovim's ecosystem
Conclusion
vim-plug is a solid choice for users seeking simplicity and broad compatibility. lazy.nvim, on the other hand, offers more advanced features and better performance, making it ideal for power users and those working exclusively with Neovim. The choice between the two depends on individual needs and preferences.
:zap: Dark powered Vim/Neovim plugin manager
Pros of dein.vim
- Mature and well-established plugin manager with a long history
- Supports both Vim and Neovim
- Offers a wide range of customization options for advanced users
Cons of dein.vim
- Less intuitive configuration syntax compared to lazy.nvim
- Slower plugin loading times, especially for larger plugin collections
- Limited built-in lazy-loading capabilities
Code Comparison
dein.vim configuration:
call dein#add('Shougo/deoplete.nvim')
call dein#add('vim-airline/vim-airline')
lazy.nvim configuration:
return {
{ "Shougo/deoplete.nvim" },
{ "vim-airline/vim-airline" },
}
Summary
dein.vim is a mature plugin manager with broad compatibility and extensive customization options. However, lazy.nvim offers a more modern approach with improved performance and easier configuration. lazy.nvim's lazy-loading capabilities and simpler syntax make it more appealing for users seeking a streamlined setup, while dein.vim may be preferred by those who require advanced customization or compatibility with older Vim versions.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Install · Configure · Docs
lazy.nvim is a modern plugin manager for Neovim.
⨠Features
- ð¦ Manage all your Neovim plugins with a powerful UI
- ð Fast startup times thanks to automatic caching and bytecode compilation of Lua modules
- ð¾ Partial clones instead of shallow clones
- ð Automatic lazy-loading of Lua modules and lazy-loading on events, commands, filetypes, and key mappings
- â³ Automatically install missing plugins before starting up Neovim, allowing you to start using it right away
- ðª Async execution for improved performance
- ð ï¸ No need to manually compile plugins
- 𧪠Correct sequencing of dependencies
- ð Configurable in multiple files
- ð Generates helptags of the headings in
README.md
files for plugins that don't have vimdocs - ð» Dev options and patterns for using local plugins
- ð Profiling tools to optimize performance
- ð Lockfile
lazy-lock.json
to keep track of installed plugins - ð Automatically check for updates
- ð Commit, branch, tag, version, and full Semver support
- ð Statusline component to see the number of pending updates
- ð¨ Automatically lazy-loads colorschemes
â¡ï¸ Requirements
- Neovim >= 0.8.0 (needs to be built with LuaJIT)
- Git >= 2.19.0 (for partial clones support)
- a Nerd Font (optional)
- luarocks to install rockspecs.
You can remove
rockspec
fromopts.pkg.sources
to disable this feature.
ð Getting Started
Check the documentation website for more information.
Top Related Projects
A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
:hibiscus: Minimalist Vim Plugin Manager
:zap: Dark powered Vim/Neovim plugin manager
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot