34
votes

In Eclipse the keyboard shortcut to find next occurrence of a word in a file was Ctrl + k . It finds the occurrence of the selected word in a file one by one in a loop. What is the equivalent keyboard shortcut for IntelliJ IDEA? If not can we configure it some how?

14

14 Answers

28
votes

First you'll have to highlight a symbol by pressing Ctrl+Shift+F7.

Then you just press F3 or Shift+F3 no navigate between the highlighted symbols.

When done you press Esc to exit the highlight searching.

It is all described on Highlightning Usages in IntelliJ Web Help.

23
votes

Add selection for the next occurrence on Linux Alt+J

15
votes

In Android Studio 1.4, apparently Mac OS default keyboard shortcuts for element next occurrence (vars, methods, etc) are

  • NEXT/FWD: Command+G

  • PREVIOUS: Shift+Command+G

I did try all the answers w/out success, and finally I looked it up in Prefs->Key Bindings

13
votes

On Mac it's Command + G, but you can check what works for your OS by looking at Edit -> Find -> Find Next....

image

AFAIK you have to select the word in the search bar first.. So, Command + F and then Command + G to go to the next occurrence.

4
votes

There are also hotkeys for navigating next/previous highlighted usages.

Several years ago they were Alt+Wheel down and Alt+Wheel up. Today they are not set by default.

You can find them in Keymap preferences with highlighted element usage search phrase.

Keymap Preferences search highlighted element usage

3
votes

Please consider using the Multiple Selections for this:

  1. Select the term you want to lookup;
  2. Use Alt+J / Shift+Alt+J (or Ctrl+G / Shift+Ctrl+G for Mac OS X) to select other occurrences.

It will work the same as Shift+F3, but it will select every next occurrences. I found this way much more conveniant, as you can choose to edit all the matching string or just move the cursor to edit the last selected one (←/→).

The Multiple Selections feature is available since IntelliJ IDEA 13.1 RC, and compete with Atom or Sublime Text similar feature.

2
votes

I could not get any of IntelliJ's native options for Find Next/Previous to behave like in Eclipse. Find Word at Caret comes close, but it only allows you to slurp and find the next word, not previous.

I wrote an IntelliJ plugin to reproduce the exact behavior as in Eclipse. You can find it here: https://plugins.jetbrains.com/plugin/10635-quick-find-plugin

1
votes

For MAC: First you'll have to highlight a symbol by pressing Command+Shift+F7.

Then for next occurrence Command+G or Command+Shift+G

0
votes

On my Mac it is:

ctrl-l to find next occurrence
ctrl-shift-l to find previous occurrence
0
votes

IntelliJ Keyboard Shortcuts

On Ubuntu:

Next occurrence of selected word: F3

0
votes

To expand the question slightly, the method to display the next occurrence of a search term in the Find In Path pane, is to steer to it using the up/down arrows and then hit Enter.

0
votes

you can set shortcuts same as in eclipse by setting keymap value as eclipse.

Steps in intellij: Go to setting in file

search for keymap

search for keymap

In the dropdown section set Eclipse

Now all your shortcuts are same as in eclipse.

-1
votes

Start by looking for all occurrence of the key (control + g)

Then use ( shift + command + g ) to find previous occurrence and ( command + g ) to find next occurrence.