3 ms·
Not within Vim, but I'd recommend running "gdb --tui" in your terminal (not inside Vim), and then flipping it into "vi mode": https://sourceware.org/gdb/onlined
by alexhutcheson 7y ago
Not within Vim, but I'd recommend running "gdb --tui" in your terminal (not inside Vim), and then flipping it into "vi mode": https://sourceware.org/gdb/onlinedocs/gdb/Readline-vi-Mode.html#Readline-vi-Mode https://sourceware.org/gdb/onlinedocs/gdb/Readline-vi-Mode.h...
- alexhutcheson 7y agoAlternatively, running "M-x gdb"[1] within Emacs configured with Evil[1] for Vim keybindings[2]. Running a separate program is a pain, and it won't have config from your .vimrc, but the tight integration between GDB and Emacs is really nice. [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/GDB-Graphical-Interface.html#GDB-Graphical-Interface https://www.gnu.org/software/emacs/manual/html_node/emacs/GD... [2] https://github.com/emacs-evil/evil https://github.com/emacs-evil/evil
- godelski 7y agoI use tui (well I just hit `<C-x>a`) but there's more I want, like color (because we aren't living in 1970!). Maybe this vi more does the other part I want, which is code exploration and allow me to select lines for break points instead of typing as much. But I'm not sure what `M-C-j` is (I'm sure this is a dumb question). Both of these things are pretty standard in modern gui debuggers. The other thing I kinda want but isn't necessary is my display variables to be in a different pane and to have a nerdtree like file structure. Frankly a lot of times I know where I need to investigate my in my code. But it is annoying to switch to vim, find the file and line number, go back to gdb then do `b my/file/structure/is/long:1825`. That gets hectic in large projects. edit: My current setup I used vim+zsh+tmux. So I don't mind having gdb in a new pane that isn't a vim pane, but I just want colors and some of the basic features. I don't need everything that the IDEs do, just the basics.
- clktmr 7y agogdb has colored output since v8.3, including syntax hightlighting. Regarding vim, have you tried the termdebug plugin that ships with vim? :help termdebug-starting
- alexhutcheson 7y ago> But I'm not sure what `M-C-j` is Meta-Control-j Basically hold down the 'Alt' and 'Control' keys and then press 'j'. If you don't want to have to toggle it every time you launch gdb, then you can create a ~/.inputrc file with the following contents: $if gdb set editing-mode vi $endif If you want vi bindings in every program that uses GNU Readline (Bash, etc.), then you can leave off the $if/$endif part. For colors - GDB 8.3 added source code syntax highlighting, but it was just released this year and may not be the version on your Linux distribution.