Daniel Steinberg has a concise blog post on GDB integration in VIM. Here’s a condensed version:
:packadd termdebug
:Termdebug [path/to/executable]
:Break
on the desired line in vim (:Clear
to remove):Run [args]
to start the program:Step
, :Over
,:Finish
,:Continue
,:Stop
, … to go through the execution. There are even clickable buttons on the top of the window.K
to show as message)Not related to vim: set print pretty on
makes printing more readable (but less compact).