In emacs there is a handy way to launch the gdb and gui options for gdb, the C debugger.
Is there a similar option in gvim?
Vim added a built-in debugger officially in version 8.1, released in May 2018. The feature had been present in some of the version 8.0 releases as well, as early as August 2017. The following vim commands load the plugin and start the debugger.
Breakpoints can be set in the gdb window using ordinary gdb commands. Alternatively, breakpoints can be set by navigating to a line of code in the editor window and entering :Break . Lines with breakpoints are indicated by >> in the editor window.
GVim is Vim with a built-in GUI, whereas plain Vim needs a terminal emulator (like GNOME Terminal, for example) to run. The built-in GUI provides several extra features to GVim.
There's a project called cgdb which aims to provide this exact behavior. While it doesn't launch from vim the way emacs does, it provides vim like keybindings and behavior. Its features include a separate syntax highlighted source window which is kept up-to-date with the currently executing instruction.
Have a look at the Vim script search. I see at least 5 plugins that do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With