19

Is it possible to assign a shortcut to this function?

4 Answers 4

27

CTRL+K forward and CTRL+SHIFT+K back :

Highlight a word or phrase you want to search for. Hitting CTRL+K will take you to the next without having to open the Search control window. Please also upvote @feedbackloop for his comment here/below with the shortcut to go to the previous!

I'm using CFEclipse. I don't know if the same applies to what workbench you're using.

2
  • 9
    I was looking for the same: It's Ctrl+Shift+k. Jun 14, 2012 at 22:39
  • 1
    Epic! better than Ctrl+j I have been using. Feb 13, 2015 at 6:19
21

The solution I use to go to next/previous search match even when the search result view is not focused is as follows:

  • Use the prev/next shortcuts as usual when the search view is focused: Ctrl + . and Ctrl + ,.
  • Configure the same keys to focus the search result view when it's not focused. Window > Preferences > General > Keys - Search: "Show View (Search)", Press "Copy Command", Set binding: "CTRL+.", when: "Editing Text" (and similar configuration for "CTRL+,").

That way these keyboard shortcuts will work both when search results are active and inactive.

Note: In order not to sacrifice the ability to use shortcut keys to navigate to previous/next results in other views (e.g. Problems view, etc) you can assign different keys for navigating the currently focused view.

2
  • 3
    Great solution. P.S.: After switching through search results, F12 focuses the editor again (setting "Activate Editor").
    – AndiDog
    Mar 19, 2015 at 11:11
  • Needs double tap...fair enough. Thanks. Feb 6, 2018 at 15:39
12

If you hover over the arrows to get to the next or previous result, eclipse shows you the shortcut: Ctrl + . and Ctrl + ,.

2
  • 16
    What about doing this without having to active the search result window first? Nov 16, 2010 at 8:51
  • 1
    @ArneEvertsson, I posted below how to achieve this without having to activate the search result window first Jan 15, 2014 at 18:46
1

The best way I could find was to use AutoHotkey. Eg, when ctrl+alt+right is pressed, it focuses the search view (+!qs), does next (^.), then focuses the editor (^e).

#If WinActive("ahk_exe eclipse.exe") && WinActive("ahk_class SWT_Window0")
    ^!Right::Send +!qs^.^e
    ^!Left::Send +!qs^,^e
#If
2
  • 1
    This is great thank you. I used {enter} instead of ^e as enter opens editor and focuses result whereas eclipse neon popped up a menu with ^e.
    – Kerridge0
    Oct 23, 2019 at 16:20
  • Ah probably I customized my key bindings to use ^e (ctrl+e) to focus the editor.
    – NateS
    Oct 25, 2019 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.