Cscope for TextMate

Cscope is a very handful tool for inspecting large C projects which you’re approaching. It builds a database and then makes searching for different things very fast.

TextMate is my usual programming editor on MacOSX and it enables bundles integration.

cscope.bundle is a small bundle I’m writing that enables you to use Cscope functionality within TextMate.

Hopefully you will find it really useful and will be able to use it to help with online degrees or whatever you may be doing. I’ve been using it for C-projects and it has been of great help especially throughout University years when you may be dealing with a lot of code not written by yourself.

The project is currently hosted over at github where you can follow it’s development, join the development or just download it. You can of course also download the bundle from the bottom of this pace.

At its current stage all the cscope commands are integrated into the bundle except for one (please see later):

  • Build
  • Find the C symbol – Ctrl-C
  • Find the global definition – Ctrl-G
  • Find functions called by the function – Ctrl-D
  • Find functions calling the function – Ctrl-L
  • Find this text string – Ctrl-T
  • Find this egrep pattern – Ctrl-E
  • Find this file – Ctrl-F
  • Find files #including the file – Ctrl-I

The output of Cscope is then printed in a typical floating TextMate menu with handy shortcuts to the files/line.

Example of cscope output from Terminal to TextMate Bundle

Example of cscope output from Terminal to TextMate Bundle

The main idea for the bundle came from this post. I moved the language from Perl to Python (which I find myself more comfortable in using) and added a lot more functionality that was missing in the older bundle.

All the commands I’ve been personally using are present in the bundle, except for the “Change this text string:” one. If you’re really interested in it please let me know and I’ll think of a way to include it.

For any comments don’t hesitate to contact me, to download click the big image just below!

Cscope Bundle Download