Friday, May 25, 2012

Some more eclipse shortcuts!

There are some more cool short cuts I wanted to share after my friend Nikhil asked me to post more.
So here it goes...

1. Ctrl+ Shift +L (List shortcuts) : This opens a small window on the right hand bottom corner which lists all the keyboard shortcuts in alphabetical order.

2. Alt + Left  (Previous file) : When you want to come back to the previous file you were editing Alt+Left  will take you there. Extremely helpful when you want to view some file and get back to editing or view the previous files you've visited. Similarly Alt + Right does the opposite.

3. Ctrl + H (Search) : Actually I think it should be named "POWER Search". Let's take an example to see it power. You know "name.label" occurs in a .properties file but there are 100s of them in the project. Simple... Press Ctrl+H, click on "File Search" tab, then in Containing Text  fill up "name.label", in File name patterns, fill up "*.properties", then click on Search and let it rip.....The search results tab will show all the .properties files that  contain the string.
   There is a much more powerful feature that I must tell you. Place the cursor on any method and press Ctrl+H, then check what's there in the search window. Done? It would have opened the Java Search tab and filled up the entire method signature in the text field. The other options in that tab pretty useful if you want to narrow down your search.

4. F2 (View Javadoc): If you have observed, when you hover the mouse pointer over a java element is displays its javadoc in a small popup, but vanishes when focus is removed. If you want to scroll down the entire list and take a look at the javadoc with your own sweet time, press F2. This comes extremely handy when you are using a java built in method whose behaviour is unclear.

5.  F11(Debug) : The name says it all.Instead of clicking the green bug on the top left, just press F11.

6. Ctrl + F11(Run) : Again the name explains itself. It runs the current file, if it doesn't know how to run it, it'll ask you how to run.

7. Ctrl + K (Find next): Want to check where the method , say , "getMeSomeDrinks" is called next in the current file? Select the text "getMeSomeDrinks" then press Ctrl+K.

8. Ctrl + Shift +K (Find Previous): Same use as before, but finds the previous occurrence in the editing text.


Also please go through, Top 10 Eclipse Shortcuts With Screen Shots!

No comments:

Post a Comment