Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to go to next/previous occurrence in current editor tab?

In eclipse, you can go to the previous/next occurrence of the selected word by pressing ctrl+, / ctrl+..

What is the equivalent in IntelliJ IDEA?

like image 486
chance Avatar asked Aug 23 '13 13:08

chance


People also ask

How to Go back to Previous step in IntelliJ?

To navigate backwards, press Ctrl+Alt+Left . To navigate forward, press Ctrl+Alt+Right . To navigate to the last edited location, press Ctrl+Shift+Backspace .

How do I select all occurrences of a word in Intellij?

Use ⌃⌘G (macOS), or Ctrl+Alt+Shift+J (Windows/Linux), to select all occurrences of the same word.


2 Answers

The feature is called Find Word at Caret:

Search for a word at caret enables you to quickly find the exact match for the current word, without changing any search options. With the match once found, you can navigate between the occurrences of the term.

You can use Ctrl+F3 for that:

  • select a word at caret

  • hit Ctrl+F3 and then F3 or Shift+F3 to navigate to the next/previous occurrence

Mac OS

Please note that there is no shortcut on Mac OS. You'd need to use Cmd+Shift+a and type "Find Word At Caret" ("find wo" should be enough) or on the main menu, choose Edit | Find | Find Word At Caret. Press Cmd+g to navigate to go to the next occurrence.

Separate Plugin

Or, try this plugin - it supports using Shift+Alt+Up and Shift+Alt+Down to navigate up and down to each identifier occurrence

To make this feature available by default please, vote for IDEA-59638

like image 122
lena Avatar answered Sep 22 '22 00:09

lena


Use Ctrl+Shift+F7 to highlight the usages of some variable in the current file, then use F3 or Shift+F3 to navigate through the highlighted usages.

(It works in IntelliJ IDEA 2016.1.3)

like image 37
chance Avatar answered Sep 20 '22 00:09

chance