Wednesday, August 10, 2011

Very useful eclipse shortcuts which I generally use to make my coding fast


It’s always fast if you use keyboard as much as possible. I use many keyboard shortcuts while using eclipse and which makes me quick. Believe me these are really useful. The global shortcuts (Ctrl + F,     Ctrl + C, Ctrl + X, Ctrl + Y, Ctrl + V) everybody is aware of, so I am not explaining those in the list.
1. Ctrl + O – to see methods in a class (you can also use Ctrl + F3)
2. Ctrl + Shift + R – to see resources in your workspace (you can also type only the CAPITAL letters of your camel-case file name)
3. Ctrl + Shift + T – to see types (search only the java files, it also searches in jar files), this shortcut works only in Java/J2EE perspectives
4. Alt + left arrow – to go to previous place you were working.
5. Ctrl + D – to delete a line which causes the next line to move up to fill up the space
6. Alt + Up Arrow – to move a line up without cut-paste, it just crosses the line coming in between
7. Alt + Down Arrow – to move a line down without cut-paste, it just crosses the line coming in between
8. Ctrl + Shift + W – to close all the opened editors.
9. Ctrl + Shift + F6 – to switch between opened editor
10. Ctrl + M – to minimize/maximize a window.
11. Ctrl + Shift + F – formats the selected code otherwise formats the whole class.
12. F3 – to go to the declaration of the method.
13. Ctrl + Shift + Numpad_Divide – Collapse/Un-Collapse all the code and also the opened modules in the explorer
14. Alt + Shift + Q + Q (press Q twice) - to open a view
15. Alt + Shift + X – to run
16. Ctrl + Shift + G – to search references in workspace
17. Ctrl + Shift + K – to see where else a text is being used in the class
18. Ctrl + Space – code assist
19. Ctrl + T – to search for type (implementation in case of interface)
20. Ctrl + Shift + X – make all selected letters in CAPS
21. Ctrl + Shift + Y – make all selected letters in small case.
22. Ctrl + Numpad_Substract – Collapse
23. Ctrl + H – Search
24. Ctrl + Shift + U – search a text in a file (it’s like Ctrl + F showing all the results together)
25. Ctrl + G - declaration in workspace (it’s like google the workspace :) )
26. Alt + Shift + R – to rename all the occurrences of variable/class being renamed.
27. F12 – Activate editor. Suppose you are having a look at console just press F12 and you will reach the editor you were working on.
28. Ctrl + Alt + H – open call hierarchy
29. Ctrl + O + O (press O twice) – to see inherited members
30. Ctrl + Shift + O – Organize imports
31. F4 – open type hierarchy.
32. Ctrl + Shift + G – find text in workspace
33. Alt + Shift + M – extract method
34. Alt + Shift + L – extract local variable
35. Ctrl + B – build all
36. Ctrl + K – to see the next occurrence of the same text in the file. it depends on the settings in the Ctrl + F window. If you have selected wrap search in the FIND window then Ctrl + K will also do wrap search.
37. Ctrl + / – Comment/Uncomment the code
38. Ctrl + Q – go to last edited location
39. Ctrl + Alt + down arrow – copy a line a paste in the next line.
40. Alt + / – word completion
41. Ctrl + Shift + L – last but not the least, this shortcut will open all the shortcuts list you can use in eclipse. You can always open this when you are not that busy and have a look, you may find a shortcut which can actually help in your coding.