Saturday, August 16, 2008

Productive keyboard shortcuts for Eclipse Editors

I've seen very few developers using true power of Eclipse editors, so I thought of listing few very handy shortcuts that can significantly improve your source editing and navigation speed with Eclipse.

1. Ctrl + J / Ctrl + Shift + J : Inline search, meaning you can type on the fly to search text in current editor. You can use Up/Down arrow keys to navigate between matching text fragment in forward/reverse direction. This is one of the most powerful features you will find in advanced editors like Vim or Emacs.

2. Ctrl + K/ Ctrl + Shift + K : Search text in forward or reverse direction.

3. Ctrl + L : Go to line.

4. Ctrl + Alt + Up/Down : Duplicate current line above/below. Very useful in repeatative assignment statements (Java code, eh?).

5. Alt + Up/Down : Move current line up or down. Also, very handy to select current line.

6. Ctrl + . OR , : This is contextual and may be specific to Java editors: if you have error or warnings in current file in editor it will navigate to them.

All of these except for no. 6 are generic text editor features which are inherited by all eclipse text editors. You will realize that you will work much faster than average user if you start using these key bindings.


Carlus Henry said...

7. Ctrl + 3: Search the entire indexed Eclipse Platform for just about everything.

Litrik De Roy said...

I didn't know about Ctrl+J. Looks really handy. Thanks!

Pan Zupa said...

start with ctrl + shift + L
it displays all available (in context) shortcuts

Nirav Thaker said...

Yeah those are good enough Eclipse shortcuts but not specific to Editors. Thanks for comments though!

venkat said...

Some more essential shortcuts...

1. Ctrl + F8 - Switch Perspectives
2. Ctrl + F7 - Switch Views
3. Ctrl + F6 - Switch Editors

Note the sequence F8, F7, F6...that should be easy to remember depending on the decreasing granularity.


javarevisited said...

here is my list of useful eclipse shortcut I would rather say very useful and practical eclipse shortcut :)

Javin Paul
FIX Protocol tutorial