CScope for C and C++

CScope will allow navigation of C files. How to make it work for C++ files?

Generate the list of files needed using ‘find’ command.

find <path> -name '*.h' >> tags.lst

Provide the path where to start, the files are searched recursively. Also provide the file extension like .h or .cpp or .c++. Store the file names in tags.lst

Run using

cscope -i tags.lst


Recently I found that cscope defaults to using vi as its editor. The problem is the lack of syntax highlighting in vi. I’m not sure how to go about changing this, but you can alias vi to vim in your .bashrc file, so that cscope invokes vim, and viola you have syntax highlighting.

alias vi="vim"

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s