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

You've been lied to about self hosting... This issue is brought to you by: Auth0, my auth provider for the last 6 years. Join their free virtual dev_day on June 18th to learn how to secure AI agents and applications. Save your free spot That title might sound a bit aggressive, but this isn't about hating on hosting platforms. It's about loving the freedom, control, and cost-savings that come from owning your deployment process, without giving up the slick, easy experience we all love. And...

How DHH Solved Deploying to Production (with Open Source) Ever felt depressed by the sheer complexity of getting your application live and serving users? You’re not alone. But what if deploying to production, even (or especially) across multiple servers, could be straightforward and more importantly, free? That’s the reality DHH, the creator of Ruby on Rails and CTO of Basecamp & HEY, wanted to create, and he delivered with an open source tool called Kamal. DHH’s approach to technology always...

The UNDERRATED Open Source Powering My HomeLab This issue is brought to you by: Secure Your AI Future at Snyk Launch 2025 Join Snyk Launch to discover how to establish a foundation to build securely and confidently in the age of AI. Register for Snyk Launch 2025 (It’s Free!) Kestra, an open-source automation platform that's been a game-changer for my homelab and, frankly, could be for a lot more. It's one of those tools that flies under the radar for too many people, but packs so much...