File Search always requires mouseclicks. To open the Search window and select the correct tab. It was not until recently that I realized that I could actually reassign the ^H (Control – H) key combination to pop up the File Search tab. If you are an avid Eclipse user you’ve probably already done this, or know how to do this. If you are new to eclipse, or lazy like me, read on to see how you can re-map this key binding.
To remap ^H to “File Search”, do the following:
Open Eclipse preferences and go to “General -> keys”. You should see the following settings screen:
- In the filter text, type “file search”. The command list should now contain only one entry, “File Search”.
- Highlight the “File Search” command
- Click in the “Binding” field and press ^H. You should now see that you’ve created a conflict with the “Open Search Dialog” in the “conflicts” list on the right.
- Select the conflict you want to remove, and empty the key binding field.
- Press the “Ok” button to close the preferences screen.
Now you’re all done. When you’re in an editor and want to see if selected text is present in other parts of your project
Let’s say you are looking at Java source of an Ibatis SqlMapClient and want to find the matching statement in any of the the SqlMap.xml files. You can now simply select the text in the Java file, hit ^H, Enter, and voila, you get a list of all files with that same text in it, anywhere in your enclosing project or workspace, without copy-pasting or even touching the mouse.
Now go play with your new found piece of heaven.