100

In IntelliJ IDEA, is there an option to find and replace a symbol for whole project with on time operation?

isherwood
  • 58,414
  • 16
  • 114
  • 157
Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87

3 Answers3

147

EDIT:

Here is the Visual representation for better understanding.

Replacing a piece of text in all the files within the specified path do one of the following:

  • On the main menu, choose Edit | Find | Replace in Path
  • Press Ctrl + Shift + R

You can try Ctrl + Shift + F.

And if you are using Eclipse keymap for IntelliJ then you can use Ctrl + H.

Shreyos Adikari
  • 12,348
  • 19
  • 73
  • 82
  • 3
    For my question it should be Ctrl+Shift+R right? :)) – Supun Wijerathne Sep 06 '16 at 03:41
  • 9
    **Ctrl+Shift+R** is the answer. Then you click *Replace* in the *Replace in Path* dialog box. But here's the bizarre thing: nothing gets replaced! The dialog box closes and a window opens at the bottom part of the screen showing occurrences. Then you need to click the *Replace All* button in that window. Then a new dialog box pops up where you need to click the *Replace* button yet again. **Inefficient UI, poor Ux**. – Paulo Merson Jan 31 '19 at 13:07
  • 1
    `cmd+r` for Mac users – maxshuty May 18 '20 at 19:53
  • 1
    ctrl+shift+h here using the vscode keymap – tedi Jan 13 '21 at 17:48
9

Windows/Linux Shortcut

CTRLSHIFTR

MacOS Shortcut

shift ⇧command ⌘R

Common Shortcut

Press SHIFT twice and type Replace in Path

You get an option to apply file mask, scope, etc.

Saikat
  • 14,222
  • 20
  • 104
  • 125
1

For me, worked:

Ctrl + H - To replace all occurrences in a specific file

Ctrl + Shift + H - To replace all occurrences in all files

But I remember I have configured my key map in VSCode style. Also, I am working on Ubuntu 20.04.2 LTS, but it looks unrelated.

Hosana Gomes
  • 337
  • 4
  • 6