Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard shortcut to navigate to next/previous search match in eclipse for java

Is it possible to assign a shortcut to this function?

like image 862
jumar Avatar asked Nov 04 '09 15:11

jumar


People also ask

How do I go back to the previous line in Eclipse?

Press Alt+Left to go back to the previous editor and Alt+Right to go forward.

What is Ctrl Shift G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.

What is Ctrl K in Eclipse?

In Eclipse, if the cursor is over a word and you press Ctrl + K you will jump to the next occurrence of that word in the file.

What is the shortcut for search in Eclipse?

The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.


2 Answers

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.

like image 196
gordon Avatar answered Nov 02 '22 01:11

gordon


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.

like image 22
Inusable Lumière Avatar answered Nov 02 '22 00:11

Inusable Lumière