Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 28, 2026·3 min de lectura

nvim-dap — Debug Adapter Protocol Client for Neovim

DAP client implementation enabling debugging directly in Neovim with breakpoints, stepping, variable inspection

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 29/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
CLI Tool
Instalación
Single
Confianza
Confianza: Established
Entrada
nvim-dap
Comando de staging seguro
npx -y tokrepo@latest install 6ccf4dd6-8a1c-11f1-9bc6-00163e2b0d79 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

Introduction

nvim-dap is a Debug Adapter Protocol (DAP) client implementation for Neovim, written by mfussenegger. With over 7,200 stars on GitHub, it brings IDE-level debugging capabilities to Neovim by communicating with language-specific debug adapters through the standardized DAP interface originally created by Microsoft for VS Code.

What nvim-dap Does

nvim-dap connects Neovim to external debug adapters that control program debugging. You can set breakpoints, step through code, inspect variables, evaluate expressions, and navigate the call stack. It handles the DAP JSON-RPC protocol, translating debugger state into Neovim UI elements.

Architecture Overview

The plugin implements the DAP client specification in pure Lua. It communicates with debug adapter processes via JSON-RPC over stdio or TCP. The core manages session lifecycle: initialization, configuration, breakpoint state, and thread/stack frame tracking. UI rendering is minimal in core — nvim-dap-ui provides richer visual interfaces.

Self-Hosting & Configuration

nvim-dap runs locally with no external services. Each language requires a debug adapter binary (e.g., debugpy for Python, codelldb for C/C++/Rust, node-debug2 for JavaScript). Configuration involves two tables in your init.lua: dap.adapters defines how to launch each adapter, and dap.configurations defines launch/attach profiles per filetype. Keybindings are set manually — common mappings include continue, step over, step into, step out, and toggle breakpoint.

Key Features

  • Full DAP protocol support including launch and attach modes
  • Breakpoints: line, conditional, hit count, and log points
  • Step through code: continue, step over, step into, step out
  • Variable inspection via scopes and hover evaluation
  • Call stack navigation across multiple threads
  • REPL for evaluating expressions in the current debug context
  • Extensible through Lua callbacks at every lifecycle event

Comparison with Similar Tools

Compared to Vimspector (Vimscript-based), nvim-dap is Lua-native, lighter, and more composable with other Neovim plugins. VS Code uses the same DAP protocol but bundles its own UI; nvim-dap separates client from UI. Compared to language-specific debugger plugins, nvim-dap provides a unified interface across all DAP-supported languages.

FAQ

Which languages are supported? Any language with a DAP-compliant debug adapter works. Popular ones include Python (debugpy), C/C++/Rust (codelldb, cppdbg), JavaScript/TypeScript (node-debug2, js-debug), Go (delve), and Java (java-debug).

Do I need nvim-dap-ui? No. nvim-dap works standalone with its built-in REPL and sign-based breakpoints. nvim-dap-ui adds floating windows for variables, watches, stacks, and breakpoints.

Can I debug tests? Yes, with the right launch configuration. Plugins like neotest integrate with nvim-dap to debug individual tests directly.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados