VimSenseiStartarrow_forward
/ setup guide·4 min read·beginner

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.

/ 01

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:

// snippet
nvim --version | head -1

Don't have Neovim yet? Install it first, then come back here.

/ 02

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.

  1. 01

    Create the folders

    // snippet
    mkdir -p ~/.config/nvim/lua/config
    mkdir -p ~/.config/nvim/lua/plugins
    touch ~/.config/nvim/init.lua

    lua/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.

/ 03

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.

// ~/.config/nvim/lua/config/lazy.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("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:

// ~/.config/nvim/init.lua
require("config.lazy")
/ 04

Verify it's alive

Open Neovim. The first launch clones lazy.nvim itself, which takes a second or two.

~/.config/nvimready
$ 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.

/ 05

Now practice

You own a real lua/config/lazy.lua now — the exact wiring every plugin you add later depends on.

/ Helpful?

Was this guide useful? One tap, no signup needed.

/ 05 — Now Practice

New keybinding → new muscle memory.

Reading only gets you so far. Your fingers need reps.