Plugin Management with lazy.nvim
Install, configure, update, and lazy-load Neovim plugins efficiently using the lazy.nvim package manager.
Prerequisites
- -Neovim 0.9+ installed
- -lazy.nvim bootstrapped in init.lua
Steps
Add a new plugin
Create a plugin spec file to install and configure a new plugin.
Each file in lua/plugins/ can return one spec table or a list of specs. lazy.nvim auto-discovers them.
Sync plugins after changes
Tell lazy.nvim to install new plugins and update existing ones.
Configure lazy-loading triggers
Set up plugins to load only when needed to keep startup fast.
Use 'event' to load on buffer events, 'cmd' to load on command use, 'keys' to load on keybinding, or 'ft' to load on filetype.
Check plugin load times
Profile startup to see how long each plugin takes to load.
Pin plugin versions with the lockfile
Commit the lockfile to ensure reproducible plugin versions across machines.
The lockfile is updated automatically on :Lazy sync. Commit it to version control and run :Lazy restore on another machine.
Full Script
FAQ
Discussion
Loading comments...