Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ctags is just as accurate at scanning C declarations as an IDE, and with a bit of vim magic, it even auto-updates when you save files.

One thing to realize is that vim IS an IDE of sorts. Only, it's far more extensible for the same effort. (although, from my brief forays with emacs, emacs certainly beats vim for extensibility)



Emacs also supports ctags. I didn't find it very useful with C++ though, which is my usual language, since it didn't autocomplete member functions - I think it's supposed to work, though I couldn't be pushed to tweak it.

Cscope, as commented on the article's website, sounds quite interesting too.


ctags on C++:

ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .


ctags takes an environment variable for it's options, too:

    export CTAGS='-R --c++-kinds=+p --fields=+iaS --extra=+q'
and then you can just run 'ctags .'


What about conditionally compiled code, based on preprocessor definitions? And what happens when you change one of those definitions in the editor? Visual Studio, for example, will re-scan the source in the background.

And what about tokens created using the token pasting operator ## from include files that are included multiple times (e.g. code generation hackery)? Visual Studio will at least locate the include file which introduced the token, and of course will be able to complete on the token, aware of its type etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: