Vim + cgdb

Posted on In Linux, Programming

I begin to use vim for programming. I like the tools that focus on one function. I used to use emacs. But I think I like vim more.

For debugging, I use gdb. But I use the front end cgdb. I can see the codes with the cursor when debugging. I can use F8 for next instead of n + enter. And F10 for step instead of s + enter. i is the key for enter gdb command mode. And ESC can change the user to command mode. But ESC is too far away from my finger, so I prefer “Ctrl + [” to ESC ;)

My configuration files can be found here if they are useful for someone:

In the config file of cgdb:
“set winsplit=top_big: is for letting the code window bigger than the gdb command windows, which is convenient for debugging.

A list of useful cgdb shortcuts:

     Send a run command to GDB.
     Send a continue command to GDB.
     Send a finish command to GDB.
     Send a next command to GDB.
     Send a step command to GDB.
     Sets a breakpoint at the current line number.
     Sets a temporary breakpoint at the current line number.
     Puts the user into "GDB mode".
     Puts the user into "TTY mode".

These short cuts is available in cgdb 0.6.5.

Updated on Apr. 2 2010. Short cuts are added.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *