How do I hotkey directly to File Search tab in Eclipse - eclipse

When I use CTRL+H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible?
See image here for what I'm talking about:

You can just define a key binding that opens the file search:
Go to Preferences > General > Keys
Type "file search" in the search box. (If there are no results, and you have a really old Eclipse version, select the Include Unbound Commands check box.)
Put the caret into the Binding text box and press the key combination you want to use:
You can either re-use the CTRL+H binding (delete the other binding in that case) or define another one (e.g. CTRL+SHIFT+H). To delete the other binding search for "Open Search Dialog" and click on Unbind Command.
Other solution: You could press CTRL+3 in your editor, type in "file s", press Enter. The next time you press CTRL+3 "File Search" is at the top.

Another option is to open the search dialog (Ctrl+H) then click customize and hide java and task search tabs, next time you do Ctrl+H, file search will be the only one showing, thus it will be selected by default

I actually think the best (and easiest way) is to simply open the search dialog (ctrl + h), hit customize, and then select the checkbox for "Remember last page used." Then tab over to the File Search once. So long as that is the last search tab you used, it will always open there. The advantage to this is that you don't lose easy access to the other tabs, should you actually need them! (working in Eclipse Kepler).

I learnt to use a "pseudo-hotkey" ALT+A F (works also as ALT+A ALT+F), which resolves to: "Menu Se[a]rch → [F]ile..." and has the advantage of being always present, without need for reconfiguration.

I've run into this problem before, too.
I tried following the advice in the question response given by #Martin to rebind Ctrl+H to "File Search" in Window | Preferences | General | Keys, but for some reason, I don't have a "File Search" entry in the Command column. (I'm running Eclipse 3.3 currently; maybe the "File Search" entry was added in a subsequent release?)
Update: As Martin pointed out in a comment on this answer, I didn't have the "Include unbound commands" checkbox checked in the Preferences | Keys dialog, which is why "File Search" wasn't showing up for me. I now have Ctrl+H bound to "File Search", as Martin suggested in his answer on this page, and it works great. Thanks Martin!
I ended up working around the original problem by bringing up the Search dialog with Ctrl+H, then clicking the Customize button on the dialog, which brings up a "Search Page Selection" dialog which allows you to hide or show tabs on the Search dialog. I hid the tabs other than "File Search," which causes "File Search" to be activated by default on future uses of Ctrl+H.

As far as I know, the search window tab depend of the open file you're on when calling the search function. So, for example if your on a web.xml file, it will open the "plug-in search" instead of the "java-search".
Edit: there is a way to force the default open tab, by assigning a shortcut to the "File Search" action in the "Keys" preference panel.

Probably this feature came recently [confirmed its there in since Juno] and looks intelligent.
Press Ctrl+H --> Customize --> [Checkbox] Remember last used page.
This way you are not far from other options if required anytime. So if you use File search often then you will not get annoyed getting what you last chose.

I would like to provide a workaround here:
you can 'remember last used page' to avoid opening it over and over again.

UPDATE: user #muescha, in the comments underneath the question, just pointed out to me that I accidentally answered the wrong question! Nevertheless, it is still a valuable answer (just not to this question), so I'm leaving it.
My answer answers the question: How do I use a hotkey directly to search for a File in Eclipse?
Ctrl + Shift + R works fantastically! Use asterisks (*) for wildcards. It is very similar to the Ctrl + P fuzzy search in Sublime Text 3.
Sample searches using the Ctrl + Shift + R "Open Resource" search in Eclipse:
rea
*.txt
*32*f1*c
*3*1*c*h
Notice if you just put an asterisk * between every character in the search string it works just like Sublime Text 3's Ctrl + P "fuzzy search"! Beautiful!
Side note: you can also use the Search --> File menu dialog to search for files.

Related

Keyboard shortcut for "open next search result"?

