PHPStorm - Find and Replace Text in Selection?

If you are using the Default keymapping (you can also use the keymaps for Eclipse, Visual Studio, etc) press Ctrl+r to show the Replace Toolbar. If you already have a selection then the option In Selection will already be checked, otherwise you can check it and then do your selection (if you select first and check the option second it will unselect the text after checking the option).

The feature is called Replace in the Keymap configuration if you wish to change the shortcut.

You can also press Shift+F6 to directly rename variables if that's what you want to do.


  1. Highlight the code selection you wish to work on ( you can use alt + arrow up if your looking for a cool way to do that)
  2. Press Ctlr + r on PC or Command + r on a Mac
  3. In the upper options window, insert the values you wish to replace
  4. Select the "in selection" check box
  5. Press Replace/Replace all button

Tags:

Phpstorm