score:146

Accepted answer

you can just define a key binding that opens the file search:

  1. go to preferences > general > keys
  2. 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.)
  3. put the caret into the binding text box and press the key combination you want to use:

enter image description here

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.

score:0

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

enter image description here

*.txt

enter image description here

*32*f1*c

enter image description here

*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!

enter image description here


side note: you can also use the search --> file menu dialog to search for files.

score:1

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.

score:1

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.

score:1

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

enter image description here

score:2

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.

score:11

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.

score:18

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).

customize view

score:49

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


Related Query

More Query from same tag