Most useful shortcut in Eclipse CDT

I would like to make a cheat sheet presenting the most useful (and time saving) shortcut for Eclipse CDT (C ++).

Can you share the most useful shortcuts you use in the CDT?

Please post only general shortcuts (available when running C ++) or CDT.

+78
c ++ eclipse eclipse-cdt keyboard-shortcuts
Aug 12 '09 at 15:17
source share
22 answers

Ctrl + Tab : Switch between source and header files.

+61
Aug 12 '09 at 15:22
source share

A summary of all the shortcuts in this thread and some others.

Ctrl + Tab - Switch between source and header files.

Ctrl + Shift + T - Open item

Ctrl + Shift + R - Open file / resource.

Ctrl + = - Examine the macro extension.

Ctrl + Space - Show the sentences you wrote.

Ctrl + Alt + H - opens the call hierarchy for the function

Ctrl + Shift + N - Adds #include for the header file in which the current element is declared

Ctrl + i - corrects the indent of the selected text - very useful, in my opinion,

Ctrl + d - Deletes the current line

Ctrl + H - opens the search dialog; C / C ++ Search tab searches indexed locations

Ctrl + O - Opens a member browser of the current class, allowing you to quickly open the method

F3 - Open Ad

Ctrl + Shift + G - When a function, object or var is selected: find all occurrences in the project.

Ctrl + Alt + G - Text search for the selected text.

Ctrl + left click - go to the element definition.

Ctrl + j - Incremental search in the current file

Ctrl + k - search forward the selected text in the file.

Ctrl + Shift + k - search back for selected text in a file

Alt + ← / β†’ - Go to the previous / go to the next edited or viewed place.

Ctrl + m - Maximum or unlimited current editor window (also works for other Windows

Ctrl + Shift + Up / Down arrow - go to the previous / go to the next method

Ctrl + q - edited transition to the last location

Ctrl + Shift + p - with the bracket selected: go to the corresponding closing or opening bracket

Ctrl + / - Comment / uncomment all selected lines using //

Ctrl + Shift + / - comment of the selected block with / * ... * /

Ctrl + Shift + \ - Uncomment / * ... * / selected block

+47
Jul 20 '14 at 12:17
source share

Ctrl + Shift + T : Open an item.

Ctrl + Shift + R : open file / resource.

Ctrl + = : Examine the macro extension.

+43
Feb 03 '10 at 18:26
source share

Ctrl + Space : Show the sentences you wrote.

+23
Aug 12 '09 at 18:48
source share

Ctrl + Shift + L : displays a list of actions with corresponding shortcuts .;)

+22
Jul 26 2018-12-12T00:
source share

Ctrl + Alt + H : opens the call hierarchy for the function

+18
Jun 25 '12 at 7:24
source share

Alt + Shift + R , N : rename a function or variable throughout the project.

+15
Aug 17 '09 at 13:43
source share

Here is a list of the ones I use most often (excluding those from previous answers):

  • Ctrl + Shift + N - adds an include statement; The included header file is the one in which the current item is declared in

  • Ctrl + i - corrects the indentation of the selected text - very useful, in my opinion,

  • Ctrl + d - delete the current line

  • Alt + ↑ / ↓ - moves the selected text (or the current line if no text is selected) up or down

  • Alt + ← / β†’ - go to the previous / next place that you edited; for example, if you are viewing multiple function declarations and then want to return to where you started, press Alt + ← to go to previous locations.

  • Ctrl + h - opens the search dialog box; the C / C ++ Search tab searches indexed locations and is fast, but the File Search tab looks through all the text in your projects and can come in handy when you are looking for a β€œhidden” element (for example, when searching for a macro defined in #ifdef _WINDOWS, but _WINDOWS is not currently defined in your project)

+14
Jul 31 '13 at 17:09
source share

Ctrl + O : opens a member browser of the current class, which allows you to quickly open the method.

+5
Oct 05 2018-11-11T00:
source share

CTRL + B : create all projects

CTRL + F11 : execute

F11 : Debugging

Note. The above shortcuts apply to the whole version of eclipse




Manual links from Preferences> General> Keys

ALT + B : Build Project (current active project)

+5
Sep 06 '15 at 19:13
source share

You need to change the default bindings to get them, but I like:

F3 : Open announcement.

F4 : Find the text in the project.

F4 is self-explanatory, but F3 has some subtleties: if you use it in a function call, it will lead you to a definition, and if you use it in a definition, it will lead you to a declaration.

+3
Aug 23 '09 at 1:42
source share

Ctrl + Shift + G : When a function, object or var: is selected, find all occurrences in the project (works also with java).

Ctrl + Alt + G : Text search for the selected text.

Ctrl + left click: go to the element definition.

+3
Mar 28 '11 at 13:20
source share

Ctrl + Page Up : go to the next source file opened as a tab

Ctrl + Page Down : go to the previous file

+3
Jul 6 '16 at 9:32
source share

Ctrl + j : incremental search in current file

Ctrl + / (numeric keypad): outline - resets all functions - for quick viewing

+2
Feb 05 '13 at
source share

Ctrl + Shift + f : this auto-indent code

+2
Apr 16 '14 at 5:43
source share

Ctrl + Shift + { opens a parallel editor for the same source file.

+2
Aug 30 '15 at 21:25
source share

Ctrl + k : search forward for selected text in a file.

Ctrl + Shift + k : search back for selected text in a file

+1
11 Sep
source share

Alt + Shift + T : Selected Method: Switch between inline, out of class in .h and out of class in .cpp

+1
Jan 12 '17 at 12:42 on
source share

In the closest way, I get Eclipse for J2EE when creating classes, this is (re) map ( Preferences-> General-> Keys ) "New (Class)" to Ctrl + 1 and selecting nonexistent class text to populate the new class dialog with the class name .

Unfortunately, you still have to enter the names of the source file and the title in the dialog box.

0
Jan 04 '16 at 23:59
source share

For me, this is one of the most useful keyboard shortcuts, especially in debug mode :

Alt + ← / β†’ - Go to the previous / next cursor position.

0
Feb 06 '18 at 8:00
source share

Alt + Shift + ↑ : select a block.

0
Jul 20 '18 at 19:06
source share

Shift + Alt + G : generate getters and setters (link them)

Alt + Ctrl + ↑ : duplicate row (s)

Ctrl + Shift + / : fold everything

Ctrl + * : expand all

Ctrl + / : enable / disable folding

0
02 Sep '19 at 16:31
source share



All Articles