Eclipse has this great feature of searching text in Workspace(Ctrl+Alt+G), Project, File or Working Set.
The results are displayed neatly in a Search tab/view and when I double-click (i.e. mouse) a particular line, the file (in which that searched text is found) is open exactly at where the search text is.
Is there a keyboard shortcut for that double-click? To open the next one?
There is not one keyboard shortcut to perform this action that I know of, but there are two of them that could work in sequence.
Go to Window > Prefs > Keys
Search for "Show view search"
Set some custom keyboard shortcut because the default one is too long to be efficient (I like to use Alt+Shift+S)
Perform your search
With the search view in focus double-click the first result
When you are ready to go to next item, use a keyboard shortcut to show search view again (Alt+Shift+S for me)
Then press 'Ctrl+.'
This shortcut will display the next result and open a new file is needed.
So with this sequence you can use two keyboard shortcuts (Alt+Shift+S then Ctrl+.) to do what you want.
Checkout the Eclipse Keyboard Shortcuts PDF list for v2.1, v3.0, and v3.1 HERE
#gamerson has the right answer, but for the future I wanted to make sure you are aware of two key meta keyboard shortcuts:
Ctrl-Shift-L (Command-Shift-L on Mac) - Opens up a searchable list of available shortcuts.
Ctrl-3 (Command-3 on Mac) - Quick Access gives you a searchable, prioritized list of a bunch of stuff - commands, menu items, windows, tabs, etc. It's pretty darn useful.

Eclipse Short Cut: File Search

I have looked and looked but I cannot find a shortcut for "File Search" in Eclipse.
I even downloaded the mousefeed plugin. (It is pretty cool whenever you do something with the mouse. A little popup comes up and tells you how you could have done that with a shortcut. Not super useful but somewhat useful.)

			
				
ctrl + H opens the search dialogue box. Click on customize and check the option 'Remember last used page'. First time you have to select the tab file search and perform a search. After that if you press ctrl + H , it will automatically point to file search tab.
There is none, but if you go to Windows - Preferences - General - Keys, and type File search in the filter text box, you'll then be able to select the File search action, and type your own key binding.
You can change all shortcut keys in eclipse for instance:
Window -> Preferences -> General -> Keys -> search: File Search -> Binding -> *what ever key combination you like.

Is there a "Find in Files" shortcut in Eclipse?

Is there a "Find in Files" shortcut in Eclipse, as there is in Visual Studio (Ctrl+Shift+F)?
I have looked in these two lists:
Eclipse Shortcuts
"Show All Shortcuts" shortcut: Ctrl+Shift+L.
Thanks.
select workspace and press Ctrl-H
Which dialog is selected, depends on which file type is selected in the Project Explorer view. For example, if you selected a .js file and press Ctrl-H, it will bring up the dialog with the "Javascript Search" tab selected. If you want to search all files, you can press Ctrl-F7 to select the Project Explorer view, use arrow keys to select a folder above your files, then press Ctrl-H (or select a file, whose type doesn't trigger a custom dialog tab).
Thanks to the other two solutions, but here is the complete answer I was looking for, which addresses how I search all the text within the files, not just types, methods, packages, constructors, and fields:
Ctrl+H to open the "Search" dialog box
"File Search" tab, if it does not appear, expand the window or use the left/right arrows
type in the text to search for
Use "*.java", in my case since I am coding in Java, to search just these files
Click "Search"
If you are using only the File Search, you can Disable all other Searches in the Search Panel (Customize... lower left Corner). Then you have the File Search everytime you Press Ctrl+H
Ctrl+H to bring up the search box
Click 'Customize' in the lower left
Checkmark 'Remember last used page'
Click OK.
Select the file search tab and do a search
If you want to use the type-specific search (Java, Javascript ...etc) you can use Ctrl+H, which opens the search dialog, then click the Search button.
If you simply want to search for all text occurrences in the whole the workspace click the word (or select the text) you want to search then hit Ctrl+Alt+G. You will directly get all the found occurrences without even using a dialog box.
I find Ctrl+Alt+G is the best solution because it shows the variable name in different by related files (e.g. Java and XML, or Javascript and HTML) while still having the type-specific search feature available through Ctrl+H
You can rebind the Ctrl+Alt+G to finding text in a project or a working set instead of the whole workspace if that's more appealing to you.
Yes, there is shortcuts for searching Eclipse, these shortcuts are very useful when we search for particular html, jsp , xml, java, properties ,class, jar,search file with keywords.
Ctrl+H is used open Tag, in that you can select type of file Remote Search, File search, git search, java search, javascript search , etc
Ctrl+Shift+R is used to search all files in the current project
Ctrl+Shift+T is used to search all files in the workspace
press Ctrl + H . Then choose "File Search" tab.
additional search options
search for resources press Ctrl + Shift + R
search for Java types press Ctrl + Shift + T
Source: Eclipse: Default to "File Search" Tab in Search Dialog
Go to your key bindings Windows > Preferences > General > Keys
Unbind the Shorcut "Ctrl+H" for the "Open Search Dialog"
Filter/Search for "File Search" and use the "Ctrl+H" here instead.
I believe adding plug-ins power your needs.
If you install Plug-in named InstaSearch it makes your searching faster inside current active working projects.
It shows the result as you type.
http://marketplace.eclipse.org/content/instasearch#.VIp-_5_PGPQ
As pointed out, CTRL + H opens the Search dialog.
Since I use only Find in Files (and set File name patterns when needed), I clicked on Customize... button on the bottom of the Search dialog. It opens Search Page Selection dialog, where I turned off all other options.
You can also click on Remember last used page in the same dialog.
Ctrl+Alt+F (Find Text in Project -Customized Key)
Note - Ctrl+Alt+G is for Find text in a workspace, not in a project
How to customize this Key
Window->Preferance->General->Keys-> Search for 'Find Text in Project'->Type 'Ctrl+Alt+F' in binding ->Apply
Note - this will be helpful if the developer is working on multiple project simultaneously.

How to enable "live search" in eclipse?

In Komodo Edit, an input field is available in the toolbar. When I type text in it, it highlights matching search results. Is there something like this in Eclipse, either directly or via a plugin?
As TK Gospodinov has already mentioned, there is an Incremental option in Find/Replace (Ctrl+F) dialog.
There is also a special key binding for Incremental search in Eclipse (and personally I use it more frequently). From Eclipse Tips and Tricks:
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.
If you'd like to have search functionality in a toolbar, you may be interested in the eclipse-glance plugin, which allows you to use the incremental search function in a toolbar by pressing Ctrl + Alt + F while in any text area.
This feature is already available in eclipse. No need to install any plug-in.
Press Ctrl+F, and the Find pop up appears.
Now check the incremental checkbox, and then your texts will be found as you type. No need to hit return.
OR
Use Ctrl+J and you can activate the live search, just that there wont be any UI visible, but you can see the status in eclipse status bar at the bottom.
Press Ctrl+J, start typing the text you want to search for. Press esc to go back to edit mode
The closest thing to the functionality you are asking about is the 'incremental search' mode, which is triggered by checking the 'Incremental' checkbox in the Options group on the Find/Replace dialog in Eclipse (Ctrl+F from the code editor). This will make it start highlighting matches as you type, and if they are keywords, Eclipse will highlight other occurrences (references) in the code editor. Matches inside strings or Javadoc will not be highlighted, however, unless it happens to be the first match after your cursor's position inside the editor.
One similar thing (not the same) is just enabling "mark occurences", then selecting function name, variable etc.

Searching files in Eclipse

I want to search a file in Eclipse. What's the shorcut to open file search dialog box?
If you want to search in files: Ctrl+H and then choose tab File Search.
If you want to search for resources: Ctrl+Shift+R.
If you want to search for Java types: Ctrl+Shift+T.
If you want more shortcut keys: Ctrl+Shift+L.
There is no default shortcut to open the "Search a File" dialog directly.
Anyway you can use CTRL + H to open the "Search Dialog".
You can also use CTRL + Shift + L to open the "Key Assist" which will show you all configured shortcuts as a kind of tooltip.
Pressing again CTRL + Shift + L in the "Key Assist", you can directly configure your own shortcuts. Enter "File Search" for the filter and simply set your own key combination.
I often search for a file and want also to open it directly. So I use the "Search for Resource" Dialog called with CTRL + Shift + R.
Use the Window->Preferences menu and select the General-Keys tab to see and change any key binding.
Shortcut for this: Press two times CTRL + Shift + L
There's also a plugin called MouseFeed that shows all keyboard shortcuts for the menu operations you do. You could even set it to prevent you from using the menu alternative and force you to use the shortcut.
A good way to help you become quicker at using Eclipse.
Edit: The domain associated with the plugin seems to be gone now and replaced with a porn site. So at this point the status of the plugin is a bit unsure :)