Migration Guides

May 16, 2026 · View on GitHub

This section covers migrating from other plugin managers to leanpack.nvim.

From lazy.nvim

Most lazy.nvim specs work directly with leanpack.nvim.

Key Differences

lazy.nvimleanpack.nvimNotes
version (semver)version (auto)Automatically parsed as semver
module triggerSupported (auto)Auto-detected via main field

Example Migration

lazy.nvim:

{
  'folke/tokyonight.nvim',
  version = '^2.0',
  lazy = false,
  priority = 1000,
  config = function()
    vim.cmd('colorscheme tokyonight')
  end,
}

leanpack.nvim:

{
  'folke/tokyonight.nvim',
  version = '^2.0',  -- Automatically resolved as semver
  lazy = false,
  priority = 1000,
  config = function()
    vim.cmd('colorscheme tokyonight')
  end,
}

Migrating module Trigger

leanpack.nvim supports module-based lazy loading. When a plugin has lazy = true and a detectable main module, require() calls for that module will automatically trigger loading.

lazy.nvim:

{
  'neovim/nvim-lspconfig',
  module = 'lspconfig',
}

leanpack.nvim:

{
  'neovim/nvim-lspconfig',
  lazy = true,
  -- main module auto-detected as "lspconfig"
  -- require("lspconfig") will trigger loading
}

For plugins where auto-detection fails, set main explicitly:

{
  'someone/odd-naming.nvim',
  lazy = true,
  main = 'actual_module_name',
}

Migrating Plugin Specs

  1. Copy your plugin specs to lua/plugins/
  2. version handles semver ranges automatically — no changes needed
  3. module triggers auto-detected via main field, or set main explicitly if needed
  4. Test with :Leanpack update

Common Mappings

lazy.nvimleanpack.nvim
version = '^1.0'Keep as-is (auto-resolved as semver)
version = 'main'Keep as-is
module = 'pattern'lazy = true + main (auto-detected)
lazy = trueKeep as-is
init = function()Keep as-is
config = function()Keep as-is

From packer.nvim

Key Differences

packer.nvimleanpack.nvim
Async by defaultUses vim.pack (native async)
Custom lockfileUses nvim-pack-lock.json
use functionDirect table specs

Example Migration

packer.nvim:

return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim'
  use 'neovim/nvim-lspconfig'
  use {
    'nvim-telescope/telescope.nvim',
    requires = { 'nvim-lua/plenary.nvim' },
  }
end)

leanpack.nvim:

Create lua/plugins/init.lua:

return {
  'wbthomason/packer.nvim',
  'neovim/nvim-lspconfig',
  {
    'nvim-telescope/telescope.nvim',
    dependencies = { 'nvim-lua/plenary.nvim' },
  },
}

Then in init.lua:

require('leanpack').setup({ import = 'plugins' })

Convert Automatically

You can use a conversion script to transform packer specs:

# Manual conversion: copy specs to lua/plugins/

From vim-plug

Key Differences

vim-plugleanpack.nvim
Plugin functionDirect table specs
Plug commandrequire('leanpack').setup()
Manual installAuto-install via vim.pack

Example Migration

vim-plug:

call plug#begin('~/.local/share/nvim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-treesitter/nvim-treesitter', { 'for': ['lua', 'vim'] }
call plug#end()

leanpack.nvim:

-- lua/plugins/init.lua
return {
  'neovim/nvim-lspconfig',
  {
    'nvim-treesitter/nvim-treesitter',
    ft = { 'lua', 'vim' },
  },
}

From mini.deps

Key Differences

mini.depsleanpack.nvim
add() functionDeclarative specs
now() / later()Lazy triggers
Manual depsAuto-dependency resolution

Example Migration

mini.deps:

require('mini.deps').add({ source = 'neovim/nvim-lspconfig' })
require('mini.deps').add({ source = 'nvim-treesitter/nvim-treesitter' })

leanpack.nvim:

-- lua/plugins/lsp.lua
return 'neovim/nvim-lspconfig'

-- lua/plugins/treesitter.lua
return 'nvim-treesitter/nvim-treesitter'

General Tips

1. Organize Plugins by Feature

lua/
└── plugins/
    ├── init.lua        -- Packer/misc plugins
    ├── treesitter.lua  -- Treesitter
    ├── lsp.lua         -- LSP config
    └── ui.lua          -- UI plugins

2. Use Dependencies

Always declare dependencies explicitly:

{
  'nvim-telescope/telescope.nvim',
  dependencies = {
    'nvim-lua/plenary.nvim',
  },
}

3. Test Incrementally

  1. Start with essential plugins
  2. Add lazy loading triggers
  3. Test with :Leanpack update
  4. Verify with :checkhealth leanpack

Next Steps