Skip to content

ntk148v/leanpack.nvim

Repository files navigation

leanpack.nvim logo

Leanpack.nvim

A layer on top of Neovim's native vim.pack, adding support for lazy-loading and the widely adopted lazy.nvim-like declarative spec.

Requirements: Neovim 0.12+

Documentation

Document Description
Getting Started Quick start guide
Installation Detailed installation options
Configuration All configuration options
Plugin Spec Complete plugin specification reference
Lazy Loading Lazy loading triggers and patterns
Commands CLI commands reference
API Lua API reference
Migrating Migration guide from lazy.nvim

Quick Start

Bootstrap

Add this to the top of your init.lua:

-- Setup leanpack.nvim plugin manager
vim.pack.add({ { src = "https://github.com/ntk148v/leanpack.nvim" } })

-- Setup leanpack with import from lua/plugins/
require("leanpack").setup({
    { import = "plugins" },
    defaults = {
        lazy = true,
    },
    performance = {
        vim_loader = true,
        rtp_prune = true,
    },
})

Create Specs

Create your plugin specs in lua/plugins/:

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

Features

  • Native Core: Completely leverages the native vim.pack infrastructure (Neovim 0.12+).
  • Lazy-loading: Load plugins on demand via events, commands, keymaps, or filetypes.
  • lazy.nvim Compatible: Uses the same declarative spec format you know.
  • Dependency Management: Automatic resolution and topological loading.
  • Build Hooks: Run commands or Lua functions on install/update.
  • Performance: Built-in vim.loader integration and RTP pruning.

Commands

  • :Leanpack - Open the UI (supports / filtering)
  • :Leanpack sync - Sync all plugins (update + clean)
  • :Leanpack update - Update all or specific plugin
  • :Leanpack clean - Remove unused plugins
  • :Leanpack build! - Run all build hooks
  • :Leanpack load! - Load all pending plugins
  • :Leanpack profile - View detailed startup timing profile

See Commands for details.

Configuration

require('leanpack').setup({
  defaults = {
    confirm = true,
  },
  performance = {
    vim_loader = true,
    rtp_prune = true, -- Disable built-in plugins for faster startup
  },
})

See Configuration for more options.

Migrating from lazy.nvim

Most of your lazy.nvim plugin specs will work as-is with leanpack. Key differences are documented in Migrating.

  • version pinning: lazy.nvim's version field maps to leanpack's sem_version
  • dev mode: Use dev = true with dir = '~/projects/plugin-name' for local development
  • optional: Use optional = true for dependencies that won't block plugin loading
  • module trigger: leanpack automatically supports require()-based lazy loading matching the auto-detected or explicit main module names.

Acknowledgements

  • Inspired by lazy.nvim for the declarative spec design

About

Yet another Neovim plugin manager, build on top of vim.pack (Neovim >= 0.12.0)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors