Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 28, 2026·3 min de lecture

which-key.nvim — Keybinding Helper and Popup for Neovim

Displays available keybindings in a popup as you type, helps discover and remember mappings

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
which-key.nvim
Commande d'installation directe
npx -y tokrepo@latest install 3adaec04-8a1c-11f1-9bc6-00163e2b0d79 --target codex

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

Introduction

which-key.nvim is a Lua plugin for Neovim that displays a popup with possible key bindings when you start typing a key sequence. Created by folke, it has gained over 7,200 stars on GitHub and is one of the most widely adopted Neovim plugins for improving keybinding discoverability.

What which-key.nvim Does

The plugin monitors your keypress sequences in real time. When you press a prefix key and pause, it renders a floating window listing every registered mapping that begins with that prefix. Each entry shows the key, a description (if provided), and grouping labels. This turns Neovim's vast keymap space into something browsable rather than requiring pure memorization.

Architecture Overview

which-key.nvim is written entirely in Lua and hooks into Neovim's keymap system via vim.on_key. It reads mappings from Neovim's internal keymap tables and descriptions registered through vim.keymap.set. The popup uses Neovim's floating window API. Keys are organized into a tree structure for efficient prefix matching.

Self-Hosting & Configuration

which-key.nvim runs entirely within your local Neovim instance with no external dependencies. Configuration is done through a setup() call in your init.lua. Key options include: plugins.marks, plugins.registers, plugins.spelling, window.border (popup border style), layout.align, and triggers (which prefixes activate the popup). Custom group names are registered via the register() function.

Key Features

  • Automatic popup showing available keybindings after a configurable delay
  • Group labels to organize related mappings under descriptive headings
  • Built-in display of marks, registers, and spelling suggestions
  • Full support for all Neovim modes (normal, visual, operator-pending, insert)
  • Customizable window appearance including position, border, and padding
  • Integration with popular plugins like Telescope, LSP, and gitsigns

Comparison with Similar Tools

vim-which-key was the original Vimscript implementation inspired by Emacs which-key. which-key.nvim is a full Lua rewrite offering faster rendering and tighter Neovim integration. Compared to simply reading :map output, which-key.nvim provides contextual, real-time discovery. mini.clue from mini.nvim offers similar functionality with a more minimal footprint but fewer display customization options.

FAQ

Does it slow down normal typing? No. The popup only appears after a configurable idle delay (default 200-500ms). Normal fast typing is unaffected.

Can I hide certain mappings? Yes. You can set hidden patterns in configuration to exclude specific keys or groups from the popup.

Does it work with lazy-loaded plugins? Yes. Mappings registered after startup are picked up dynamically as plugins load.

Sources

Fil de discussion

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

Actifs similaires