Eclipse Shortcuts

Eclipse Shortcuts

Normally shortcuts are used to reduce time of any activity. There are lot of shortcuts for the Eclipse IDE which are not generally aware to the developer.

Below we are listing important shortcuts for Eclipse EDE. Eclipse IDE provides lot of short cut. There is a master shotcut which opens a dialog box. Any command can be typed in that and it helps to get all the detail realted to the keyword typed.

The master shortcut is CTRL + 3

Eclipse provides keyboard shortcuts for the most common actions. Using shortcuts is usually preferable as you can perform actions much faster. For eg; Here on typing CTL+3 , it opened up the dialog box and further typing ‘ui’ in the dialog box, it listed all the possible commands, menus ,preference, perspectives etc. Here wildcard search is also possible and it returns all possible output.

Eclipse Shotcuts
Eclipse Shortcuts

The below listed shortcuts can be used while doing coding in Eclipse IDE.

  • Shift + F2 – Show the Javadoc for the selected type / class / method
  • Alt+Shift + N + Letter – Type shortcut for the command, e.g. ALT + SHIFT +n+t to create new Task or ALT + SHIFT +n+s to create a new Source Folder
  • Alt + Shift + Z – Surround block with try and catch
  • ALT + SHIFT + R – Rename
  • CTRL+2, R – Rename locally (in file), faster then ALT + SHIFT + R
  • ALT + SHIFT + T – Opens the quick re-factoring menu

The below listed shortcuts help you in navigation in Eclipse.

  • CTRL + SHIFT + R – Open / Search for resources, e.g. files
  • CTRL + SHIFT + T – Open / Search for Types
  • CTRL + E – Allows to select an editor from the currently open editors
  • CTRL + F8 – Shortcut for switching perspectives
  • ALT + ← or ALT + → – Go to previous/ next editor position in history
  • Ctrl-PageUp/PageDown – Switch to previous/next editor
  • F3– Go to the declaration of this variable
  • CTRL + SHIFT + P – Go to the matching bracket

The below listed shortcuts helps in performing Search operation in Eclipse IDE.

  • Ctrl + . – Go to the next problem / error
  • Ctrl + , – Go to the previous problem / error
  • F4 on a variable – Show type hierarchy
  • CTRL + J,CTRL + K – Incremental search, find next
  • CTRL + SHIFT + G – Search for references in the workspace

The below listed shortcuts helps to Run programs in Eclipse IDE.

  • Ctrl + F11 – Run last launched
  • Alt + Shift + X – J – Run current selected class as Java application

The below listed shortcuts helps in handling the Editor of Eclipse IDE.

  • CTRL + 1 – Quickfix; result depending on cursor position
  • CTRL + Space -Content assist/ code completion
  • CTRL + T – Show the inheritance tree of the current Java class
  • CTRL + O – Show all methods of the current class, press CTRL + O again to show the inherited methods.
  • F12 – Focuses on the editor (especially helpful if you work with Fast Views).
  • Ctrl + M – Maximize Java editor
  • CTRL + Shift + F – Format source code
  • CTRL + Shift + O – Organize the imports; will import the missing import statements.
  • CTRL + Q – Go to position the cursor at the last changed position in the editor.

The below listed shortcuts using Arrow keys help to perform the listed operations in Eclipse IDE.

  • CTRL + Left – Move one element to the left
  • CTRL + Right – Move one element to the right
  • CTRL + ALT + Up/Down – Copy line
  • ALT + Up / Down – Move line up / down
  • ALT + SHIFT Up / Down – Select the previous / next syntactical element
  • ALT + SHIFT Up / Down / Left / Right – Extending / Reducing the selection of the previous / next syntactical element
  • CTRL + Up / Down – Scroll up / down a line in the editor

The below listed shortcuts using the listed keys help to perform various delete operations in Eclipse IDE.

  • Ctrl + D – Deletes line
  • CTRL + SHIFT + DEL – Delete until end of line
  • CTRL + DEL – Delete next element
  • CTRL + BACKSPACE – Delete previous element

The below listed shortcuts helps to do the variable assignment.

  • Ctrl + 2 + L – Assign statement to new local variable
  • Ctrl + 2 + F – Assign statement to new field

The below listed shortcuts helps to perform refactoring.

  • Shift + F2 – Show the Javadoc for the selected type / class / method
  • Alt + Shift + Z – Surround block with try and catch