7

I want to hit a shortkey and replace all in Pycharm. After I hit ctrl+R, I key in text to search and text as replacement. I need to click "Replace" / " Replace all". I currently move my hand to mouse and click the button, but I do it many times in a day. Anyone knows what is the shortkey? Thanks.

Here's the official document shows how to find and replace by click the button https://www.jetbrains.com/help/pycharm/2016.3/finding-and-replacing-text-in-project.html

Lisa
  • 4,126
  • 12
  • 42
  • 71

4 Answers4

19

ctrl+r by default (ctrl+shift+r for replace in all files)

however if you are using a different keymap it maybe different you can check under settings (under keymap>main menu> edit> find> replace)

enter image description here

after you type the replacement word you can press enter to perform the default action (replace this occurance... ) or you can press alt + the underlined letter on the button label (ie alt+a => replace all) to perform a different action ...

Community
  • 1
  • 1
Joran Beasley
  • 110,522
  • 12
  • 160
  • 179
2

Turns out this is quite simple: Alt + a

Replace All. PyCharm 2020.3 on Ubuntu 18.04

Yury Danilin
  • 71
  • 1
  • 4
1

You can either select the word or move the cursor to the end of the word, and then the shortcut to replace all is Shift + F6. Type the replacement, and hit Enter.

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
DEEPAK SURANA
  • 431
  • 3
  • 14
0

you can select the code and then press on ctrl+g multiple times to select all the occurrences. this way you will have multiple cursors blinking on the text.

so if you press "delete" everything will be deleted and multiple cursors still will be active. you type whatever you want to replace it with and once you press "enter" everything will be replaced with the new text and multiple cursor will de deactive.

Yilmaz
  • 35,338
  • 10
  • 157
  • 202