Neovim Debugging: A Dev's Edge in the AI Age


Neovim Debugging: A Dev's Edge in the AI Age

In a world where AI-generated code is slowly becoming the norm, mastering debugging isn't just a nice-to-have skill—it's survival.

As John Carmack, the legendary game engine developer, wisely pointed out:

"A debugger is how you get a view into a system that's too complicated to understand.
I mean, anybody that thinks 'just read the code and think about it'—
that's an insane statement."

- Lex Fridman Podcast


What's the problem?

Most developers encounter bugs and immediately resort to the primitive approach of adding print statements, recompiling, and rerunning their code.

They sprinkle print() statements throughout their codebase, hoping to catch a glimpse of what's happening. This approach is painfully inefficient and often leads nowhere.

The standard solution—littering your code with log statements—creates more problems than it solves.

It clutters your codebase, forces unnecessary recompilation cycles, and provides only limited visibility into what's actually happening. Even for those who aren't compiling, trying to gain visibility into malfunctioning code (or worse - a large module) can quickly become a game of a cat endlessly chasing a mouse (or a bug..?).

And with increasingly complex AI-generated code becoming commonplace, this approach simply won't cut it anymore.

Personally, just based on the last few days, all those "vibe" coders, who are actually making money from their new vibe coded games and SaaS products, will start paying big bucks to senior helping them understand behaviours and bugs.

Here's where Neovim's debugging capabilities shine

Using the Debug Adapter Protocol (DAP), (and specifically nvim-dap combined with nvim-dap-ui) you can transform your Neovim experience into a powerful debugging environment that rivals any modern IDE.

The setup is straightforward:

  1. Install the necessary plugins (nvim-dap, nvim-dap-ui) through your package manager (lazy.nvim makes this particularly easy with dap.core extras)
  2. Set up language-specific adapters (Go, Python, TypeScript, Java, etc.)
  3. Configure your key mappings for a seamless workflow (or let LazyVim decide for you)

Once configured, your debugging workflow becomes dramatically more efficient.

Setting breakpoints is as simple as , toggling the UI is , and continuing execution is . When execution stops at a breakpoint, you get immediate access to:

  • Local variables and scopes
  • Current breakpoints list
  • Threads and stack frames
  • Interactive watch expressions

But the real power comes with conditional breakpoints (), which allow you to set rules like "only stop when variable i equals 7," dramatically reducing debugging time.

You can step into functions with and step out with , giving you complete control over execution flow, and going deep intro resolutions beyond just your own code.

A game changer for multi threading

The thread visualization is particularly valuable when debugging concurrent code.

You can track multiple threads simultaneously, seeing exactly what each one is doing at any given moment—a capability that's absolutely essential when dealing with complex systems.

Printing your way through multi threaded code is nearly impossible and can get extremely frustrating.

Going deeper

For those looking to supercharge their debugging, consider pairing Neovim's DAP capabilities with an AI tool like Augment (there's a generous free tier if you're a solo dev).

Unlike general-purpose AI assistants, Augment is designed specifically to understand your entire codebase, making it an ideal debugging companion for complex systems. Its Vim-first approach means it integrates seamlessly with your Neovim workflow.

I was able to ask where certain bits are in a huge code base, as well as detecting potential bugs in a matter of milliseconds.

Another exiting (and open source!) option is Codetracer, which lets you execute your code, while recording it in the back, then allowing for a replay through code.

This is how you tackle those hard-to-reproduce persistent bugs.

The real power

Lastly, in my opinion, the most powerful feature of all in a debugger is the ability to modify code mid-debug session.

Change a variable's value, and continue execution to see if your fix works—all without restarting the debugging process.

"Sometimes you could fix things even before you did one compile cycle. You'd say, 'Well, I'm just going to change this right here,' and yep, that did the job."
- John Carmack

In a world increasingly dominated by AI-generated code, and the amount of garbage code only seems to pile up, the ability to debug efficiently isn't just about productivity—it's about maintaining control over systems that grow more complex, and fewer engineers know how to handle them, by the day.

With Neovim's debugging tools, you'll be well-equipped to face these challenges head-on!


Thank you for reading.
Feel free to reply directly with any question or feedback.
Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

Redis is Not What You Think It Is. This issue is brought to you by: Securing Vibe Coding: Addressing the Security Challenges of AI-Generated Code As AI coding tools become embedded in daily development, they bring a new wave of productivity, and new security risks. On November 20 @ 11AM EST, Snyk Staff Developer Advocate Sonya Moisset will break down the security implications of vibe coding and share actionable strategies to secure AI-generated code at scale. Attendees can earn 1 CPE credit...

Give me 10 minutes and I'll make you a REGEX expert. This issue is brought to you by: Warp is a fully fledged Agentic Development Environment. From prompt → production “The IDE is dead. The ADE is in”.Coding tasks start with a prompt in Warp, not a heavyweight IDE that takes up 3/4 of your screen with code. Warp is free to try but for a limited time, try Warp Pro free for 7 days with 2,500 Al credits-no card required. Click here to start (It’s Free!) Regex has been around for years -...

You’ve been parsing JSON wrong your whole life This issue is brought to you by: Secure Your AI Future at DevSecCon 2025 Software development is undergoing a seismic shift as AI transforms how we build, deploy, and secure applications. Register for the 1st-ever Global Community Summit on AI Security, covering critical strategies to empower AI innovation without compromising security. Register for DevSecCon 2025 (It’s Free!) Ever opened a massive “.log” file and realized it’s just one long,...