Keyboard shortcut to navigate to next/previous search match in eclipse for java
Is it possible to assign a shor开发者_JAVA百科tcut to this function?
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.
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.
If you hover over the arrows to get to the next or previous result, eclipse shows you the shortcut: Ctrl + . and Ctrl + ,.
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
精彩评论