nvim-dap
Back to Development
nvim-dapIntermediate12 min

Neovim Debugging with nvim-dap: Breakpoints and Live Inspection

Debugging in the Terminal

Set breakpoints, step through code, and inspect variables directly in Neovim using nvim-dap and a language debugger for a full IDE experience.

Neovim's Lua API means your editor config is a real program — not a pile of Vimscript variables. You get functions, loops, conditionals, and lazy loading for free.

By the end of this 12 min guide, you'll have a working Neovim setup and practical nvim-dap workflows you can use immediately.

Installing nvim-dap & Adapters

Install Neovim:

brew install neovim ripgrep
Tip: Verify the installation with neovim --version or neovim -V after installing.

DAP Configuration Basics

Structure your config into modular files under lua/. Each file handles one concern: options, keymaps, plugins, autocmds.

Here's a foundational configuration to start with:

-- keymaps.lua
vim.keymap.set("n", "w", ":w", { desc = "Save" })
vim.keymap.set("n", "q", ":q", { desc = "Quit" })
vim.keymap.set("n", "e", ":NvimTreeToggle", { desc = "Toggle file tree" })

Breakpoints & Stepping

With Neovim configured, these nvim-dap-specific workflows will save you time every day:

Pro tip: Don't try to adopt everything at once. Start with <leader>ff find files with Telescope and add more as it becomes habit.

REPL, Watches & Scopes

Once you're comfortable with Neovim basics, these advanced techniques will transform your nvim-dap workflow:

Adapter & Session Issues

Here are the most common Neovim issues and how to fix them:

Debug Mastery

Congratulations — you now have a solid Neovim foundation. Here's where to go next:

← PreviousObsidian Sync & Backup Strategy: Never Lose Your Second BrainNext →Raycast Window Management: Snap, Tile, and Switch Like a Pro