Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse navigate to next/previous marked occurrence

Tags:

eclipse

Eclipse has the Mark Occurrences feature where it highlights all occurrences of a selected variable/method. Is there a way to navigate to next or previous marked occurrence?

like image 211
Steve Kuo Avatar asked Oct 26 '10 00:10

Steve Kuo


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.

How do I select multiple words in eclipse?

Press Alt+Shift+Up several times until the method is selected. Each time you press this key, Eclipse will select the enclosing element of the current selection.


2 Answers

To skip between highlighted occurrences only, try the following:

  • Above the editor Window, select the down arrow next to the next annotation button.

    Button location

  • Adjust the selection so that only "Occurrences" is marked.

Now, when you click on an item to highlight it, you can skip forwards and backwards to other occurrences using Ctrl+(comma) and Ctrl+(period).

like image 132
Duncan Jones Avatar answered Sep 30 '22 11:09

Duncan Jones


After selecting a piece of text:

  • Next occurrence is ctrl+k.

  • Previous occurrence is ctrl+shift+k.

like image 39
Rebecca Chernoff Avatar answered Sep 30 '22 09:09

Rebecca Chernoff