48

Is there a list of the default Eclipse keyboard shortcuts? I'm generally looking for language agnostic things like starting the debugger or deleting an entire line in the source editor.

James Cadd
  • 12,136
  • 30
  • 85
  • 134

4 Answers4

95

Rather than a full list of shortcut (JGlass mentions for Eclipse 4.6 this pdf), I prefer using only a few shortcuts:

  • CTRL+Shift+L: "Show Key Assist", List of shortcuts (depending on the context)

http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.user/tips/images/key-assist.png

  • CTRL+3: Quick Access

http://4.bp.blogspot.com/-QqHaeh1yJDU/Tsoc0bZmaSI/AAAAAAAABVg/WzNyqfmRmXE/s1600/Eclipse+Quick+Access+now+shows+keybindings+for+commands.png
Source: "Good features of Eclipse 3.6 (Eclipse Helios) JDT, 2011, from Sony Thomas"

Those two covers almost everything.

You can add two others:

  • CTRL+1: Quick Fix

http://depth-first.s3.amazonaws.com/20080111/list_options.png

http://www.willianmitsuda.com/wp-content/uploads/eclipse_tips/spy_opentype.gif


Note that Eclipse 2019-09 now shows key bindings when command is invoked.

For presentations, screen casts and learning purposes, it is very helpful to show the corresponding key binding when a command is invoked.
When the command is invoked (via a key binding or menu interaction) the key binding, the command's name and description are shown on the screen. Key binding of triggered command shown on screen

https://www.eclipse.org/eclipse/news/4.13/images/show_key_bindings.png

You can activate this in the Preferences dialog via the Show key binding when command is invoked check box on the General > Keys preference page.
To toggle this setting quickly the command 'Toggle Whether to Show Key Binding' can be used (e.g. via the quick access).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Awesome! I didn't know about this one! – cmcculloh Dec 31 '09 at 17:17
  • 1
    At these times, the `Ctrl`+`Shift+`L` shortcuts has the same binding of `Quick text search`, that is a really faster way to search for text. From [here](https://marketplace.eclipse.org/content/quick-search-eclipse): Ctrl+Shift+L shows Quick Search; Ctrl+Shift+L twice shows list of shortcut; Ctrl+Shift+L 3 times shows Preferences > General > Keys – tigerjack Jul 03 '15 at 15:13
  • The link #3 is broken, e.g. http://www.techvj.com/misc/blog_images/eclipse_qaccess/eclipse_qaccess.jpg I tried to find a trace of the image to replace it but cannot. Also tried to edit the article to too many linked non https images (now a requirement) however I did find this nifty list [eclipse-shortcuts-4.6.0.pdf](https://github.com/pellaton/eclipse-cheatsheet/raw/master/eclipse4.6/eclipse-shortcuts-4.6.0.pdf) – JGlass Jun 07 '17 at 19:35
  • 1
    @JGlass Thank you. I have replaced the image by a new one, and included your link in the answer for more visibility. – VonC Jun 07 '17 at 21:16
25

As VonC said you can get alist of short cuts with the following command.

Ctrl + Shift + L "Show Key Assist", List of shortcuts (depending on the context)

SHORTCUTS FOR DEVELOPMENT

But here are some which you will use often during your development.

Ctrl + Shift + P Switch between openning and closing braces.

Ctrl + Shift + R Open any file quickly without browsing for it in the Package Explorer. This shortcut opens a dialog box that accepts the name of the file you’re looking for.

Ctrl + Shift + T Open a type (e.g.: a class, an interface) without clicking through interminable list of packages. If what you want is a Java type, this shortcut will do the trick.

Ctrl + O Go directly to a member (method, variable) of a class file, especially when there are a lot of methods.

Ctrl + Shift + F Format code.

Ctrl + Shift + / Comment out XML or JSP code.

Ctrl + L Go to line number N in the source file.

Ctrl + E Show a list of open editors.

Ctrl + F6 Move between open editors.

Ctrl + 1 Quick Fix.

Ctrl + 3 Quick Access.

Ctrl + Q Go to the last edit location.

Ctrl + T Go to a supertype/subtype.

Ctrl + I Indent selected code block.

Ctrl + + Move to one problem (i.e.: error, warning) to the next (or previous) in a file.

F3 Go to a type declaration.Alternatively, you can hold Ctrl down and click (ie: Ctrl + Click) the hyperlinked variable.

SHORTCUTS FOR VARIABLE GENERATION

Ctrl + 2 + L Generate return value type and variable assignment

Alt + Shift + L Generate return value type and variable assignment. but here you can make selections.

SHORTCUTS FOR DEBUGGING

F8 Resume

CTRL + F8 Resume.

F5 Step Into

F6 Step Over

F7 Step Return

CTRL R Run to Line.

F11 R Debug

CTRL + SHIFT + B Toogle Break Point

You can find further shortcuts under : Help → Help Contents → Java Development User Guide → Reference → Menus and Actions

Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
Koray Güclü
  • 2,857
  • 1
  • 34
  • 30
1

Previous answer not quite correct as in Eclipse you can redefine keyword shortcuts (as I often do).

You can always access current list of defined shortcuts by pressing Ctrl + Shift + L in Eclipse (on Windows at least).

Jasper
  • 2,166
  • 4
  • 30
  • 50
maximdim
  • 8,041
  • 3
  • 33
  • 48
1

The full list of defaults in Eclipse 4.6 and earlier versions can be obtained from this GIT Hub page: https://github.com/pellaton/eclipse-cheatsheet specifically https://github.com/pellaton/eclipse-cheatsheet/raw/master/eclipse4.6/eclipse-shortcuts-4.6.0.pdf

JGlass
  • 1,427
  • 2
  • 12
  • 26