My Eclipse shortcuts

Eclipse shortcuts

Switching:
ctrl+M (maximize/minimize the window)
ctrl+E recently open tabs
ctrl+O – outline methods/fields
alt+shift+Q,P – switch to package explorer
alt+shift+left/right – collapse/expand projects or packages
ctrl+F7 – switch views (junit, package explorer)
ctrl+F8 – switch perspective (java/debug/synchronization)

Searching:
ctrl+shift+L (search everywhere) – requires additional plugin “Quick search” by Spring

Moving:
ctrl+right/left – move cursor to the previous/next word
ctrl+up/down – move page up/down with stationary cursor
ctrl+pgUp/pgDown – move to the left/right across open tabs
ctrl+home/end – move page and cursor to the top/bottom of the file
ctrl+shift+up/down – move cursor to previous/next method or field
ctrl+shift+P – move to the corresponding bracket

Selecting text:
shift+left/right – select previous/next character
shift+up/down – select lines above/below
shift+ctrl+left/right – select previous/next word
shift+alt+left/right or up/down – select more enclosing statement

Refactoring:
alt+shift+V – move method
alt+shift+L – extract local variable
alt+shift+I – method inline
alt+shift+M – extract method
alt+shift+R – rename
alt+shift+T,G – infer generic type arguments
alt+shift+T,H – use super type where possible (select class name declaration that instances should be replaces with super type)
alt+shift+T,O – introduce static factory method

ctrl+alt+J – join lines
ctrl+shift+M – add static method import instead of class

Generating code:
alt+shift+S(ource) view
ctrl+N(new)
-my own source code bindings (in window)
ctrl+alt+S, C(onstructor generate using fields)
ctrl+alt+S, G(etters/setter generate)
ctrl+alt+S, E(quals/hashcode generate)
ctrl+alt+T, E(toString generate)
-my own new generation bindings:
ctrl+alt+N(ew), C(lass)
ctrl+alt+N(ew), I(interface)
ctrl+alt+N(ew), P(ackage)
ctrl+alt+N(ew), T(est)
ctrl+alt+N(ew), X(ml)
ctrl+alt+N(ew), F(ile)

Duplication:
alt+ctrl+up/down – duplication of line above/below

SVN
– my own SVN bindings (in window)
ctrl+alt+shift+S(ubversion), C(ommit)
ctrl+alt+shift+S(ubversion), A(add to version control)
ctrl+alt+shift+S(ubversion), R(evert)
ctrl+alt+shift+S(ubversion), U(update)
ctrl+alt+shift+S(ubversion), H(update)
ctrl+alt+shift+S(ubversion), L(atest repo compare)
ctrl+alt+shift+S(ubversion), B(base repo compare)

GIT
– my own GIT bindings (in window)
ctrl+alt+shift+G(it), C(ommit)
ctrl+alt+shift+G(it), A(dd to index)
ctrl+alt+shift+G(it), R(eplace with File from index)
ctrl+alt+shift+G(it), I(ndex compare)

Contextual hints:

String name = "Bob";
String message = "Good morning " + name;

highlight ‘”Good morning ” + name’, hit ctrl+1, and choose StringBuilder contatenation or Message format.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s