Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 25, 2026·2 min de lecture

packer.nvim — Plugin Manager for Neovim with Lazy Loading

packer.nvim is a use-package inspired plugin manager for Neovim written in Lua, supporting lazy loading, conditional plugins, Luarocks dependencies, and compiled startup optimization.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
packer.nvim
Commande d'installation directe
npx -y tokrepo@latest install dd3bdd5a-8846-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

packer.nvim brought modern package management to Neovim with first-class Lua support. Inspired by Emacs's use-package, it lets you declare plugins with fine-grained loading conditions and compiles your configuration for fast startup times.

What packer.nvim Does

  • Installs, updates, and removes Neovim plugins from Git repositories
  • Supports lazy loading by command, filetype, event, or key mapping
  • Compiles plugin specifications into a loader file for faster startup
  • Manages Luarocks dependencies alongside Vim plugins
  • Provides a built-in status UI showing install and update progress

Architecture Overview

packer.nvim uses Neovim's native package system (pack//start and pack//opt) as its storage backend. Plugins declared with use are cloned into the appropriate directory. The compile step generates a Lua file that pre-computes the load order and lazy-load triggers, eliminating runtime parsing overhead.

Self-Hosting & Configuration

  • Clone packer.nvim into the Neovim packages directory
  • Define plugins in a Lua file using require('packer').startup()
  • Run :PackerCompile after changing your plugin specification
  • Set compile_path to control where the compiled loader is written
  • Use snapshot and rollback commands to pin and restore plugin versions

Key Features

  • Native Lua configuration aligned with modern Neovim practices
  • Compiled loader for sub-millisecond startup overhead
  • Conditional and lazy loading with multiple trigger types
  • Luarocks integration for native Lua library dependencies
  • Plugin snapshot and rollback for reproducible setups

Comparison with Similar Tools

  • lazy.nvim — Successor with automatic lazy loading and a richer UI; packer requires explicit lazy declarations
  • vim-plug — Vimscript-based with parallel installs; packer.nvim is Lua-native for Neovim
  • Pathogen — Filesystem-only with no lazy loading; packer adds dependency resolution and compilation
  • dein.vim — Supports both Vim and Neovim; packer.nvim targets Neovim exclusively

FAQ

Q: Is packer.nvim still actively maintained? A: The project is feature-complete and in maintenance mode. Many users have migrated to lazy.nvim for continued development.

Q: What does PackerCompile do? A: It generates a compiled Lua file that pre-resolves load order and lazy-load triggers, reducing startup time.

Q: Can I use packer.nvim with init.vim instead of init.lua? A: Yes. Wrap your Lua configuration in a lua << EOF block inside init.vim.

Q: How do I migrate from packer.nvim to lazy.nvim? A: lazy.nvim provides a migration guide. The plugin spec syntax is similar but uses a table-based format instead of function calls.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires