Feature Request: Global “Next Search Result” Navigation in Eclipse
Currently, performing text searches and manual edits in Eclipse requires a lot of mouse interaction. For example:
- Create 2 documents, each containing the term "test".
- Press Ctrl+H to search for "test".
- Click on the first search result and edit the text.
If the user wants to move to the next search result, they must manually switch to the Search view and either click the Next button or use the corresponding shortcut. Then they need to double-click the next search result to jump to the change.
This workflow is time-consuming and interrupts focus, especially when reviewing and editing multiple occurrences across several files.
An old example implementation by Paul Webster (see below) demonstrates a more efficient approach, allowing a global “jump to next search result” that works without focusing the Search view.
It would be highly valuable to integrate this feature into the standard Eclipse IDE, so users can navigate search results quickly with a global shortcut.
References:
Original example implementation: Paul Webster, Bug 328460
Hey Vogella, My team, @mikeng07, @ShuWald, @johnny603 and I are currently working on this issue through CodeDay Labs. CodeDay is partnering with Eclipse on this open-source initiative, and we’re excited to contribute!
Cool, Let's do it 👍
Looking forward to working with you guys!
Small video how it could work, as you see the editor has focus and by pressing a shortcut the next search result it selected and the corresponding editor is opened:
https://github.com/user-attachments/assets/ac79ed40-3d25-48fa-9584-9a307bae7d36
Thank you so much for the helpful video! Just to confirm - is this the feature we need to integrate directly into the Eclipse IDE?
Also, this is the correct repository to clone for working on the issue, right? → https://github.com/eclipse-platform/eclipse.platform.ui
I'd really appreciate it if you could point us to the relevant folders or files we should be looking into to implement this feature. Thanks again for the guidance!
I have a plan on where to examine after breaking down the issue and exploring repo
/bundles/org.eclipse.search: This bundle is responsible for search-related functionality in Eclipse. It likely contains code for the Search view, search result navigation, and associated actions and keybindings.
/bundles/org.eclipse.ui.workbench: This bundle manages global UI actions, command/keybinding infrastructure, and focus handling. Modifications here could enable global shortcuts and cross-view navigation.
Next steps: In org.eclipse.search, look for existing navigation commands/actions (such as “Next Search Result”) and see how their scope is restricted to the Search view.
In org.eclipse.ui.workbench, investigate how global commands and keybindings are registered and handled, especially for actions that should work regardless of which view/editor is focused.
Add Global Search Result Navigation Shortcuts
What
Add ALT+. and ALT+, shortcuts to navigate search results globally without switching views.
Why
Currently users must manually switch to Search view to navigate between results, interrupting their editing workflow.
How
- New
GlobalNextPrevSearchEntryHandlerthat executes: show Search view → navigate → activate editor - Added commands and key bindings in
plugin.xml - Added message strings for internationalization
Result
Users can now press ALT+. and ALT+, from anywhere in Eclipse to seamlessly navigate through search results while editing.
I'd really appreciate it if you could take a moment to review my code. Thank you in advance! @vogella
https://github.com/user-attachments/assets/170e288f-0f7a-4cdf-9c5e-025266e43a5e
Hi, @NikkiAung and I just wanted to share our current progress on the feature and ask for any possible feedback to know that we are on the right track. Here is a video demonstrating our current ALT + . or ALT + , functionality on Windows. The distinction between this command and the CTRL + . or CTRL + , command to navigate through the search results was a point of confusion for our team, so just wanted to clarify that these commands(ALT + . or ALT + ,) work for navigating through the most recent search's results even if the currently selected search result(in the IDE's files or folders) is modified, or the user clicks around/starts working on something else not related to search. I also wanted to note that we have yet to test the feature for Linux/Mac users