Question

I've recently started using Eclipse Ganymede CDT for C development and I couldn't like it more. I'm aware the learning curve could be sort of pronounced, therefore and with your help, my goal is to flatten it as much as possible. I'm looking for the best hacks, hints, tips, tricks, and best practices to really unleash the full power of the IDE.

Was it helpful?

Solution

Accurate Indexing

With CDT you should be sure to enable the "Full Indexing" option rather than the "Fast Indexing" default. It's not perceptibly slower on modern hardware and it does a much better job. In that vein, you should be sure to enable semantic highlighting. This isn't as important in C/C++ as it is in a language like Scala, but it's still extremely useful.

Streamlined Editing

Get used to using Ctrl+O and Ctrl+Alt+H. The former pops up an incrementally searchable outline view, while the latter opens the "Call Hierarchy" view and searches on the currently selected function. This is incredibly useful for tracing execution.

Ctrl+Shift+T (Open Type) isn't exactly an "editing" combo per se, but it is equally important in my workflow. The C++ Open Type dialog not only allows incremental filtering by type, but also selecting of definition (.h) or declaration (.cpp) and even filtering by element type (typedef, struct, class, etc).

Task Oriented Programming

Mylyn: never leave home without it. I just can't say enough about this tool. Every time I'm forced to do without it I find myself having to re-learn how to deal with all of the code noise. Very, very handy to have.

Stripped Down Views

The default Eclipse workspace layout is extremely inefficient both in space and in usability. Everyone has their favorite layout, take some time and find yours. I like to minimize (not necessarily close) everything except for Outline and keep the C/C++ Project Explorer docked in the sidebar configured to precisely hide the Outline when expanded. In this way I can always keep the editor visible while simultaneously reducing the space used by views irrelevant to the current task.

OTHER TIPS

CTRL + TAB let you navigate quickly between a source file and it's header file (foo.cpp <--> foo.h).

I like also the local history feature because you can go back and revert your changes in a convenient way.

ctrl + space is the best tool ever in Eclipse. It is the auto-complete feature. It can complete variable names, method declarations, user defined templates, and a ton more.

Go Eclipse. Tons of my code is generated by ctrl + space.

If the Java Developer Tools aren't installed the Spellcheck won't work.

The Spellcheck functionality is dependent upon the Java Development Tools being installed. This can be a perplexing issue if you just install the C Development Tools exclusively, because it gives no reason for the Spell Checker not working.

You can run the CDT based spellchecker (works in Galileo as well).

See here: Eclipse spelling engine does not exist

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top