Shortcuts in Eclipse

This time I write in English, I was probably influenced too much by the last book, I have worked with.

In Eclipse there are many useful shortcut which can help you to speed up your coding. In this article I want to show you a small selection of the shortcuts I use in practice (especially coding java). Do not worry if you memorize them all. At least you should remember the shortcut that shows you a list of all shortcuts, so you can pick the one you wanted to use by yourself.

Root Shortcut ;)
STRG + SHIFT + L … shows a list of all shortcuts, press twice to open the preferences where to define them

Handling Eclipse
STRG + S … saves the actual file (don’t forget about it, saves the file and the time of restoring lost changes)

STRG + Z … undo last change
STRG + Y … redo last change

STRG + F … opens find popup (open file)
STRG + H … opens search popup (workspace or projects)

STRG + Q … mark last edit location
STRG + SHIFT + I … inspect where the var is used in the file
STRG + SHIFT + Q … show quickdiff at the left of the editor (red marked linenumbers where changed since the last save)

STRG + O … shows an outline to navigate quick within the class

STRG + M … maximize active view

STRG + 3 … quickly access a view or a file, you have to spezify the name of it after pressing the shortcut

Start Application
ALT + SHIFT + X, J … run Java Application
ALT + SHIFT + X, T … run JUnit Test
ALT + SHIFT + X, Q … run Ant Build

ALT + SHIFT + D, J … debug Java Application
ALT + SHIFT + D, T … debug JUnit Test
ALT + SHIFT + D, Q … debug Ant Build

Code manipulation
STRG + SPACE … code completion

STRG + 1 … shows the quick fix dialog, where you can choose a solution for the given situation (errorhandling, renameing of a variable, …)

STRG + 2, L … assign to local variable, e.g. if you call a method you don’t need to create the var for the returning by your own, let eclipse do that for you (but be aware, the var name will be choosen automaticly, charAt() -> char charAt, getVariableName -> Object variableName)
STRG + 2, F … assign to field
STRG + 2, R … rename in file

ALT + SHIFT + R … rename – refactoring
ALT + SHIFT + M … Extract Method
ALT + SHIFT + L … Extract Local Variable

STRG + SHIFT + Y … to lowercase
STRG + SHIFT + X … to uppercase

STRG + SHIFT + O … organize imports (will remove unused imports and add needed imports)

STRG + SHIFT + F … format code
STRG + D … delete selected lines
STRG + DEL … delete next word
STRG + SHIFT + DEL … deletes all chars to the end of the line

STRG + SHIFT + ENTER … insert empty line before current line
SHIFT + ENTER … insert empty line after current line

STRG + SHIFT + C or STRG + SHIFT + / … make a comment

… move lines up
ALT + DOWNARROW … move lines down

STRG + ALT + UPARROW … copy the marked lines and insert them before the selection
STRG + ALT + DOWNARROW … copy the marked lines and insert them after the selection

Have fun!

Ähnliche Artikel:

Autor: Thomas Pummer

Thomas Pummer ist Softwareentwickler an der Universität Wien. In seiner Freizeit betreut er das Open Source Projekt TrayRSS und werkt an diversen anderen kleinen Projekten. Er ist sehr interessiert an Open Source und Webentwicklung und testet gern neue Programmiersprachen.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.