Eclipse C++: How do you quickly switch between header and implementation files?

Viewed 18741

How do you switch between header (.h) and implementation files (.cpp) in Eclipse when using the C++/CDT environment with a keyboard shortcut?

In XCode you can quickly switch between headers and implementation with applekey option and up/down arrow keys. I was hoping that eclipse had something similar, but I haven't found it yet.

5 Answers

Ctrl + Tab is the default shortcut and here is a list of some of the more useful shortcut keys in Eclipse.

F3 to jump between declarations and definitions of specific methods

This is another good one to know in this context:

  • double click on the method name with the mouse, selecting it
  • hit F3 (shortcut for Right Click > Open Declaration)

This takes you from the declaration (.hpp) to definition (.cpp) and vice versa depending on which one you are currently in, which is useful if you want to go to the other file to see a specific method when the file is large.

Tested in Eclipse CDT 2019-09.

Related