Getting Started with leanpack.nvim

April 10, 2026 · View on GitHub

This guide will help you get leanpack.nvim up and running in under 5 minutes.

Prerequisites

  • Neovim 0.12.0 or later
  • Git (required by vim.pack for cloning repositories)

Step 1: Bootstrap leanpack.nvim

Add this to the top of your init.lua:

-- Bootstrap leanpack.nvim
local lazypath = vim.fn.stdpath("data") .. "/site/pack/leanpack/opt/leanpack.nvim"
if not vim.uv.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/ntk148v/leanpack.nvim",
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

Step 2: Set Up Your Leader Keys

Set your leader keys before loading leanpack (recommended):

vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

Step 3: Initialize leanpack.nvim

Add to your init.lua (after the bootstrap):

require("leanpack").setup()

By default, leanpack.nvim will look for plugin specs in lua/plugins/.

Step 4: Create Plugin Specs

Create a lua/plugins/ directory in your config:

~/.config/nvim/
└── lua/
    └── plugins/
        ├── treesitter.lua
        ├── lsp.lua
        └── ...

Each file returns a plugin spec:

-- lua/plugins/treesitter.lua
return {
  'nvim-treesitter/nvim-treesitter',
  build = ':TSUpdate',
  config = function()
    require('nvim-treesitter.configs').setup({
      highlight = { enable = true },
    })
  end,
}

Step 5: Restart Neovim

Restart Neovim and leanpack.nvim will:

  1. Automatically install all plugins from lua/plugins/
  2. Set up lazy loading triggers
  3. Create the :Leanpack command

Verify Installation

Open Neovim and run:

:checkhealth leanpack

You should see:

  • Neovim 0.12+ detected
  • vim.pack module available
  • Git available

Quick Test Commands

CommandDescription
:LeanpackOpen plugin manager UI
:Leanpack updateUpdate all plugins
:Leanpack build!Run all build hooks

What's Next?

Troubleshooting

If plugins don't load:

  1. Check :checkhealth leanpack
  2. Run :Leanpack update to install plugins
  3. Check logs at vim.fn.stdpath("log") .. "/leanpack.log"

For more help, see Troubleshooting.