Monday, May 7, 2012

Replacement for source insight in Linux

Few days back I changed my job. In my last job I used to work on windows machine and used source insight as my default IDE. In my new job I work on Red hat machine so have no "source insight". First few days I spent on google to find a replacement . So I think it's a good idea to share all the information I got....

1) cscope : a nice tool for exploring large codes ... You just need to save all the files in the project to the file "cscope.files" ... To do this run the following command at the to directory of your code base :
"find ./ -name "*.c">cscope.files"
"find ./ -name "*.h">>cscope.files"
....
And similar command for all the file extension you have in your project .

Finally type command "cscope" and you are ready to go ... It will show you options like find C symbol ,global definition ,find string,replace string, ... And a few more .. Although it is not a complete replacement for "source insight" but you get used to it in long run ..

2) Ctags/tags : this option can be used with vim just prepare the tags file and there you go now of you want to jump to definition of any function/variable/constant/structure .. Just keep cursor over the function and press cntrl+t .. Press cntrl+] to return .. If you are using GVIM then its even more simple   . press cntrl+left-click to go to tag press cntrl+right-click to return.

3) use Eclipse ... Although I have not personally used it but have heard that they have a package for Linux also ..

4) finally if you know the code well and do not need frequent searching .. Then you can survive with emacs/vi/vim/gvim. Actually these are one of the best IDE's if you can master them. Learning curve for vim is quite steep and same goes with emacs. All i can say is that these are very powerful tools only in the right hands. There are a loads of stuff you can do with these tools quite easily which you cannot think of doing with other IDE's.


If you are working on Linux and use different IDE for code browsing ..comments are most welcome

3 comments:

  1. Hi, Code Blocks in one of the very good editor for c,c++, it even comes with compiler. Only problem is it is not frequently updated. Eclipse CDT is best alternative to any available editors but it takes lot of resources.

    ReplyDelete
  2. Hi Bharatesh, thanks for your comment. I have not tried Code Blocks yet but now I have been using GVIM for last 1 year and I feel pretty OK with gvim coupled with cscope and ctags. It works great for C/C++ .

    ReplyDelete