# nvim-dap — Debug Adapter Protocol Client for Neovim > DAP client implementation enabling debugging directly in Neovim with breakpoints, stepping, variable inspection ## Install Save in your project root: # nvim-dap — Debug Adapter Protocol Client for Neovim ## Quick Use Install via your plugin manager (e.g., lazy.nvim: `{ "mfussenegger/nvim-dap" }`). Configure a debug adapter for your language — for example, add `dap.adapters.python` and `dap.configurations.python` in your init.lua. Set a breakpoint with `:lua require("dap").toggle_breakpoint()` and start debugging with `:lua require("dap").continue()`. ## 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 - GitHub repository: https://github.com/mfussenegger/nvim-dap - DAP specification: https://microsoft.github.io/debug-adapter-protocol/ - Neovim documentation: `:help dap` --- Source: https://tokrepo.com/en/workflows/asset-6ccf4dd6 Author: AI Open Source