Convert Figma logo to code with AI

folke logolazy.nvim

💤 A modern plugin manager for Neovim

13,952
332
13,952
8

Top Related Projects

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config

33,891

: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

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

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

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

  1. 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
})
  1. Add your desired plugins to the setup function call.
  2. 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.

33,891

: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 Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Install · Configure · Docs

lazy.nvim is a modern plugin manager for Neovim.

image

✨ 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 from opts.pkg.sources to disable this feature.

🚀 Getting Started

Check the documentation website for more information.