Bootstrap lazy.nvim.
One Lua snippet turns a bare Neovim into a plugin-ready editor. Here's the exact bootstrap code, where it goes, and how to confirm it's alive — before you write a single plugin spec.
What you need first
lazy.nvim needs Neovim 0.9 or later — it leans on APIs vanilla Vim doesn't have. Check what you're running:
nvim --version | head -1Don't have Neovim yet? Install it first, then come back here.
Set up the config skeleton
lazy.nvim expects a specific layout: one file that bootstraps lazy itself, and a folder it scans for plugin specs. This is the same layout lesson 27 and 28 use, so what you build here matches what you'll see there.
- 01
Create the folders
// snippetmkdir -p ~/.config/nvim/lua/config mkdir -p ~/.config/nvim/lua/plugins touch ~/.config/nvim/init.lualua/config/holds editor-wide setup (the lazy bootstrap goes here).lua/plugins/stays mostly empty for now — lazy auto-loads any file dropped in later, one plugin per file.
The bootstrap snippet
This is the standard lazy.nvim bootstrap: it clones lazy.nvim itself the first time Neovim starts, then hands control to it.
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("plugins")That last line is the important one — require("lazy").setup("plugins") tells lazy to scan lua/plugins/ for spec files. Now wire it into init.lua:
require("config.lazy")Verify it's alive
Open Neovim. The first launch clones lazy.nvim itself, which takes a second or two.
$ nvim :Lazy // opens the lazy.nvim UI // "0 plugins" — nothing in lua/plugins/ yet, and that's correct :q // close the Lazy window
If :Lazy opens at all, the bootstrap worked. An empty plugin list isn't a bug — you haven't dropped any spec files into lua/plugins/ yet.
Now practice
You own a real lua/config/lazy.lua now — the exact wiring every plugin you add later depends on.
Was this guide useful? One tap, no signup needed.
New keybinding → new muscle memory.
Reading only gets you so far. Your fingers need reps.