33

I usually want to have all the search results (from ctrl-H) fully expanded, but only the first leaf node is expanded by default.

What I end up doing is clicking the "Expand All" button in the Search view but this is tedious.

Is there a way to automatically have results fully expanded?

prismaticorb
  • 895
  • 1
  • 8
  • 18
  • Possible duplicate of http://stackoverflow.com/questions/3159791/is-there-way-to-expand-all-folders-in-eclipse-project-view-and-search-results – Steve Chambers Dec 03 '13 at 09:01
  • 2
    Mark `Search/ViewMenu/ShowAsList`, and also `SortBy/ParentName`. The tree mode is very annoying indeed. – Aquarius Power Feb 04 '16 at 03:14

3 Answers3

19

No but you can use the keyboard shortcuts of your OS. On Linux, use Nk* (* on the numpad) to expand the current node and all children.

Windows user can use Shift+Nk*

On the Mac, select all nodes with Command+A and then expand them with Command+Right Arrow

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • Do you know the windows shortcut? – prismaticorb May 11 '12 at 15:47
  • 1
    Any shortcut for Mac OS X? Cmd+Shift+Numpad_* is only working in the Editors and not in the Search Results. All I found is Alt+Right_Arrow, but you have to be on the root node, which is as tedious as using the (+) button. – dbernard Nov 09 '12 at 14:00
  • Do you know what the term for this function in `Preferences -> Keys` is? I would like to remap it, but can't find it. – Henrik Heimbuerger Aug 18 '13 at 07:24
  • @hheimbuerger: It's not in the preferences since it's the OS widgets default behavior (i.e. Java never notices this). – Aaron Digulla Aug 19 '13 at 09:08
  • @AaronDigulla I see. I was just hoping that as there's a toolbar button to trigger this, one could also bind it to a key. – Henrik Heimbuerger Aug 19 '13 at 14:38
  • Sometimes, there is a toolbar button but most of the time, it's only a "-" button (collapse all). – Aaron Digulla Aug 19 '13 at 14:42
  • 2
    On Mac it is Alt+Right Arrow or Alt+Left Arrow – Uriel Frankel Feb 06 '14 at 16:32
  • 2
    This only fully opens the current tree if you have clicked on any line in the search window. And you have to click on something because by default nothing is selected in the search window and the keypress will do nothing. – simpleuser Mar 08 '16 at 16:05
3

On a Mac without the numpad, to avoid moving the mouse:

  • do the search

  • the focus moves in the search view

    (make sure to close the Find/Replace dialog before searching, otherwise it would take the focus)

  • do this sequence quickly:

    • Alt ⎇ + ▲ Up Arrow (select the root node)
    • Alt ⎇ + ◀ Left Arrow (collapse the root node)
    • Alt ⎇ + ► Right Arrow (expand the root node)

      (For some reason + doesn't expand all of the root children, first you have to collapse it.)

This is faster than clicking on the small + icon.

mindrones
  • 1,173
  • 11
  • 15
3

On a Windows without a numpad, the following can help to expand the search result fast without click the mouse.

This method does not expand result instantly, but i found it to be more convenient and faster than using mouse to click the + button on Eclipse.

  1. After search, hold onto ► Right Arrow to expand one search result to its end root

  2. Once reached the end root, press ▼ Down Arrow to move on to the next search result, hold onto ► Right Arrow to expand one search result to its end root

  3. Repeat step 1 and step 2 until all results are expanded.